CHEWY: Implementing character draw routines

This commit is contained in:
Paul Gilbert
2022-03-03 18:35:02 -08:00
parent ffd5d06a2f
commit 1a93c1286d
4 changed files with 34 additions and 15 deletions
+33 -7
View File
@@ -326,20 +326,46 @@ void vors() {
fontY = fvory;
}
void zoom_img(byte *source, byte *dest, int16 xdiff_, int16 ydiff_) {
warning("STUB - zoom_img");
}
void zoom_set(byte *source, int16 x, int16 y, int16 xdiff_, int16 ydiff_, int16 scrWidth) {
warning("STUB - zoom_set");
}
void putcxy(int16 x, int16 y, char zeichen, int16 forcol, int16 backcol, int16 scrWidth) {
warning("STUB - putcxy");
void putcxy(int16 x, int16 y, char c, int16 fgCol, int16 bgCol, int16 scrWidth) {
size_t charSize = (fontWidth / 8) * fontHeight;
byte *charSrcP = fontAddr + (c - fontFirst) * charSize;
byte *destP;
int width;
if (scrWidth != 0) {
destP = screenP + (y * scrWidth) + x;
} else {
destP = screenP + (y * scrWidth) + x;
scrWidth = SCREEN_WIDTH;
}
for (int y = 0; y < fontHeight; ++y, destP += scrWidth) {
byte *destLineP = destP;
for (int byteCtr = 0, bits = *charSrcP++;
byteCtr < (fontWidth / 8);
bits = *charSrcP++) {
// Iterate through the 8 bits
for (int x = 0; x < 8; ++x, ++destLineP, bits <<= 1) {
if (bits & 0x80)
*destLineP = fgCol;
else
*destLineP = bgCol;
}
}
}
if (screenP == (byte *)g_screen->getPixels())
g_screen->addDirtyRect(Common::Rect(
x, y, x + fontWidth, y + fontHeight));
}
void putz(char c, int16 fgCol, int16 bgCol, int16 scrWidth) {
warning("STUB - putz");
putcxy(gcurx, gcury, c, fgCol, bgCol, scrWidth);
}
void init_svga(VesaInfo *vi_, byte *virt_screen) {
+1 -2
View File
@@ -72,8 +72,7 @@ void zoom_img(byte *source, byte *dest, int16 xdiff, int16 ydiff);
void zoom_set(byte *source, int16 x, int16 y, int16 xdiff,
int16 ydiff, int16 scrWidth);
void putcxy(int16 x, int16 y, char zeichen, int16 forcol,
int16 backcol, int16 scrWidth);
void putcxy(int16 x, int16 y, char c, int16 fgCol, int16 bgCol, int16 scrWidth);
void putz(char c, int16 fgCol, int16 bgCol, int16 scrWidth);
void setfont(byte *addr, int16 width, int16 height, int16 first,
int16 last);
-4
View File
@@ -1516,10 +1516,6 @@ int16 mcga_grafik::check_stellen_anz(char *zstring, int16 *pos, int16 stellen) {
return (diff);
}
void mcga_grafik::scale_image(byte *source, byte *dest, int16 xdiff_, int16 ydiff_) {
zoom_img(source, dest, xdiff_, ydiff_);
}
void mcga_grafik::scale_set(byte *sptr, int16 x, int16 y, int16 xdiff_, int16 ydiff_, int16 scrwidth) {
if ((xdiff_) || (ydiff_))
zoom_set(sptr, x, y, xdiff_, ydiff_, scrwidth);
-2
View File
@@ -124,8 +124,6 @@ public:
int16 hoehe, int16 scrwidth);
void blockcopy(byte *sptr, int16 x, int16 y, int16 scrwidth);
void sprite_set(byte *sptr, int16 x, int16 y, int16 scrwidth);
void scale_image(byte *source, byte *dest, int16 xdiff,
int16 ydiff);
void scale_set(byte *sptr, int16 x, int16 y, int16 xdiff,
int16 ydiff, int16 scrwidth);
void map_spr2screen(byte *sptr, int16 x, int16 y);