Fix NewGui for higher resolutions (eg, CMI)
svn-id: r6216
This commit is contained in:
parent
ae5b30df3d
commit
92c8e4ef1e
6 changed files with 19 additions and 8 deletions
|
@ -1008,6 +1008,14 @@ void OSystem_SDL_Common::clear_overlay()
|
||||||
_forceFull = true;
|
_forceFull = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int16 OSystem_SDL_Common::get_height() {
|
||||||
|
return _screenHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
int16 OSystem_SDL_Common::get_width() {
|
||||||
|
return _screenWidth;
|
||||||
|
}
|
||||||
|
|
||||||
void OSystem_SDL_Common::grab_overlay(int16 *buf, int pitch)
|
void OSystem_SDL_Common::grab_overlay(int16 *buf, int pitch)
|
||||||
{
|
{
|
||||||
if (!_overlayVisible)
|
if (!_overlayVisible)
|
||||||
|
|
|
@ -109,6 +109,8 @@ public:
|
||||||
virtual void clear_overlay();
|
virtual void clear_overlay();
|
||||||
virtual void grab_overlay(int16 *buf, int pitch);
|
virtual void grab_overlay(int16 *buf, int pitch);
|
||||||
virtual void copy_rect_overlay(const int16 *buf, int pitch, int x, int y, int w, int h);
|
virtual void copy_rect_overlay(const int16 *buf, int pitch, int x, int y, int w, int h);
|
||||||
|
virtual int16 OSystem_SDL_Common::get_height();
|
||||||
|
virtual int16 OSystem_SDL_Common::get_width();
|
||||||
|
|
||||||
// Methods that convert RBG to/from colors suitable for the overlay.
|
// Methods that convert RBG to/from colors suitable for the overlay.
|
||||||
virtual int16 RBGToColor(uint8 r, uint8 g, uint8 b);
|
virtual int16 RBGToColor(uint8 r, uint8 g, uint8 b);
|
||||||
|
|
|
@ -47,8 +47,8 @@ This code is not finished, so please don't complain :-)
|
||||||
* - add a scrollbar widget to allow scrolling in the history
|
* - add a scrollbar widget to allow scrolling in the history
|
||||||
* - a *lot* of others things, this code is in no way complete and heavily under progress
|
* - a *lot* of others things, this code is in no way complete and heavily under progress
|
||||||
*/
|
*/
|
||||||
ConsoleDialog::ConsoleDialog(NewGui *gui)
|
ConsoleDialog::ConsoleDialog(NewGui *gui, int _realWidth)
|
||||||
: Dialog(gui, 0, 0, 320, 12*kLineHeight+2)
|
: Dialog(gui, 0, 0, _realWidth, 12*kLineHeight+2)
|
||||||
{
|
{
|
||||||
_lineWidth = (_w - kScrollBarWidth - 2) / kCharWidth;
|
_lineWidth = (_w - kScrollBarWidth - 2) / kCharWidth;
|
||||||
_linesPerPage = (_h - 2) / kLineHeight;
|
_linesPerPage = (_h - 2) / kLineHeight;
|
||||||
|
|
|
@ -69,7 +69,7 @@ protected:
|
||||||
int _historyLine;
|
int _historyLine;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ConsoleDialog(NewGui *gui);
|
ConsoleDialog(NewGui *gui, int _realWidth);
|
||||||
|
|
||||||
void open();
|
void open();
|
||||||
void drawDialog();
|
void drawDialog();
|
||||||
|
|
|
@ -213,15 +213,16 @@ void NewGui::runLoop()
|
||||||
|
|
||||||
void NewGui::saveState()
|
void NewGui::saveState()
|
||||||
{
|
{
|
||||||
|
int sys_height = _system->get_height();
|
||||||
|
int sys_width = _system->get_width();
|
||||||
|
|
||||||
// Backup old cursor
|
// Backup old cursor
|
||||||
_oldCursorMode = _system->show_mouse(true);
|
_oldCursorMode = _system->show_mouse(true);
|
||||||
|
|
||||||
_system->show_overlay();
|
_system->show_overlay();
|
||||||
// TODO - add getHeight & getWidth methods to OSystem.
|
// TODO - add getHeight & getWidth methods to OSystem.
|
||||||
_screen = new int16[320 * 240];
|
_screen = new int16[sys_width * sys_height];
|
||||||
_screenPitch = 320;
|
_screenPitch = sys_width;
|
||||||
// _screen = new int16[_system->get_width() * _system->get_height()];
|
|
||||||
// _screenPitch = _system->get_width();
|
|
||||||
_system->grab_overlay(_screen, _screenPitch);
|
_system->grab_overlay(_screen, _screenPitch);
|
||||||
|
|
||||||
_currentKeyDown.keycode = 0;
|
_currentKeyDown.keycode = 0;
|
||||||
|
|
|
@ -128,7 +128,7 @@ void ScummDebugger::enter()
|
||||||
{
|
{
|
||||||
#ifdef USE_CONSOLE
|
#ifdef USE_CONSOLE
|
||||||
if (!_s->_debuggerDialog) {
|
if (!_s->_debuggerDialog) {
|
||||||
_s->_debuggerDialog = new ConsoleDialog(_s->_newgui);
|
_s->_debuggerDialog = new ConsoleDialog(_s->_newgui, _s->_realWidth);
|
||||||
Debug_Printf("Debugger started, type 'exit' to return to the game\n");
|
Debug_Printf("Debugger started, type 'exit' to return to the game\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue