mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-11-05 18:59:41 +01:00
6192269128
There's really no need to put the y-multiplication in a lookup table. The compiler will optimize the multiplication better than putting it in a lookup table will. To improve readability and to hardcode things less, the new SCREEN_WIDTH_TILES and SCREEN_HEIGHT_TILES constant names are used, as well as adding a new TILE_IDX macro to calculate the index of a tile in a concatenated-rows (row-major in formal parlance) array. Also, tile numbers are stored in a temporary variable to improve readability as well (no more copy-pasting `contents[i + vmult[j]]` over and over again).
34 lines
470 B
C++
34 lines
470 B
C++
#ifndef TOWER_H
|
|
#define TOWER_H
|
|
|
|
class towerclass
|
|
{
|
|
public:
|
|
towerclass(void);
|
|
|
|
int backat(int xp, int yp, int yoff);
|
|
|
|
int at(int xp, int yp, int yoff);
|
|
|
|
int miniat(int xp, int yp, int yoff);
|
|
|
|
void loadminitower1(void);
|
|
|
|
void loadminitower2(void);
|
|
|
|
void loadbackground(void);
|
|
|
|
void loadmap(void);
|
|
|
|
short back[40 * 120];
|
|
short contents[40 * 700];
|
|
short minitower[40 * 100];
|
|
|
|
bool minitowermode;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* TOWER_H */
|