void_map.h
author bjarni
Thu, 05 Oct 2006 12:59:28 +0000
changeset 4739 e626ef1b522e
parent 4666 172a0cdf28a6
permissions -rw-r--r--
(svn r6651) -Coding feature: added the windowevent WE_INVALIDATE_DATA
This gives the ability to invalidate some window data and recalculate as needed instead of doing it for each WE_PAINT

This event is called right away when using InvalidateWindowData(), so it may be a good idea to set a bool or similar in the window
or similar and then act on that bool in WE_PAINT instead of doing a lot of stuff in WE_INVALIDATE_DATA as it might be called more than once before WE_PAINT is called

InvalidateWindowData() will not automatically repaint the window, so if you want to repaint it as well, you need to mark it dirty as well.

Made the depot windows use WE_INVALIDATE_DATA to set when to generate the engine and wagon lists instead of at each redraw
It makes no sense to regenerate the list when say using the scrollbar if we know that no vehicle have entered or left the list

NOTE: currently there is a piece of code to generate the list when it's not needed and compare it to the stored list and assert if they mismatch
This check is somewhat slow and kills the whole idea of WE_INVALIDATE_DATA, so it's a short lived one to verify that InvalidateWindowData() is used everywhere where it's needed
3075
fd64f71655eb (svn r3664) Add a function to turn a tile into a void tile
tron
parents:
diff changeset
     1
/* $Id$ */
fd64f71655eb (svn r3664) Add a function to turn a tile into a void tile
tron
parents:
diff changeset
     2
3145
e833d7a78887 (svn r3765) Fix some naming glitches in r3763 and add missing svn properties
tron
parents: 3144
diff changeset
     3
#ifndef VOID_MAP_H
e833d7a78887 (svn r3765) Fix some naming glitches in r3763 and add missing svn properties
tron
parents: 3144
diff changeset
     4
#define VOID_MAP_H
e833d7a78887 (svn r3765) Fix some naming glitches in r3763 and add missing svn properties
tron
parents: 3144
diff changeset
     5
3075
fd64f71655eb (svn r3664) Add a function to turn a tile into a void tile
tron
parents:
diff changeset
     6
static inline void MakeVoid(TileIndex t)
fd64f71655eb (svn r3664) Add a function to turn a tile into a void tile
tron
parents:
diff changeset
     7
{
fd64f71655eb (svn r3664) Add a function to turn a tile into a void tile
tron
parents:
diff changeset
     8
	SetTileType(t, MP_VOID);
3080
ab1fdf87033b (svn r3669) Really wipe all data when making a void tile
tron
parents: 3075
diff changeset
     9
	SetTileHeight(t, 0);
ab1fdf87033b (svn r3669) Really wipe all data when making a void tile
tron
parents: 3075
diff changeset
    10
	_m[t].m1 = 0;
ab1fdf87033b (svn r3669) Really wipe all data when making a void tile
tron
parents: 3075
diff changeset
    11
	_m[t].m2 = 0;
ab1fdf87033b (svn r3669) Really wipe all data when making a void tile
tron
parents: 3075
diff changeset
    12
	_m[t].m3 = 0;
ab1fdf87033b (svn r3669) Really wipe all data when making a void tile
tron
parents: 3075
diff changeset
    13
	_m[t].m4 = 0;
ab1fdf87033b (svn r3669) Really wipe all data when making a void tile
tron
parents: 3075
diff changeset
    14
	_m[t].m5 = 0;
ab1fdf87033b (svn r3669) Really wipe all data when making a void tile
tron
parents: 3075
diff changeset
    15
	_m[t].extra = 0;
3075
fd64f71655eb (svn r3664) Add a function to turn a tile into a void tile
tron
parents:
diff changeset
    16
}
3145
e833d7a78887 (svn r3765) Fix some naming glitches in r3763 and add missing svn properties
tron
parents: 3144
diff changeset
    17
4666
172a0cdf28a6 (svn r6560) - Codechange: Minor fix; add missing #include guards and comments, and correct svn properties on bmp.[ch]
peter1138
parents: 3145
diff changeset
    18
#endif /* VOID_MAP_H */