2002-04-21 17:46:42 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
|
|
|
* Copyright (C) 2001 Ludvig Strigeus
|
|
|
|
* Copyright (C) 2001/2002 The ScummVM project
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* $Header$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2002-08-24 10:41:32 +00:00
|
|
|
#include "sdl-common.h"
|
2002-07-16 11:09:28 +00:00
|
|
|
#include "scaler.h"
|
2002-07-17 20:55:36 +00:00
|
|
|
#include "scumm.h" // Only #included for error() and warning()
|
2001-11-05 19:21:49 +00:00
|
|
|
|
2002-04-29 16:01:31 +00:00
|
|
|
|
2002-08-24 10:41:32 +00:00
|
|
|
class OSystem_SDL_Normal : public OSystem_SDL_Common {
|
2002-04-12 21:26:59 +00:00
|
|
|
public:
|
|
|
|
// Set colors of the palette
|
|
|
|
void set_palette(const byte *colors, uint start, uint num);
|
2001-10-09 14:30:12 +00:00
|
|
|
|
2002-04-12 21:26:59 +00:00
|
|
|
// Update the dirty areas of the screen
|
|
|
|
void update_screen();
|
2002-03-09 13:48:02 +00:00
|
|
|
|
2002-04-12 21:26:59 +00:00
|
|
|
// Set a parameter
|
2002-05-04 09:55:10 +00:00
|
|
|
uint32 property(int param, Property *value);
|
2002-04-11 17:19:16 +00:00
|
|
|
|
2002-08-24 10:41:32 +00:00
|
|
|
protected:
|
2002-06-25 12:43:15 +00:00
|
|
|
SDL_Surface *sdl_hwscreen; // hardware screen
|
2002-03-10 07:48:01 +00:00
|
|
|
|
2002-04-12 21:26:59 +00:00
|
|
|
void load_gfx_mode();
|
|
|
|
void unload_gfx_mode();
|
2002-04-13 12:43:02 +00:00
|
|
|
void hotswap_gfx_mode();
|
2002-04-12 21:26:59 +00:00
|
|
|
};
|
2002-03-10 07:48:01 +00:00
|
|
|
|
2002-08-24 10:41:32 +00:00
|
|
|
OSystem_SDL_Common *OSystem_SDL_Common::create() {
|
|
|
|
return new OSystem_SDL_Normal();
|
2002-03-10 07:48:01 +00:00
|
|
|
}
|
|
|
|
|
2002-08-24 10:41:32 +00:00
|
|
|
void OSystem_SDL_Normal::set_palette(const byte *colors, uint start, uint num) {
|
2002-04-12 21:26:59 +00:00
|
|
|
const byte *b = colors;
|
|
|
|
uint i;
|
2002-04-13 13:11:24 +00:00
|
|
|
SDL_Color *base = _cur_pal + start;
|
2002-04-12 21:26:59 +00:00
|
|
|
for(i=0;i!=num;i++) {
|
2002-06-14 04:31:17 +00:00
|
|
|
base[i].r = b[0];
|
|
|
|
base[i].g = b[1];
|
|
|
|
base[i].b = b[2];
|
|
|
|
b += 4;
|
2002-03-10 07:48:01 +00:00
|
|
|
}
|
|
|
|
|
2002-04-15 17:45:52 +00:00
|
|
|
if (start < _palette_changed_first)
|
|
|
|
_palette_changed_first = start;
|
|
|
|
|
|
|
|
if (start + num > _palette_changed_last)
|
|
|
|
_palette_changed_last = start + num;
|
2002-04-12 21:26:59 +00:00
|
|
|
}
|
2002-03-10 07:48:01 +00:00
|
|
|
|
2002-08-24 10:41:32 +00:00
|
|
|
void OSystem_SDL_Normal::load_gfx_mode() {
|
2002-04-12 21:26:59 +00:00
|
|
|
force_full = true;
|
|
|
|
scaling = 1;
|
2002-04-13 12:43:02 +00:00
|
|
|
_mode_flags = 0;
|
|
|
|
|
2002-04-13 04:39:04 +00:00
|
|
|
_sai_func = NULL;
|
2002-05-04 00:11:57 +00:00
|
|
|
sdl_tmpscreen = NULL;
|
2002-06-14 04:31:17 +00:00
|
|
|
|
2002-04-13 12:43:02 +00:00
|
|
|
switch(_mode) {
|
2002-04-12 21:26:59 +00:00
|
|
|
case GFX_2XSAI:
|
2002-05-04 00:11:57 +00:00
|
|
|
scaling = 2;
|
2002-04-12 21:26:59 +00:00
|
|
|
_sai_func = _2xSaI;
|
2002-04-13 04:39:04 +00:00
|
|
|
break;
|
2002-04-12 21:26:59 +00:00
|
|
|
case GFX_SUPER2XSAI:
|
2002-05-04 00:11:57 +00:00
|
|
|
scaling = 2;
|
2002-04-12 21:26:59 +00:00
|
|
|
_sai_func = Super2xSaI;
|
2002-04-13 04:39:04 +00:00
|
|
|
break;
|
2002-04-12 21:26:59 +00:00
|
|
|
case GFX_SUPEREAGLE:
|
2002-05-04 00:11:57 +00:00
|
|
|
scaling = 2;
|
2002-04-12 21:26:59 +00:00
|
|
|
_sai_func = SuperEagle;
|
|
|
|
break;
|
2002-04-24 07:42:29 +00:00
|
|
|
case GFX_ADVMAME2X:
|
2002-05-04 00:11:57 +00:00
|
|
|
scaling = 2;
|
2002-04-24 07:42:29 +00:00
|
|
|
_sai_func = AdvMame2x;
|
|
|
|
break;
|
2001-12-27 17:51:58 +00:00
|
|
|
|
2002-04-12 21:26:59 +00:00
|
|
|
case GFX_DOUBLESIZE:
|
|
|
|
scaling = 2;
|
|
|
|
break;
|
2001-11-06 20:00:47 +00:00
|
|
|
|
2002-04-12 21:26:59 +00:00
|
|
|
case GFX_TRIPLESIZE:
|
2002-04-13 12:43:02 +00:00
|
|
|
if (_full_screen) {
|
|
|
|
warning("full screen in useless in triplesize mode, reverting to normal mode");
|
|
|
|
goto normal_mode;
|
|
|
|
}
|
2002-04-12 21:26:59 +00:00
|
|
|
scaling = 3;
|
2002-04-13 12:43:02 +00:00
|
|
|
break;
|
|
|
|
|
2002-04-12 21:26:59 +00:00
|
|
|
case GFX_NORMAL:
|
2002-04-13 12:43:02 +00:00
|
|
|
normal_mode:;
|
2002-05-04 00:11:57 +00:00
|
|
|
scaling = 1;
|
2002-04-12 21:26:59 +00:00
|
|
|
break;
|
2001-11-06 20:00:47 +00:00
|
|
|
}
|
2002-06-14 04:31:17 +00:00
|
|
|
|
2002-05-07 18:44:34 +00:00
|
|
|
sdl_screen = SDL_CreateRGBSurface(SDL_SWSURFACE, SCREEN_WIDTH, SCREEN_HEIGHT, 8, 0, 0, 0, 0);
|
2002-05-04 00:11:57 +00:00
|
|
|
if (sdl_screen == NULL)
|
2002-05-04 01:16:06 +00:00
|
|
|
error("sdl_screen failed failed");
|
2002-05-04 00:11:57 +00:00
|
|
|
|
2002-04-13 04:39:04 +00:00
|
|
|
if (_sai_func) {
|
2002-05-07 18:44:34 +00:00
|
|
|
uint16 *tmp_screen = (uint16*)calloc((SCREEN_WIDTH+3)*(SCREEN_HEIGHT+3),sizeof(uint16));
|
2002-05-09 18:23:33 +00:00
|
|
|
_mode_flags = DF_WANT_RECT_OPTIM | DF_SEPARATE_TEMPSCREEN | DF_UPDATE_EXPAND_1_PIXEL;
|
2002-04-13 04:39:04 +00:00
|
|
|
|
2002-05-07 18:44:34 +00:00
|
|
|
sdl_hwscreen = SDL_SetVideoMode(SCREEN_WIDTH * scaling, SCREEN_HEIGHT * scaling, 16,
|
2002-04-13 12:43:02 +00:00
|
|
|
_full_screen ? (SDL_FULLSCREEN|SDL_SWSURFACE) : SDL_SWSURFACE
|
|
|
|
);
|
2002-04-13 04:39:04 +00:00
|
|
|
if (sdl_hwscreen == NULL)
|
|
|
|
error("sdl_hwscreen failed");
|
2002-04-27 11:56:47 +00:00
|
|
|
|
2002-04-13 04:39:04 +00:00
|
|
|
/* Need some extra bytes around when using 2XSAI */
|
2002-04-27 12:02:47 +00:00
|
|
|
if (sdl_hwscreen->format->Rmask == 0x7C00) // HACK HACK HACK
|
|
|
|
Init_2xSaI(555);
|
|
|
|
else
|
|
|
|
Init_2xSaI(565);
|
2002-05-04 01:16:06 +00:00
|
|
|
sdl_tmpscreen = SDL_CreateRGBSurfaceFrom(tmp_screen,
|
2002-05-07 18:44:34 +00:00
|
|
|
SCREEN_WIDTH + 3, SCREEN_HEIGHT + 3, 16, (SCREEN_WIDTH + 3)*2,
|
2002-04-27 11:56:47 +00:00
|
|
|
sdl_hwscreen->format->Rmask,
|
|
|
|
sdl_hwscreen->format->Gmask,
|
|
|
|
sdl_hwscreen->format->Bmask,
|
|
|
|
sdl_hwscreen->format->Amask);
|
|
|
|
|
2002-04-13 04:39:04 +00:00
|
|
|
if (sdl_tmpscreen == NULL)
|
|
|
|
error("sdl_tmpscreen failed");
|
2002-05-04 00:11:57 +00:00
|
|
|
|
|
|
|
} else {
|
|
|
|
switch(scaling) {
|
|
|
|
case 3:
|
|
|
|
_sai_func = Normal3x;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
_sai_func = Normal2x;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
_sai_func = Normal1x;
|
|
|
|
break;
|
|
|
|
}
|
2002-04-13 04:39:04 +00:00
|
|
|
|
2002-05-09 18:23:33 +00:00
|
|
|
_mode_flags = DF_WANT_RECT_OPTIM | DF_REAL_8BIT;
|
2002-05-04 00:11:57 +00:00
|
|
|
|
2002-05-07 18:44:34 +00:00
|
|
|
sdl_hwscreen = SDL_SetVideoMode(SCREEN_WIDTH * scaling, SCREEN_HEIGHT * scaling, 8,
|
2002-05-04 00:11:57 +00:00
|
|
|
_full_screen ? (SDL_FULLSCREEN|SDL_SWSURFACE) : SDL_SWSURFACE
|
|
|
|
);
|
|
|
|
if (sdl_hwscreen == NULL)
|
|
|
|
error("sdl_hwscreen failed");
|
2002-06-14 04:31:17 +00:00
|
|
|
|
2002-05-04 00:11:57 +00:00
|
|
|
sdl_tmpscreen = sdl_screen;
|
2002-04-13 04:39:04 +00:00
|
|
|
}
|
2002-06-25 12:43:15 +00:00
|
|
|
|
|
|
|
// keyboard cursor control, some other better place for it?
|
2002-07-16 11:09:28 +00:00
|
|
|
km.x_max = SCREEN_WIDTH * scaling - 1;
|
|
|
|
km.y_max = SCREEN_HEIGHT * scaling - 1;
|
|
|
|
km.delay_time = 25;
|
|
|
|
km.last_time = 0;
|
2002-06-25 12:43:15 +00:00
|
|
|
|
2002-04-12 21:26:59 +00:00
|
|
|
}
|
2001-11-06 20:00:47 +00:00
|
|
|
|
2002-08-24 10:41:32 +00:00
|
|
|
void OSystem_SDL_Normal::unload_gfx_mode() {
|
|
|
|
if (sdl_screen) {
|
|
|
|
SDL_FreeSurface(sdl_screen);
|
|
|
|
sdl_screen = NULL;
|
|
|
|
}
|
2001-11-06 20:00:47 +00:00
|
|
|
|
2002-08-24 10:41:32 +00:00
|
|
|
if (sdl_hwscreen) {
|
|
|
|
SDL_FreeSurface(sdl_hwscreen);
|
|
|
|
sdl_hwscreen = NULL;
|
|
|
|
}
|
|
|
|
|
2002-05-04 00:11:57 +00:00
|
|
|
if (_mode_flags & DF_SEPARATE_TEMPSCREEN) {
|
2002-05-04 01:16:06 +00:00
|
|
|
free((uint16*)sdl_tmpscreen->pixels);
|
2002-05-04 00:11:57 +00:00
|
|
|
SDL_FreeSurface(sdl_tmpscreen);
|
2002-04-12 21:26:59 +00:00
|
|
|
}
|
2002-05-04 00:11:57 +00:00
|
|
|
sdl_tmpscreen = NULL;
|
2001-11-05 19:21:49 +00:00
|
|
|
}
|
|
|
|
|
2002-08-24 10:41:32 +00:00
|
|
|
void OSystem_SDL_Normal::update_screen() {
|
2002-06-14 04:31:17 +00:00
|
|
|
|
2002-05-10 15:33:02 +00:00
|
|
|
if (sdl_hwscreen == NULL)
|
|
|
|
return; // Can this really happen?
|
|
|
|
|
2002-04-12 21:26:59 +00:00
|
|
|
/* First make sure the mouse is drawn, if it should be drawn. */
|
|
|
|
draw_mouse();
|
|
|
|
|
2002-05-10 15:33:02 +00:00
|
|
|
/* Palette update in case we are NOT in "real" 8 bit color mode.
|
|
|
|
* Must take place before updating the screen, since the palette must
|
|
|
|
* be set up for conversion from 8bit to 16bit.
|
|
|
|
*/
|
2002-05-09 18:23:33 +00:00
|
|
|
if (((_mode_flags & DF_REAL_8BIT) == 0) && _palette_changed_last != 0) {
|
|
|
|
SDL_SetColors(sdl_screen, _cur_pal + _palette_changed_first,
|
2002-04-15 17:45:52 +00:00
|
|
|
_palette_changed_first,
|
|
|
|
_palette_changed_last - _palette_changed_first);
|
2002-06-14 04:31:17 +00:00
|
|
|
|
2002-04-15 17:45:52 +00:00
|
|
|
_palette_changed_last = 0;
|
|
|
|
|
2002-05-09 18:23:33 +00:00
|
|
|
force_full = true;
|
2002-04-15 17:45:52 +00:00
|
|
|
}
|
|
|
|
|
2002-05-10 15:33:02 +00:00
|
|
|
|
|
|
|
/* If the shake position changed, fill the dirty area with blackness */
|
2002-05-04 00:11:57 +00:00
|
|
|
if (_current_shake_pos != _new_shake_pos) {
|
|
|
|
SDL_Rect blackrect = {0, 0, SCREEN_WIDTH*scaling, _new_shake_pos*scaling};
|
|
|
|
SDL_FillRect(sdl_hwscreen, &blackrect, 0);
|
2002-06-14 04:31:17 +00:00
|
|
|
|
2002-05-04 00:11:57 +00:00
|
|
|
_current_shake_pos = _new_shake_pos;
|
|
|
|
|
|
|
|
force_full = true;
|
2002-04-12 21:26:59 +00:00
|
|
|
}
|
|
|
|
|
2002-05-04 00:11:57 +00:00
|
|
|
/* force a full redraw if requested */
|
|
|
|
if (force_full) {
|
|
|
|
num_dirty_rects = 1;
|
|
|
|
|
|
|
|
dirty_rect_list[0].x = 0;
|
|
|
|
dirty_rect_list[0].y = 0;
|
|
|
|
dirty_rect_list[0].w = SCREEN_WIDTH;
|
|
|
|
dirty_rect_list[0].h = SCREEN_HEIGHT;
|
|
|
|
}
|
2002-04-15 17:45:52 +00:00
|
|
|
|
2002-05-10 15:33:02 +00:00
|
|
|
/* Only draw anything if necessary */
|
|
|
|
if (num_dirty_rects > 0) {
|
|
|
|
|
|
|
|
SDL_Rect *r;
|
|
|
|
uint32 srcPitch, dstPitch;
|
|
|
|
SDL_Rect *last_rect = dirty_rect_list + num_dirty_rects;
|
|
|
|
|
|
|
|
/* Convert appropriate parts of the image into 16bpp */
|
|
|
|
if ((_mode_flags & DF_REAL_8BIT) == 0) {
|
|
|
|
SDL_Rect dst;
|
|
|
|
for(r=dirty_rect_list; r!=last_rect; ++r) {
|
|
|
|
dst = *r;
|
|
|
|
dst.x++;
|
|
|
|
dst.y++;
|
|
|
|
if (SDL_BlitSurface(sdl_screen, r, sdl_tmpscreen, &dst) != 0)
|
|
|
|
error("SDL_BlitSurface failed: %s", SDL_GetError());
|
2002-05-04 00:11:57 +00:00
|
|
|
}
|
2002-04-12 21:26:59 +00:00
|
|
|
}
|
2002-05-10 15:33:02 +00:00
|
|
|
|
|
|
|
SDL_LockSurface(sdl_tmpscreen);
|
|
|
|
SDL_LockSurface(sdl_hwscreen);
|
|
|
|
|
|
|
|
srcPitch = sdl_tmpscreen->pitch;
|
|
|
|
dstPitch = sdl_hwscreen->pitch;
|
|
|
|
|
|
|
|
if ((_mode_flags & DF_REAL_8BIT) == 0) {
|
|
|
|
for(r=dirty_rect_list; r!=last_rect; ++r) {
|
|
|
|
register int dst_y = r->y + _current_shake_pos;
|
|
|
|
register int dst_h = 0;
|
|
|
|
if (dst_y < SCREEN_HEIGHT) {
|
|
|
|
dst_h = r->h;
|
|
|
|
if (dst_h > SCREEN_HEIGHT - dst_y)
|
|
|
|
dst_h = SCREEN_HEIGHT - dst_y;
|
|
|
|
|
|
|
|
r->x <<= 1;
|
|
|
|
dst_y <<= 1;
|
|
|
|
|
|
|
|
_sai_func((byte*)sdl_tmpscreen->pixels + (r->x+2) + (r->y+1)*srcPitch, srcPitch, NULL,
|
|
|
|
(byte*)sdl_hwscreen->pixels + r->x*scaling + dst_y*dstPitch, dstPitch, r->w, dst_h);
|
|
|
|
}
|
2002-05-04 01:16:06 +00:00
|
|
|
|
2002-05-10 15:33:02 +00:00
|
|
|
r->y = dst_y;
|
|
|
|
r->w <<= 1;
|
|
|
|
r->h = dst_h << 1;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
for(r=dirty_rect_list; r!=last_rect; ++r) {
|
|
|
|
register int dst_y = r->y + _current_shake_pos;
|
|
|
|
register int dst_h = 0;
|
|
|
|
if (dst_y < SCREEN_HEIGHT) {
|
|
|
|
dst_h = r->h;
|
|
|
|
if (dst_h > SCREEN_HEIGHT - dst_y)
|
|
|
|
dst_h = SCREEN_HEIGHT - dst_y;
|
|
|
|
|
|
|
|
dst_y *= scaling;
|
|
|
|
|
|
|
|
_sai_func((byte*)sdl_tmpscreen->pixels + r->x + r->y*srcPitch, srcPitch, NULL,
|
|
|
|
(byte*)sdl_hwscreen->pixels + r->x*scaling + dst_y*dstPitch, dstPitch, r->w, dst_h);
|
|
|
|
}
|
2002-05-04 01:16:06 +00:00
|
|
|
|
2002-05-10 15:33:02 +00:00
|
|
|
r->x *= scaling;
|
|
|
|
r->y = dst_y;
|
|
|
|
r->w *= scaling;
|
|
|
|
r->h = dst_h * scaling;
|
2002-05-04 00:11:57 +00:00
|
|
|
}
|
|
|
|
}
|
2002-05-10 15:33:02 +00:00
|
|
|
|
|
|
|
if (force_full) {
|
|
|
|
dirty_rect_list[0].y = 0;
|
|
|
|
dirty_rect_list[0].h = SCREEN_HEIGHT * scaling;
|
|
|
|
}
|
|
|
|
|
|
|
|
SDL_UnlockSurface(sdl_tmpscreen);
|
|
|
|
SDL_UnlockSurface(sdl_hwscreen);
|
2002-04-12 21:26:59 +00:00
|
|
|
}
|
2002-06-14 04:31:17 +00:00
|
|
|
|
2002-05-10 15:33:02 +00:00
|
|
|
/* Palette update in case we are in "real" 8 bit color mode.
|
|
|
|
* Must take place after the screen data was updated, since with
|
|
|
|
* "real" 8bit mode, palatte changes may be visible immediatly,
|
|
|
|
* and we want to avoid any ugly effects.
|
|
|
|
*/
|
2002-05-09 18:23:33 +00:00
|
|
|
if (_mode_flags & DF_REAL_8BIT && _palette_changed_last != 0) {
|
|
|
|
SDL_SetColors(sdl_hwscreen, _cur_pal + _palette_changed_first,
|
|
|
|
_palette_changed_first,
|
|
|
|
_palette_changed_last - _palette_changed_first);
|
|
|
|
|
|
|
|
_palette_changed_last = 0;
|
|
|
|
}
|
2002-06-14 04:31:17 +00:00
|
|
|
|
2002-05-10 15:33:02 +00:00
|
|
|
if (num_dirty_rects > 0) {
|
|
|
|
/* Finally, blit all our changes to the screen */
|
|
|
|
SDL_UpdateRects(sdl_hwscreen, num_dirty_rects, dirty_rect_list);
|
|
|
|
}
|
2002-05-09 18:23:33 +00:00
|
|
|
|
2002-04-12 21:26:59 +00:00
|
|
|
num_dirty_rects = 0;
|
2002-05-04 00:11:57 +00:00
|
|
|
force_full = false;
|
2002-03-17 13:00:11 +00:00
|
|
|
}
|
2001-11-11 16:54:45 +00:00
|
|
|
|
2002-08-24 10:41:32 +00:00
|
|
|
void OSystem_SDL_Normal::hotswap_gfx_mode() {
|
2002-04-13 12:43:02 +00:00
|
|
|
/* hmm, need to allocate a 320x200 bitmap
|
|
|
|
* which will contain the "backup" of the screen during the change.
|
|
|
|
* then draw that to the new screen right after it's setup.
|
|
|
|
*/
|
|
|
|
|
2002-05-07 18:44:34 +00:00
|
|
|
byte *bak_mem = (byte*)malloc(SCREEN_WIDTH*SCREEN_HEIGHT);
|
2002-04-13 12:43:02 +00:00
|
|
|
|
2002-04-13 13:11:24 +00:00
|
|
|
get_320x200_image(bak_mem);
|
2002-04-13 12:43:02 +00:00
|
|
|
|
|
|
|
unload_gfx_mode();
|
|
|
|
load_gfx_mode();
|
|
|
|
|
2002-04-13 18:34:11 +00:00
|
|
|
force_full = true;
|
2002-04-13 13:11:24 +00:00
|
|
|
|
|
|
|
/* reset palette */
|
2002-05-09 18:23:33 +00:00
|
|
|
if (_mode_flags & DF_REAL_8BIT)
|
|
|
|
SDL_SetColors(sdl_hwscreen, _cur_pal, 0, 256);
|
|
|
|
else
|
|
|
|
SDL_SetColors(sdl_screen, _cur_pal, 0, 256);
|
2002-04-13 13:11:24 +00:00
|
|
|
|
2002-04-13 18:34:11 +00:00
|
|
|
/* blit image */
|
2002-08-24 10:41:32 +00:00
|
|
|
OSystem_SDL_Normal::copy_rect(bak_mem, SCREEN_WIDTH, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
2002-04-13 18:34:11 +00:00
|
|
|
free(bak_mem);
|
|
|
|
|
2002-08-24 10:41:32 +00:00
|
|
|
OSystem_SDL_Normal::update_screen();
|
2002-04-13 12:43:02 +00:00
|
|
|
}
|
|
|
|
|
2002-08-24 10:41:32 +00:00
|
|
|
uint32 OSystem_SDL_Normal::property(int param, Property *value) {
|
2002-03-23 22:03:35 +00:00
|
|
|
|
2002-08-24 10:41:32 +00:00
|
|
|
if (param == PROP_TOGGLE_FULLSCREEN) {
|
2002-04-13 12:43:02 +00:00
|
|
|
_full_screen ^= true;
|
2002-04-28 06:51:23 +00:00
|
|
|
|
2002-04-13 12:43:02 +00:00
|
|
|
if (!SDL_WM_ToggleFullScreen(sdl_hwscreen)) {
|
|
|
|
/* if ToggleFullScreen fails, achieve the same effect with hotswap gfx mode */
|
|
|
|
hotswap_gfx_mode();
|
|
|
|
}
|
|
|
|
return 1;
|
2002-04-11 17:19:16 +00:00
|
|
|
}
|
2002-05-07 22:06:06 +00:00
|
|
|
|
2002-08-24 10:41:32 +00:00
|
|
|
return OSystem_SDL_Common::property(param, value);
|
2002-06-04 18:18:44 +00:00
|
|
|
}
|