CHEWY: Remove more unused functions

This commit is contained in:
Filippos Karapetis 2022-02-23 02:43:29 +02:00 committed by Paul Gilbert
parent 1bc86dc799
commit 2cb5267002
4 changed files with 7 additions and 129 deletions

View File

@ -89,10 +89,6 @@ void clear_mcga() {
Common::fill(SCREEN, SCREEN + SCREEN_WIDTH * SCREEN_HEIGHT, 0);
}
void setpixel_mcga(int16 x, int16 y, int16 farbe) {
line_mcga(x, y, x, y, farbe);
}
uint8 getpix(int16 x, int16 y) {
return *(byte *)SCREEN_S.getBasePtr(x, y);
}

View File

@ -39,7 +39,6 @@ void rastercol(int16 color, int16 r, int16 g, int16 b);
void set_palpart(const byte *palette, int16 startcol, int16 anz);
void clear_mcga();
void setpixel_mcga(int16 x, int16 y, int16 farbe);
uint8 getpix(int16 x, int16 y);
void line_mcga(int16 x1, int16 y1, int16 x2, int16 y2, int16 farbe);

View File

@ -72,29 +72,9 @@ byte *McgaGraphics::get_zeiger() {
return get_dispoff();
}
void McgaGraphics::set_mono() {
_mono = true;
}
void McgaGraphics::calc_mono(byte *palette, int16 startcol, int16 anz) {
int16 k = startcol * 3;
for (int16 i = 0; i < anz; i++) {
uint8 r = palette[k];
uint8 g = palette[k + 1];
uint8 b = palette[k + 2];
uint8 grau = (((float)r) * 0.30) + (((float)g) * 0.59) + (((float)b) * 0.11);
palette[k] = grau;
palette[k + 1] = grau;
palette[k + 2] = grau;
k += 3;
}
}
void McgaGraphics::set_palette(byte *palette) {
for (int16 i = 0; i < 768; i++)
_palTable[i] = palette[i];
if (_mono)
calc_mono(palette, 0, 256);
setpalette(palette);
}
@ -111,14 +91,10 @@ void McgaGraphics::raster_col(int16 c, int16 r, int16 g, int16 b) {
_palTable[index] = r;
_palTable[index + 1] = g;
_palTable[index + 2] = b;
if (_mono)
calc_mono(_palTable, c, 1);
rastercol(c, r, g, b);
}
void McgaGraphics::einblenden(byte *palette, int16 frames) {
if (_mono)
calc_mono(palette, 0, 256);
for (int16 j = 63; j >= 0; j--) {
int16 k = 0;
for (int16 i = 0; i < 256; i++) {
@ -140,28 +116,6 @@ void McgaGraphics::einblenden(byte *palette, int16 frames) {
}
}
void McgaGraphics::aufhellen(byte *palette, int16 startcol, int16 anz, int16 stufen, int16 frames) {
if (_mono)
calc_mono(palette, startcol, anz);
for (int16 j = stufen; j >= 0; j--) {
int16 endcol = startcol + anz;
int16 k = startcol * 3;
for (int16 i = startcol; i < endcol; i++) {
int16 r = _palTable[k];
int16 g = _palTable[k + 1];
int16 b = _palTable[k + 2];
if ((r + 1) <= palette[k]) ++r;
if ((g + 1) <= palette[k + 1]) ++g;
if ((b + 1) <= palette[k + 2]) ++b;
_palTable[k] = r;
_palTable[k + 1] = g;
_palTable[k + 2] = b;
k += 3;
}
set_palpart(_palTable, startcol, anz);
}
}
void McgaGraphics::ausblenden(int16 frames) {
for (int16 j = 0; j < 64; j++) {
int16 k = 0;
@ -181,26 +135,6 @@ void McgaGraphics::ausblenden(int16 frames) {
}
}
void McgaGraphics::abblenden(int16 startcol, int16 anz, int16 stufen, int16 frames) {
int16 endcol = startcol + anz;
for (int16 j = 0; j < stufen; j++) {
int16 k = startcol * 3;
for (int16 i = startcol; i < endcol; i++) {
int16 r = _palTable[k];
int16 g = _palTable[k + 1];
int16 b = _palTable[k + 2];
if (r > 0) --r;
if (g > 0) --g;
if (b > 0) --b;
_palTable[k] = r;
_palTable[k + 1] = g;
_palTable[k + 2] = b;
k += 3;
}
set_palpart(_palTable, startcol, anz);
}
}
void McgaGraphics::set_teilpalette(const byte *palette, int16 startcol, int16 anz) {
int16 k = startcol * 3;
int16 endcol = startcol + anz;
@ -210,8 +144,6 @@ void McgaGraphics::set_teilpalette(const byte *palette, int16 startcol, int16 an
_palTable[k + 2] = palette[k + 2];
k += 3;
}
if (_mono)
calc_mono(_palTable, startcol, anz);
set_palpart(_palTable, startcol, anz);
}
@ -219,10 +151,6 @@ void McgaGraphics::cls() {
clear_mcga();
}
void McgaGraphics::punkt(int16 xpos, int16 ypos, int16 farbn) {
setpixel_mcga(xpos, ypos, farbn);
}
uint8 McgaGraphics::get_pixel(int16 xpos, int16 ypos) {
uint8 pix = getpix(xpos, ypos);
@ -783,51 +711,22 @@ void McgaGraphics::move(int16 x, int16 y) {
}
void McgaGraphics::init_mausmode(MouseInfo *mInfo) {
_mausMode = true;
_mInfo = mInfo;
}
void McgaGraphics::exit_mausmode() {
_mausMode = false;
_mInfo = nullptr;
}
int16 McgaGraphics::devices() {
int16 i = 0;
if (_mausMode != false) {
// TODO: This is wrong. 'i' should be initialized to "button status" (BX after a call to Int33h/03
if (i > 1) {
i = 27;
} else if (i == 1)
i = 13;
else
i = 0;
}
// TODO: This is wrong. 'i' should be initialized to "button status" (BX after a call to Int33h/03
if (i > 1) {
i = 27;
} else if (i == 1)
i = 13;
else
i = 0;
return i;
}
int16 McgaGraphics::check_stellen_anz(char *zstring, int16 *pos, int16 stellen) {
int16 diff;
int16 k = 0;
while (zstring[k] != 0)
++k;
if (k >= stellen) {
while ((k) && (stellen)) {
--k;
--stellen;
}
diff = 0;
} else {
diff = stellen - k;
k = 0;
}
*pos = k;
return diff;
}
void McgaGraphics::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);
@ -835,11 +734,6 @@ void McgaGraphics::scale_set(byte *sptr, int16 x, int16 y, int16 xdiff_, int16 y
mspr_set_mcga(sptr, x, y, scrwidth);
}
void McgaGraphics::update_screen() {
if (_svga == ON)
upd_scr();
}
void McgaGraphics::ltoa(long N, char *str, int base) {
sprintf(str, "%ld", N);
}

View File

@ -36,27 +36,20 @@ public:
void init();
void set_writemode(char wm);
void init_mausmode(MouseInfo *mInfo);
void exit_mausmode();
void set_clip(int16 x1, int16 y1, int16 x2, int16 y2);
void set_pointer(byte *ptr);
byte *get_zeiger();
void set_mono();
void calc_mono(byte *palette, int16 startcol, int16 anz);
void set_palette(byte *palette);
void palette_save(byte *palette = nullptr);
void rest_palette();
void raster_col(int16 c, int16 r, int16 g, int16 b);
void einblenden(byte *palette, int16 frames);
void aufhellen(byte *palette, int16 startcol, int16 anz, int16 stufen,
int16 frames);
void ausblenden(int16 frames);
void abblenden(int16 startcol, int16 anz, int16 stufen, int16 frames);
void set_teilpalette(const byte *palette, int16 startcol, int16 anz);
void cls();
void punkt(int16 xpos, int16 ypos, int16 farbn);
uint8 get_pixel(int16 xpos, int16 ypos);
void linie(int16 x1, int16 y1, int16 x2, int16 y2, int16 farbe);
void box(int16 x1, int16 y1, int16 x2, int16 y2, int16 farbe);
@ -82,18 +75,14 @@ public:
const char *format);
void vorschub();
void move(int16 x, int16 y);
void update_screen();
private:
int16 check_stellen_anz(char *zstring, int16 *pos, int16 stellen);
int16 devices();
float _sines[360];
float _cosines[360];
byte _palTable[PALETTE_SIZE];
uint8 _writeMode = 0;
bool _mono = false;
bool _mausMode = false;
int16 _crlfx = 0, _crlfy = 0;
int16 _fontBr = 0, _fontH = 0;
uint8 _svga = 0;