Re: TilemapRamino example
Posted: Sun May 28, 2017 2:40 am
I'm a slow typer and I had to debug but heres what I get......
and
When you say pass no arguments do you mean leave the () empty?
- Code: Select all
void drawTilemap2(int x, int y, const uint8_t *tilemap, const uint8_t **spritesheet, uint16_t color);
and
- Code: Select all
void Grafx_esp::drawTilemap2(int x, int y, const uint8_t *tilemap, const uint8_t **spritesheet, uint16_t color) {
for (unsigned int y = 0; y <15;y++){
for (unsigned int x = 0; y <20;x++){
int tile = pgm_read_byte(data + (x + y* ));
drawBitmap1(x * 16, y * 16, tile, color);
}
}
}
- Code: Select all
Arduino: 1.8.1 (Windows 10), TD: 1.36, Board: "ESP32 Dev Module, 80MHz, 921600, None"
WARNING: library SPI claims to run on [esp32] architecture(s) and may be incompatible with your current board which runs on [Esp32] architecture(s).
In file included from C:\Users\chuck\OneDrive\Documents\Arduino\hardware\espressif\Esp32\cores\esp32/WString.h:29:0,
from C:\Users\chuck\OneDrive\Documents\Arduino\hardware\espressif\Esp32\cores\esp32/Arduino.h:149,
from C:\Users\chuck\OneDrive\Documents\Arduino\libraries\GameRIot_ESP\Grafx_esp.h:66,
from C:\Users\chuck\OneDrive\Documents\Arduino\libraries\GameRIot_ESP\Grafx_esp.cpp:50:
C:\Users\chuck\OneDrive\Documents\Arduino\libraries\GameRIot_ESP\Grafx_esp.cpp: In member function 'void Grafx_esp::drawTilemap2(int, int, const uint8_t*, const uint8_t**, uint16_t)':
C:\Users\chuck\OneDrive\Documents\Arduino\libraries\GameRIot_ESP\Grafx_esp.cpp:1191:27: error: 'data' was not declared in this scope
int tile = pgm_read_byte(data + (x + y* ));
^
C:\Users\chuck\OneDrive\Documents\Arduino\hardware\espressif\Esp32\cores\esp32/pgmspace.h:41:57: note: in definition of macro 'pgm_read_byte'
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
^
C:\Users\chuck\OneDrive\Documents\Arduino\libraries\GameRIot_ESP\Grafx_esp.cpp:1191:42: error: expected primary-expression before ')' token
int tile = pgm_read_byte(data + (x + y* ));
^
C:\Users\chuck\OneDrive\Documents\Arduino\hardware\espressif\Esp32\cores\esp32/pgmspace.h:41:57: note: in definition of macro 'pgm_read_byte'
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
^
C:\Users\chuck\OneDrive\Documents\Arduino\libraries\GameRIot_ESP\Grafx_esp.cpp:1192:41: error: no matching function for call to 'Grafx_esp::drawBitmap1(unsigned int, unsigned int, int&, uint16_t&)'
drawBitmap1(x * 16, y * 16, tile, color);
^
C:\Users\chuck\OneDrive\Documents\Arduino\libraries\GameRIot_ESP\Grafx_esp.cpp:1046:6: note: candidate: void Grafx_esp::drawBitmap1(int16_t, int16_t, const uint8_t*, int16_t, int16_t, uint16_t)
void Grafx_esp::drawBitmap1(int16_t x, int16_t y,
^
C:\Users\chuck\OneDrive\Documents\Arduino\libraries\GameRIot_ESP\Grafx_esp.cpp:1046:6: note: candidate expects 6 arguments, 4 provided
exit status 1
Error compiling for board ESP32 Dev Module.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
When you say pass no arguments do you mean leave the () empty?