CHEWY: Fix drawing boxes and lines

This commit is contained in:
Paul Gilbert 2021-11-12 22:10:57 -08:00
parent 5dcf70d571
commit 276e83ffee
2 changed files with 14 additions and 3 deletions

View File

@ -129,13 +129,24 @@ void setpixel_mcga(int16 x, int16 y, int16 farbe) {
line_mcga(x, y, x, y, farbe);
}
static Graphics::Surface getScreen() {
Graphics::Surface s;
s.format = Graphics::PixelFormat::createFormatCLUT8();
s.w = s.pitch = SCREEN_WIDTH;
s.h = SCREEN_HEIGHT;
s.setPixels(screenP);
return s;
}
uint8 getpix(int16 x, int16 y) {
byte *pixel = (byte *)g_screen->getBasePtr(x, y);
Graphics::Surface s = getScreen();
byte *pixel = (byte *)s.getBasePtr(x, y);
return *pixel;
}
void line_mcga(int16 x1, int16 y1, int16 x2, int16 y2, int16 farbe) {
g_screen->drawLine(x1, y1, x2, y2, farbe);
Graphics::Surface s = getScreen();
s.drawLine(x1, y1, x2, y2, farbe);
}
void mem2mcga(const byte *ptr) {

View File

@ -547,7 +547,7 @@ public:
*/
void drawLine(int x0, int y0, int x1, int y1, uint32 color) {
_innerSurface.drawLine(x0, y0, x1, y1, color);
addDirtyRect(Common::Rect(MIN(x0, x1), MIN(y0, y1), MAX(x0, x1), MAX(y0, y1)));
addDirtyRect(Common::Rect(MIN(x0, x1), MIN(y0, y1), MAX(x0, x1 + 1), MAX(y0, y1 + 1)));
}
/**