CHEWY: Remove some unused members in mcga_graphics, some renaming in detail.h and globals

This commit is contained in:
Strangerke
2022-03-06 19:50:04 +01:00
parent 5795fb6aea
commit a7501bf73d
7 changed files with 8 additions and 44 deletions
+3 -3
View File
@@ -192,13 +192,13 @@ public:
void load_rdi_taf(const char *fname, int16 load_flag);
void setStaticSpr(int16 nr, int16 sprNr);
void setStaticSpr(int16 detNr, int16 sprNr);
byte *getStaticImage(int16 detNr);
void setStaticPos(int16 detNr, int16 x, int16 y, bool hideFl, bool correctionFlag);
void setSetailPos(int16 detNr, int16 x, int16 y);
void hideStaticSpr(int16 nr);
void showStaticSpr(int16 nr);
void hideStaticSpr(int16 detNr);
void showStaticSpr(int16 detNr);
void freezeAni();
void unfreeze_ani();
void getAniValues(int16 aniNr, int16 *start, int16 *end);
+1 -2
View File
@@ -96,7 +96,6 @@ public:
int16 _zoom_mov_fak = 0;
int16 _auto_obj = 0;
int16 _ged_mov_ebene = 0;
bool _cur_display = false;
int16 _mouseLeftClick = 0;
@@ -273,7 +272,7 @@ public:
// mcga.cpp
byte _saved_palette[PALETTE_SIZE] = { 0 };
bool _screenHasDefault = false;
byte *_screenDefaultP = nullptr;
byte *_screenDefaultPtr = nullptr;
int _spriteWidth = 0;
// mcga_graphics.cpp
-2
View File
@@ -49,7 +49,6 @@ void standard_init() {
_G(out)->cls();
_G(out)->savePalette();
_G(out)->setClip(0, 0, 320, 200);
_G(out)->setWriteMode(0);
_G(scr_width) = 0;
_G(screen0) = (byte *)g_screen->getPixels();
_G(in)->neuer_kb_handler(&_G(kbinfo));
@@ -104,7 +103,6 @@ void var_init() {
_G(auto_p_nr) = 0;
_G(menu_item) = CUR_WALK;
_G(inventoryNr) = 0;
_G(ged_mov_ebene) = 1;
new_game();
_G(spieler).MainMenuY = MENU_Y;
_G(spieler).DispFlag = true;
+2 -2
View File
@@ -554,7 +554,7 @@ void setupScreen(SetupScreenMode mode) {
_G(gpkt).Hoehe = _G(room)->_gedYAnz[_G(room_blk).AkAblage];
_G(gpkt).Mem = _G(ged_mem)[_G(room_blk).AkAblage];
_G(gpkt).Ebenen = _G(room)->_gedInfo[_G(room_blk).AkAblage].Ebenen;
_G(gpkt).AkMovEbene = _G(ged_mov_ebene);
_G(gpkt).AkMovEbene = 1;
_G(mov)->goto_xy(&_G(gpkt));
_G(spieler_mi)[P_CHEWY].XyzStart[0] = _G(spieler_vector)[P_CHEWY].Xypos[0];
_G(spieler_mi)[P_CHEWY].XyzStart[1] = _G(spieler_vector)[P_CHEWY].Xypos[1];
@@ -1199,7 +1199,7 @@ bool autoMove(int16 movNr, int16 playerNum) {
_G(gpkt).Hoehe = _G(room)->_gedYAnz[_G(room_blk).AkAblage];
_G(gpkt).Mem = _G(ged_mem)[_G(room_blk).AkAblage];
_G(gpkt).Ebenen = _G(room)->_gedInfo[_G(room_blk).AkAblage].Ebenen;
_G(gpkt).AkMovEbene = _G(ged_mov_ebene);
_G(gpkt).AkMovEbene = 1;
_G(mov)->goto_xy(&_G(gpkt));
_G(spieler_mi)[playerNum].XyzStart[0] = _G(spieler_vector)[playerNum].Xypos[0];
+1 -1
View File
@@ -36,7 +36,7 @@ namespace Chewy {
void init_mcga() {
_G(currentScreen) = (byte *)g_screen->getPixels();
_G(screenHasDefault) = false;
_G(screenDefaultP) = nullptr;
_G(screenDefaultPtr) = nullptr;
_G(spriteWidth) = 0;
}
+1 -23
View File
@@ -29,13 +29,7 @@
namespace Chewy {
#define MAXSTRING 255
McgaGraphics::McgaGraphics() {
for (int i = 0; i < 360; i++) {
_sines[i] = sin(i * 3.14159265359 / 180);
_cosines[i] = cos(i * 3.14159265359 / 180);
}
}
McgaGraphics::~McgaGraphics() {
@@ -47,10 +41,6 @@ void McgaGraphics::init() {
init_mcga();
}
void McgaGraphics::setWriteMode(char wm) {
_writeMode = wm;
}
void McgaGraphics::setClip(int16 x1, int16 y1, int16 x2, int16 y2) {
_G(clipx1) = x1;
_G(clipx2) = x2;
@@ -62,16 +52,12 @@ void McgaGraphics::setPointer(byte *ptr) {
if (ptr) {
_G(currentScreen) = ptr;
} else if (_G(screenHasDefault)) {
_G(currentScreen) = _G(screenDefaultP);
_G(currentScreen) = _G(screenDefaultPtr);
} else {
_G(currentScreen) = (byte *)g_screen->getPixels();
}
}
byte *McgaGraphics::getPointer() {
return get_dispoff();
}
void McgaGraphics::setPalette(byte *palette) {
for (int16 i = 0; i < 768; i++)
_palTable[i] = palette[i];
@@ -718,12 +704,4 @@ void McgaGraphics::scale_set(byte *sptr, int16 x, int16 y, int16 xdiff_, int16 y
mspr_set_mcga(sptr, x, y, scrwidth);
}
void McgaGraphics::ltoa(long N, char *str, int base) {
sprintf(str, "%ld", N);
}
void McgaGraphics::ultoa(uint32 N, char *str, int base) {
sprintf(str, "%u", N);
}
} // namespace Chewy
-11
View File
@@ -23,7 +23,6 @@
#define CHEWY_MCGA_GRAPHICS_H
#include "graphics/screen.h"
#include "chewy/ngstypes.h"
namespace Chewy {
@@ -33,11 +32,9 @@ public:
~McgaGraphics();
void init();
void setWriteMode(char wm);
void setClip(int16 x1, int16 y1, int16 x2, int16 y2);
void setPointer(byte *ptr);
byte *getPointer();
void setPalette(byte *palette);
void savePalette(byte *palette = nullptr);
@@ -74,17 +71,9 @@ public:
private:
int16 devices();
float _sines[360];
float _cosines[360];
byte _palTable[PALETTE_SIZE];
uint8 _writeMode = 0;
int16 _crlfx = 0, _crlfy = 0;
int16 _fontBr = 0, _fontH = 0;
uint8 _svga = 0;
uint8 _einfuegen = 0;
void ltoa(long N, char *str, int base);
void ultoa(uint32 N, char *str, int base);
};
} // namespace Chewy