File tree 2 files changed +6
-20
lines changed
2 files changed +6
-20
lines changed Original file line number Diff line number Diff line change 5
5
void PowerFloodFill (uint8_t x, uint8_t y);
6
6
uint8_t * GetPowerGrid ();
7
7
8
- #ifdef _WIN32
9
- // A 1 bit per tile representation of which tiles are powered
10
- inline uint8_t * GetPowerGrid ()
11
- {
12
- // TODO: if arduboy then reuse the screen buffer memory
13
- static uint8_t PowerGrid[DISPLAY_WIDTH * DISPLAY_HEIGHT / 8 ];
14
-
15
- return PowerGrid;
16
- }
17
- #endif
18
-
19
8
uint8_t GetConnections (int x, int y)
20
9
{
21
10
if (x >= 0 && x < MAP_WIDTH && y >= 0 && y < MAP_HEIGHT)
@@ -445,15 +434,7 @@ void PowerFloodFill(uint8_t x, uint8_t y)
445
434
void PowerFloodFill (uint8_t x, uint8_t y)
446
435
{
447
436
uint8_t * grid = (uint8_t *)GetPowerGrid ();
448
- uint8_t * ptr = grid;
449
- int count = MAP_WIDTH * MAP_HEIGHT / 8 ;
450
-
451
- while (count--)
452
- {
453
- *ptr++ = 0 ;
454
- }
455
-
456
- uint8_t * stackPtr = ptr;
437
+ uint8_t * stackPtr = grid;
457
438
uint8_t stackSize = 0 ;
458
439
459
440
STACK_PUSH (x, y);
Original file line number Diff line number Diff line change @@ -106,6 +106,11 @@ uint8_t GetInput()
106
106
return InputMask;
107
107
}
108
108
109
+ uint8_t * GetPowerGrid ()
110
+ {
111
+ static uint8_t PowerGrid[DISPLAY_WIDTH * DISPLAY_HEIGHT / 8 ];
112
+ return PowerGrid;
113
+ }
109
114
110
115
int main (int argc, char * argv[])
111
116
{
You can’t perform that action at this time.
0 commit comments