13 |
#include "uiscreen_main.h" |
#include "uiscreen_main.h" |
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
//CONSTANTS |
//CONSTANTS |
20 |
static const int RECENTER_BUFFER = 3; // the buffer space in tiles that a pod must be outside of to warrant recentering the map |
static const int RECENTER_BUFFER = 3; // the buffer space in tiles that a pod must be outside of to warrant recentering the map |
21 |
|
static const long TIMING_LOOP_DELAY = 75; // ticks per re-display in MovePod() |
22 |
|
|
23 |
|
|
24 |
|
|
|
|
|
25 |
PG_MapWindow::PG_MapWindow(PG_Widget *parent, const PG_Rect &r): |
PG_MapWindow::PG_MapWindow(PG_Widget *parent, const PG_Rect &r): |
26 |
PG_Widget(parent, r, 0) // yes we do want an object drawing surface |
PG_Widget(parent, r, 0) // yes we do want an object drawing surface |
27 |
{ |
{ |
92 |
tile_array[x2 - bg_x][y2 - bg_y]->SetCoordsAndDraw(x2,y2); |
tile_array[x2 - bg_x][y2 - bg_y]->SetCoordsAndDraw(x2,y2); |
93 |
} |
} |
94 |
|
|
95 |
|
SDL_Delay(TIMING_LOOP_DELAY); |
96 |
|
|
97 |
} |
} |
98 |
|
|
99 |
|
|
102 |
|
|
103 |
void PG_MapWindow::CenterMap(int x, int y) { |
void PG_MapWindow::CenterMap(int x, int y) { |
104 |
|
|
105 |
int tile_size = rm->GetTileSize(); |
//int tile_size = rm->GetTileSize(); |
106 |
int maprows = themap->GetRows(); |
int maprows = themap->GetRows(); |
107 |
int mapcols = themap->GetCols(); |
int mapcols = themap->GetCols(); |
108 |
int v_dist = rows; // we need these temps in case screen is larger than whole map |
int v_dist = rows; // we need these temps in case screen is larger than whole map |