diff options
Diffstat (limited to 'engines/lab/graphics.cpp')
-rw-r--r-- | engines/lab/graphics.cpp | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/engines/lab/graphics.cpp b/engines/lab/graphics.cpp index 2f2109af7b..9de6400aa6 100644 --- a/engines/lab/graphics.cpp +++ b/engines/lab/graphics.cpp @@ -45,6 +45,76 @@ BitMap bit1, bit2, *DispBitMap = &bit1, *DrawBitMap = &bit1; extern bool stopsound; extern TextFont *MsgFont; + +/*****************************************************************************/ +/* Scales the x co-ordinates to that of the new display. In the room parser */ +/* file, co-ordinates are set up on a 360x336 display. */ +/*****************************************************************************/ +uint16 scaleX(uint16 x) { + if (g_lab->_isHiRes) + return (uint16)((x * 16) / 9); + else + return (uint16)((x * 8) / 9); +} + +/*****************************************************************************/ +/* Scales the y co-ordinates to that of the new display. In the room parser */ +/* file, co-ordinates are set up on a 368x336 display. */ +/*****************************************************************************/ +uint16 scaleY(uint16 y) { + if (g_lab->_isHiRes) + return (y + (y / 14)); + else + return ((y * 10) / 24); +} + +/*****************************************************************************/ +/* Scales the VGA cords to SVGA if necessary; otherwise, returns VGA cords. */ +/*****************************************************************************/ +int16 VGAScaleX(int16 x) { + if (g_lab->_isHiRes) + return (x * 2); + else + return x; +} + +/*****************************************************************************/ +/* Scales the VGA cords to SVGA if necessary; otherwise, returns VGA cords. */ +/*****************************************************************************/ +int16 VGAScaleY(int16 y) { + if (g_lab->_isHiRes) + return ((y * 12) / 5); + else + return y; +} + +uint16 SVGACord(uint16 cord) { + if (g_lab->_isHiRes) + return cord; + else + return 0; +} + +/*****************************************************************************/ +/* Converts SVGA cords to VGA if necessary, otherwise returns VGA cords. */ +/*****************************************************************************/ +int VGAUnScaleX(int x) { + if (g_lab->_isHiRes) + return (x / 2); + else + return x; +} + +/*****************************************************************************/ +/* Converts SVGA cords to VGA if necessary, otherwise returns VGA cords. */ +/*****************************************************************************/ +int VGAUnScaleY(int y) { + if (g_lab->_isHiRes) + return ((y * 5) / 12); + else + return y; +} + /*---------------------------------------------------------------------------*/ /*------ From readPict.c. Reads in pictures and animations from disk. ------*/ /*---------------------------------------------------------------------------*/ |