SCI: debug command undither implemented
svn-id: r44761
This commit is contained in:
parent
1562add631
commit
a61076a645
8 changed files with 41 additions and 7 deletions
|
@ -108,6 +108,7 @@ Console::Console(SciEngine *vm) : GUI::Debugger() {
|
||||||
DCmd_Register("draw_rect", WRAP_METHOD(Console, cmdDrawRect));
|
DCmd_Register("draw_rect", WRAP_METHOD(Console, cmdDrawRect));
|
||||||
DCmd_Register("draw_cel", WRAP_METHOD(Console, cmdDrawCel));
|
DCmd_Register("draw_cel", WRAP_METHOD(Console, cmdDrawCel));
|
||||||
DCmd_Register("view_info", WRAP_METHOD(Console, cmdViewInfo));
|
DCmd_Register("view_info", WRAP_METHOD(Console, cmdViewInfo));
|
||||||
|
DCmd_Register("undither", WRAP_METHOD(Console, cmdUndither));
|
||||||
// GUI
|
// GUI
|
||||||
DCmd_Register("current_port", WRAP_METHOD(Console, cmdCurrentPort));
|
DCmd_Register("current_port", WRAP_METHOD(Console, cmdCurrentPort));
|
||||||
DCmd_Register("print_port", WRAP_METHOD(Console, cmdPrintPort));
|
DCmd_Register("print_port", WRAP_METHOD(Console, cmdPrintPort));
|
||||||
|
@ -280,6 +281,7 @@ bool Console::cmdHelp(int argc, const char **argv) {
|
||||||
DebugPrintf(" draw_rect - Draws a rectangle to the screen with one of the EGA colors\n");
|
DebugPrintf(" draw_rect - Draws a rectangle to the screen with one of the EGA colors\n");
|
||||||
DebugPrintf(" draw_cel - Draws a single view cel to the center of the screen\n");
|
DebugPrintf(" draw_cel - Draws a single view cel to the center of the screen\n");
|
||||||
DebugPrintf(" view_info - Displays information for the specified view\n");
|
DebugPrintf(" view_info - Displays information for the specified view\n");
|
||||||
|
DebugPrintf(" undither - Enable/disable undithering\n");
|
||||||
DebugPrintf("\n");
|
DebugPrintf("\n");
|
||||||
DebugPrintf("GUI:\n");
|
DebugPrintf("GUI:\n");
|
||||||
DebugPrintf(" current_port - Shows the ID of the currently active port\n");
|
DebugPrintf(" current_port - Shows the ID of the currently active port\n");
|
||||||
|
@ -1059,6 +1061,18 @@ bool Console::cmdViewInfo(int argc, const char **argv) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Console::cmdUndither(int argc, const char **argv) {
|
||||||
|
if (argc != 2) {
|
||||||
|
DebugPrintf("Enable/disable undithering.\n");
|
||||||
|
DebugPrintf("Usage: %s <0/1>\n", argv[0]);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool flag = atoi(argv[1]) ? true : false;
|
||||||
|
|
||||||
|
return _vm->_gamestate->_gui->debugUndither(flag);
|
||||||
|
}
|
||||||
|
|
||||||
bool Console::cmdUpdateZone(int argc, const char **argv) {
|
bool Console::cmdUpdateZone(int argc, const char **argv) {
|
||||||
if (argc != 4) {
|
if (argc != 4) {
|
||||||
DebugPrintf("Propagates a rectangular area from the back buffer to the front buffer\n");
|
DebugPrintf("Propagates a rectangular area from the back buffer to the front buffer\n");
|
||||||
|
|
|
@ -93,6 +93,7 @@ private:
|
||||||
bool cmdDrawRect(int argc, const char **argv);
|
bool cmdDrawRect(int argc, const char **argv);
|
||||||
bool cmdDrawCel(int argc, const char **argv);
|
bool cmdDrawCel(int argc, const char **argv);
|
||||||
bool cmdViewInfo(int argc, const char **argv);
|
bool cmdViewInfo(int argc, const char **argv);
|
||||||
|
bool cmdUndither(int argc, const char **argv);
|
||||||
// GUI
|
// GUI
|
||||||
bool cmdCurrentPort(int argc, const char **argv);
|
bool cmdCurrentPort(int argc, const char **argv);
|
||||||
bool cmdPrintPort(int argc, const char **argv);
|
bool cmdPrintPort(int argc, const char **argv);
|
||||||
|
|
|
@ -496,6 +496,11 @@ void SciGui::moveCursor(Common::Point pos) {
|
||||||
// FIXME!
|
// FIXME!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SciGui::debugUndither(bool flag) {
|
||||||
|
_screen->unditherSetState(flag);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool SciGui::debugShowMap(int mapNo) {
|
bool SciGui::debugShowMap(int mapNo) {
|
||||||
_screen->debugShowMap(mapNo);
|
_screen->debugShowMap(mapNo);
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -90,6 +90,7 @@ public:
|
||||||
virtual void setCursorPos(Common::Point pos);
|
virtual void setCursorPos(Common::Point pos);
|
||||||
virtual void moveCursor(Common::Point pos);
|
virtual void moveCursor(Common::Point pos);
|
||||||
|
|
||||||
|
virtual bool debugUndither(bool flag);
|
||||||
virtual bool debugShowMap(int mapNo);
|
virtual bool debugShowMap(int mapNo);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -60,6 +60,7 @@ SciGuiScreen::SciGuiScreen(int16 width, int16 height, int16 scaleFactor) :
|
||||||
}
|
}
|
||||||
|
|
||||||
_picNotValid = false;
|
_picNotValid = false;
|
||||||
|
_unditherState = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SciGuiScreen::~SciGuiScreen() {
|
SciGuiScreen::~SciGuiScreen() {
|
||||||
|
@ -223,7 +224,7 @@ void SciGuiScreen::setPalette(GuiPalette*pal) {
|
||||||
// Currently not really done, its supposed to be possible to only dither _visualScreen
|
// Currently not really done, its supposed to be possible to only dither _visualScreen
|
||||||
void SciGuiScreen::dither() {
|
void SciGuiScreen::dither() {
|
||||||
int y, x;
|
int y, x;
|
||||||
byte color;
|
byte color, ditheredColor;
|
||||||
byte *screenPtr = _visualScreen;
|
byte *screenPtr = _visualScreen;
|
||||||
byte *displayPtr = _displayScreen;
|
byte *displayPtr = _displayScreen;
|
||||||
|
|
||||||
|
@ -232,18 +233,22 @@ void SciGuiScreen::dither() {
|
||||||
color = *screenPtr;
|
color = *screenPtr;
|
||||||
if (color & 0xF0) {
|
if (color & 0xF0) {
|
||||||
color ^= color << 4;
|
color ^= color << 4;
|
||||||
// remove remark to enable undithering
|
ditheredColor = ((x^y) & 1) ? color >> 4 : color & 0x0F;
|
||||||
// *displayPtr = color;
|
*screenPtr = ditheredColor;
|
||||||
// do the actual dithering
|
if (_unditherState)
|
||||||
color = ((x^y) & 1) ? color >> 4 : color & 0x0F;
|
*displayPtr = color;
|
||||||
*screenPtr = color;
|
else
|
||||||
*displayPtr = color; // put remark here to enable unditherung
|
*displayPtr = ditheredColor;
|
||||||
}
|
}
|
||||||
screenPtr++; displayPtr++;
|
screenPtr++; displayPtr++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SciGuiScreen::unditherSetState(bool flag) {
|
||||||
|
_unditherState = flag;
|
||||||
|
}
|
||||||
|
|
||||||
void SciGuiScreen::debugShowMap(int mapNo) {
|
void SciGuiScreen::debugShowMap(int mapNo) {
|
||||||
switch (mapNo) {
|
switch (mapNo) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|
|
@ -62,6 +62,7 @@ public:
|
||||||
void setPalette(GuiPalette*pal);
|
void setPalette(GuiPalette*pal);
|
||||||
|
|
||||||
void dither();
|
void dither();
|
||||||
|
void unditherSetState(bool flag);
|
||||||
|
|
||||||
void debugShowMap(int mapNo);
|
void debugShowMap(int mapNo);
|
||||||
|
|
||||||
|
@ -74,6 +75,8 @@ public:
|
||||||
|
|
||||||
int _picNotValid; // possible values 0, 1 and 2
|
int _picNotValid; // possible values 0, 1 and 2
|
||||||
|
|
||||||
|
bool _unditherState;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void restoreBitsScreen(Common::Rect rect, byte *&memoryPtr, byte *screen);
|
void restoreBitsScreen(Common::Rect rect, byte *&memoryPtr, byte *screen);
|
||||||
void saveBitsScreen(Common::Rect rect, byte *screen, byte *&memoryPtr);
|
void saveBitsScreen(Common::Rect rect, byte *screen, byte *&memoryPtr);
|
||||||
|
|
|
@ -2047,6 +2047,10 @@ void SciGui32::moveCursor(Common::Point pos) {
|
||||||
gfxop_get_event(s->gfx_state, SCI_EVT_PEEK);
|
gfxop_get_event(s->gfx_state, SCI_EVT_PEEK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SciGui32::debugUndither(bool flag) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool SciGui32::debugShowMap(int mapNo) {
|
bool SciGui32::debugShowMap(int mapNo) {
|
||||||
gfxop_set_clip_zone(s->gfx_state, gfx_rect_fullscreen);
|
gfxop_set_clip_zone(s->gfx_state, gfx_rect_fullscreen);
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,7 @@ public:
|
||||||
void setCursorPos(Common::Point pos);
|
void setCursorPos(Common::Point pos);
|
||||||
void moveCursor(Common::Point pos);
|
void moveCursor(Common::Point pos);
|
||||||
|
|
||||||
|
bool debugUndither(bool flag);
|
||||||
bool debugShowMap(int mapNo);
|
bool debugShowMap(int mapNo);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue