Changeset - r1990:e84971e2e6cd
[Not reviewed]
master
0 4 0
tron - 19 years ago 2005-06-29 08:14:09
tron@openttd.org
(svn r2496) -Fix: [1179933] When toggling build/remove via keyboard the selection wasn't correctly redrawn
4 files changed with 13 insertions and 4 deletions:
0 comments (0 inline, 0 general)
rail_gui.c
Show inline comments
 
@@ -288,9 +288,9 @@ static void BuildRailClick_Remove(Window
 
	SetWindowDirty(w);
 
	SndPlayFx(SND_15_BEEP);
 

	
 
	_thd.make_square_red = !!((w->click_state ^= (1 << 16)) & (1<<16));
 
	MarkTileDirty(_thd.pos.x, _thd.pos.y);
 
	w->click_state ^= (1 << 16);
 
	_remove_button_clicked = (w->click_state & (1 << 16)) != 0;
 
	SetSelectionRed((w->click_state & (1 << 16)) != 0);
 

	
 
	// handle station builder
 
	if( w->click_state & (1 << 16) )
road_gui.c
Show inline comments
 
@@ -159,8 +159,8 @@ static void BuildRoadClick_Remove(Window
 
		return;
 
	SetWindowDirty(w);
 
	SndPlayFx(SND_15_BEEP);
 
	_thd.make_square_red = !!((w->click_state ^= (1 << 11)) & (1<<11));
 
	MarkTileDirty(_thd.pos.x, _thd.pos.y);
 
	w->click_state ^= (1 << 11);
 
	SetSelectionRed((w->click_state & (1 << 11)) != 0);
 
}
 

	
 
static void BuildRoadClick_Landscaping(Window *w)
viewport.c
Show inline comments
 
@@ -1486,6 +1486,13 @@ static void SetSelectionTilesDirty(void)
 
}
 

	
 

	
 
void SetSelectionRed(bool b)
 
{
 
	_thd.make_square_red = b;
 
	SetSelectionTilesDirty();
 
}
 

	
 

	
 
static bool CheckClickOnTown(ViewPort *vp, int x, int y)
 
{
 
	Town *t;
viewport.h
Show inline comments
 
@@ -11,6 +11,8 @@ struct ViewPort {
 
	byte zoom;
 
};
 

	
 
void SetSelectionRed(bool);
 

	
 
/* viewport.c */
 
Point MapXYZToViewport(ViewPort *vp, uint x, uint y, uint z);
 
void AssignWindowViewport(Window *w, int x, int y,
0 comments (0 inline, 0 general)