(svn r6631) -Codechange: Use accessors for click_state.

Another step toward merging XTDwidget.
The only two files not converted (window.h and widget.c) will be done at the very last commit)
This commit is contained in:
belugas
2006-10-03 20:16:20 +00:00
parent bdaab39e64
commit 17eb65050b
23 changed files with 313 additions and 185 deletions

View File

@@ -865,9 +865,9 @@ static void SmallMapWindowProc(Window *w, WindowEvent *e)
case 8: // Show transport routes
case 9: // Show vegetation
case 10: // Show land owners
w->click_state &= ~( 1 << 5 | 1 << 6 | 1 << 7 | 1 << 8 | 1 << 9 | 1 << 10);
w->click_state |= 1 << e->we.click.widget;
RaiseWindowWidget(w, _smallmap_type + 5);
_smallmap_type = e->we.click.widget - 5;
LowerWindowWidget(w, _smallmap_type + 5);
SetWindowDirty(w);
SndPlayFx(SND_15_BEEP);
@@ -881,8 +881,8 @@ static void SmallMapWindowProc(Window *w, WindowEvent *e)
break;
case 12: // Toggle town names
w->click_state ^= (1 << 12);
_smallmap_show_towns = (w->click_state >> 12) & 1;
ToggleWidgetLoweredState(w, 12);
_smallmap_show_towns = IsWindowWidgetLowered(w, 12);
SetWindowDirty(w);
SndPlayFx(SND_15_BEEP);
@@ -982,7 +982,8 @@ void ShowSmallMap(void)
w = AllocateWindowDescFront(&_smallmap_desc, 0);
if (w == NULL) return;
w->click_state = ((1 << 5) << _smallmap_type) | (_smallmap_show_towns << 12);
LowerWindowWidget(w, _smallmap_type + 5);
SetWidgetLoweredState(w, 12, _smallmap_show_towns);
w->resize.width = 350;
w->resize.height = 250;