mirror of
https://github.com/JorjBauer/aiie.git
synced 2025-01-29 21:31:10 +00:00
remove constructs assuming the Y resolution < 256 pixels
This commit is contained in:
parent
67e020cb54
commit
9d53b3272e
@ -15,10 +15,10 @@ class PhysicalDisplay {
|
||||
virtual void blit() = 0; // blit everything to the display (including UI area)
|
||||
virtual void blit(AiieRect r) = 0; // blit a piece of the VM area to the display
|
||||
|
||||
virtual void drawImageOfSizeAt(const uint8_t *img, uint16_t sizex, uint8_t sizey, uint16_t wherex, uint8_t wherey) = 0;
|
||||
virtual void drawImageOfSizeAt(const uint8_t *img, uint16_t sizex, uint16_t sizey, uint16_t wherex, uint16_t wherey) = 0;
|
||||
|
||||
virtual void drawCharacter(uint8_t mode, uint16_t x, uint8_t y, char c) = 0;
|
||||
virtual void drawString(uint8_t mode, uint16_t x, uint8_t y, const char *str) = 0;
|
||||
virtual void drawCharacter(uint8_t mode, uint16_t x, uint16_t y, char c) = 0;
|
||||
virtual void drawString(uint8_t mode, uint16_t x, uint16_t y, const char *str) = 0;
|
||||
virtual void debugMsg(const char *msg) { strncpy(overlayMessage, msg, sizeof(overlayMessage));overlayMessage[strlen(overlayMessage)] = 0; }
|
||||
|
||||
virtual void drawPixel(uint16_t x, uint16_t y, uint16_t color) = 0;
|
||||
|
@ -101,10 +101,10 @@ void SDLDisplay::redraw()
|
||||
// images themselves aren't aware of the double resolution. This is an
|
||||
// inconsistency that probably should be addressed. FIXME?
|
||||
void SDLDisplay::drawImageOfSizeAt(const uint8_t *img,
|
||||
uint16_t sizex, uint8_t sizey,
|
||||
uint16_t wherex, uint8_t wherey)
|
||||
uint16_t sizex, uint16_t sizey,
|
||||
uint16_t wherex, uint16_t wherey)
|
||||
{
|
||||
for (uint8_t y=0; y<sizey; y++) {
|
||||
for (uint16_t y=0; y<sizey; y++) {
|
||||
for (uint16_t x=0; x<sizex; x++) {
|
||||
const uint8_t *p = &img[(y * sizex + x)*3];
|
||||
p = &img[(y * sizex + x)*3];
|
||||
@ -189,7 +189,7 @@ void SDLDisplay::drawPixel(uint16_t x, uint16_t y, uint8_t r, uint8_t g, uint8_t
|
||||
}
|
||||
}
|
||||
|
||||
void SDLDisplay::drawCharacter(uint8_t mode, uint16_t x, uint8_t y, char c)
|
||||
void SDLDisplay::drawCharacter(uint8_t mode, uint16_t x, uint16_t y, char c)
|
||||
{
|
||||
int8_t xsize = 8,
|
||||
ysize = 0x07;
|
||||
@ -234,7 +234,7 @@ void SDLDisplay::drawCharacter(uint8_t mode, uint16_t x, uint8_t y, char c)
|
||||
}
|
||||
}
|
||||
|
||||
void SDLDisplay::drawString(uint8_t mode, uint16_t x, uint8_t y, const char *str)
|
||||
void SDLDisplay::drawString(uint8_t mode, uint16_t x, uint16_t y, const char *str)
|
||||
{
|
||||
int8_t xsize = 8; // width of a char in this font
|
||||
|
||||
|
@ -25,15 +25,15 @@ class SDLDisplay : public PhysicalDisplay {
|
||||
|
||||
virtual void flush();
|
||||
|
||||
virtual void drawImageOfSizeAt(const uint8_t *img, uint16_t sizex, uint8_t sizey, uint16_t wherex, uint8_t wherey);
|
||||
virtual void drawImageOfSizeAt(const uint8_t *img, uint16_t sizex, uint16_t sizey, uint16_t wherex, uint16_t wherey);
|
||||
|
||||
virtual void drawPixel(uint16_t x, uint16_t y, uint16_t color);
|
||||
virtual void drawPixel(uint16_t x, uint16_t y, uint8_t r, uint8_t g, uint8_t b);
|
||||
|
||||
virtual void drawUIPixel(uint16_t x, uint16_t y, uint16_t color);
|
||||
|
||||
virtual void drawCharacter(uint8_t mode, uint16_t x, uint8_t y, char c);
|
||||
virtual void drawString(uint8_t mode, uint16_t x, uint8_t y, const char *str);
|
||||
virtual void drawCharacter(uint8_t mode, uint16_t x, uint16_t y, char c);
|
||||
virtual void drawString(uint8_t mode, uint16_t x, uint16_t y, const char *str);
|
||||
virtual void clrScr(uint8_t coloridx);
|
||||
|
||||
virtual void cachePixel(uint16_t x, uint16_t y, uint8_t color);
|
||||
|
@ -169,7 +169,6 @@ void SDLKeyboard::maintainKeyboard()
|
||||
// didn't belong here, but this REALLY is wrong.
|
||||
case SDL_WINDOWEVENT:
|
||||
if (event.window.event == SDL_WINDOWEVENT_RESIZED) {
|
||||
printf("Window was resized\n");
|
||||
((SDLDisplay *)g_display)->windowResized(event.window.data1, event.window.data2);
|
||||
}
|
||||
break;
|
||||
|
@ -100,13 +100,13 @@ void TeensyDisplay::redraw()
|
||||
}
|
||||
|
||||
void TeensyDisplay::drawImageOfSizeAt(const uint8_t *img,
|
||||
uint16_t sizex, uint8_t sizey,
|
||||
uint16_t wherex, uint8_t wherey)
|
||||
uint16_t sizex, uint16_t sizey,
|
||||
uint16_t wherex, uint16_t wherey)
|
||||
{
|
||||
uint8_t r, g, b;
|
||||
|
||||
// FIXME this needs to scale with TEENSYDISPLAY_SCALE
|
||||
for (uint8_t y=0; y<sizey; y++) {
|
||||
for (uint16_t y=0; y<sizey; y++) {
|
||||
for (uint16_t x=0; x<sizex; x++) {
|
||||
r = pgm_read_byte(&img[(y*sizex + x)*3 + 0]);
|
||||
g = pgm_read_byte(&img[(y*sizex + x)*3 + 1]);
|
||||
@ -157,7 +157,7 @@ void TeensyDisplay::drawPixel(uint16_t x, uint16_t y, uint8_t r, uint8_t g, uint
|
||||
drawPixel(x,y,color16);
|
||||
}
|
||||
|
||||
void TeensyDisplay::drawCharacter(uint8_t mode, uint16_t x, uint8_t y, char c)
|
||||
void TeensyDisplay::drawCharacter(uint8_t mode, uint16_t x, uint16_t y, char c)
|
||||
{
|
||||
int8_t xsize = 8,
|
||||
ysize = 0x07;
|
||||
@ -201,7 +201,7 @@ void TeensyDisplay::drawCharacter(uint8_t mode, uint16_t x, uint8_t y, char c)
|
||||
}
|
||||
}
|
||||
|
||||
void TeensyDisplay::drawString(uint8_t mode, uint16_t x, uint8_t y, const char *str)
|
||||
void TeensyDisplay::drawString(uint8_t mode, uint16_t x, uint16_t y, const char *str)
|
||||
{
|
||||
int8_t xsize = 8; // width of a char in this font
|
||||
|
||||
@ -224,7 +224,7 @@ void TeensyDisplay::clrScr(uint8_t coloridx)
|
||||
color16 = loresPixelColors[coloridx];
|
||||
// This could be faster - make one line, then memcpy the line to the other
|
||||
// lines?
|
||||
for (uint8_t y=0; y<TEENSYDISPLAY_HEIGHT; y++) {
|
||||
for (uint16_t y=0; y<TEENSYDISPLAY_HEIGHT; y++) {
|
||||
for (uint16_t x=0; x<TEENSYDISPLAY_WIDTH; x++) {
|
||||
dmaBuffer[y][x] = color16;
|
||||
}
|
||||
|
@ -26,10 +26,10 @@ class TeensyDisplay : public PhysicalDisplay {
|
||||
virtual void clrScr(uint8_t coloridx);
|
||||
virtual void flush();
|
||||
|
||||
virtual void drawCharacter(uint8_t mode, uint16_t x, uint8_t y, char c);
|
||||
virtual void drawString(uint8_t mode, uint16_t x, uint8_t y, const char *str);
|
||||
virtual void drawCharacter(uint8_t mode, uint16_t x, uint16_t y, char c);
|
||||
virtual void drawString(uint8_t mode, uint16_t x, uint16_t y, const char *str);
|
||||
|
||||
virtual void drawImageOfSizeAt(const uint8_t *img, uint16_t sizex, uint8_t sizey, uint16_t wherex, uint8_t wherey);
|
||||
virtual void drawImageOfSizeAt(const uint8_t *img, uint16_t sizex, uint16_t sizey, uint16_t wherex, uint16_t wherey);
|
||||
|
||||
void cacheDoubleWidePixel(uint16_t x, uint16_t y, uint16_t color16);
|
||||
virtual void cacheDoubleWidePixel(uint16_t x, uint16_t y, uint8_t color);
|
||||
|
Loading…
x
Reference in New Issue
Block a user