[Scummvm-cvs-logs] CVS: scummvm/saga gfx.cpp,1.7,1.8 gfx_mod.h,1.4,1.5 reinherit.h,1.12,1.13 render.cpp,1.5,1.6 render.h,1.4,1.5 render_mod.h,1.4,1.5 sysgfx.cpp,1.5,1.6 sysinput.cpp,1.1,1.2
Eugene Sandulenko
sev at users.sourceforge.net
Sat May 1 02:41:09 CEST 2004
Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28792
Modified Files:
gfx.cpp gfx_mod.h reinherit.h render.cpp render.h render_mod.h
sysgfx.cpp sysinput.cpp
Log Message:
Remove scalers, 16bpp code, unused functions.
Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/gfx.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- gfx.cpp 1 May 2004 07:32:47 -0000 1.7
+++ gfx.cpp 1 May 2004 09:40:47 -0000 1.8
@@ -41,29 +41,6 @@
namespace Saga {
-int GFX_ClearSurface(char *buf, int w, int h, int p) {
- int y;
-
- for (y = 0; y < h; y++) {
- memset(buf, 0, w);
- buf += p;
- }
-
- return R_SUCCESS;
-}
-
-int GFX_ClearSurface16(char *buf, int w, int h, int p) {
- int y;
- w <<= 1;
-
- for (y = 0; y < h; y++) {
- memset(buf, 0, w);
- buf += p;
- }
-
- return R_SUCCESS;
-}
-
int GFX_DrawPalette(R_SURFACE *dst_s) {
int x;
int y;
@@ -112,100 +89,6 @@
return R_SUCCESS;
}
-int GFX_Scale2x(R_SURFACE *dst_s, R_SURFACE *src_s) {
- assert((dst_s != NULL) && (src_s != NULL));
- assert((dst_s->bpp == src_s->bpp));
-
- switch (dst_s->bpp) {
- case 8:
- return GFX_Scale2x8(dst_s, src_s);
- break;
-
- case 16:
- return GFX_Scale2x16(dst_s, src_s);
- break;
-
- default:
- break;
-
- }
-
- return R_FAILURE;
-}
-
-int GFX_Scale2x8(R_SURFACE *dst_s, R_SURFACE *src_s) {
- int y, x;
-
- int src_skip = src_s->buf_pitch - src_s->buf_w;
- int dst_skip = dst_s->buf_pitch - dst_s->buf_w;
-
- byte *src_ptr = src_s->buf;
- byte *dst_ptr = dst_s->buf;
-
- byte *src_row;
- byte *dst_row;
-
- assert(dst_s->buf_w == (src_s->buf_w * 2));
- assert(dst_s->buf_h == (src_s->buf_h * 2));
-
- for (y = 0; y < src_s->buf_h; y++) {
- src_row = src_ptr;
- dst_row = dst_ptr;
-
- for (x = 0; x < src_s->buf_w; x++) {
- *dst_ptr++ = *src_ptr;
- *dst_ptr++ = *src_ptr++;
- }
-
- dst_ptr += dst_skip;
-
- memcpy(dst_ptr, dst_row, dst_s->buf_w);
-
- dst_ptr += dst_s->buf_pitch;
- src_ptr += src_skip;
- }
-
- return R_SUCCESS;
-}
-
-int GFX_Scale2x16(R_SURFACE *dst_s, R_SURFACE *src_s) {
- int y, x;
-
- int src_skip;
- int dest_skip;
-
- byte *src_ptr = src_s->buf;
- byte *dest_ptr = dst_s->buf;
-
- short *src_row;
- short *dest_row;
-
- assert((dst_s != NULL) && (src_s != NULL));
-
- src_skip = (src_s->buf_pitch - src_s->buf_w) / sizeof(short);
- dest_skip = (dst_s->buf_pitch - dst_s->buf_w) / sizeof(short);
-
- for (y = 0; y < src_s->buf_h; y++) {
- src_row = (short *)src_ptr;
- dest_row = (short *)dest_ptr;
-
- for (x = 0; x < src_s->buf_w; x++) {
- *dest_row++ = *src_row;
- *dest_row++ = *src_row++;
- }
-
- src_ptr += src_s->buf_pitch;
-
- memcpy(dest_ptr + dst_s->buf_pitch, dest_ptr,
- dst_s->buf_w << 1);
-
- dest_ptr += dst_s->buf_pitch;
- dest_ptr += dst_s->buf_pitch;
- }
-
- return R_SUCCESS;
-}
-
// * Copies a rectangle from a raw 8 bit pixel buffer to the specified surface.
// The buffer is of width 'src_w' and height 'src_h'. The rectangle to be
// copied is defined by 'src_rect'.
Index: gfx_mod.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/gfx_mod.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- gfx_mod.h 1 May 2004 07:32:48 -0000 1.4
+++ gfx_mod.h 1 May 2004 09:40:47 -0000 1.5
@@ -45,12 +45,6 @@
};
int GFX_SimpleBlit(R_SURFACE *dst_s, R_SURFACE *src_s);
-int GFX_Scale2x(R_SURFACE *dst_s, R_SURFACE *src_s);
-int GFX_Scale2x8(R_SURFACE *dst_s, R_SURFACE *src_s);
-int GFX_Scale2x16(R_SURFACE *dst_s, R_SURFACE *src_s);
-int GFX_SLScale2x16(char *dest_buf, int dest_w, int dest_p, int dst_h, char *src_buf, int src_w, int src_p, int src_h);
-int GFX_ClearSurface(char *buf, int w, int h, int p);
-int GFX_ClearSurface16(char *buf, int w, int h, int p);
int GFX_DrawPalette(R_SURFACE *dst_s);
int GFX_BufToSurface(R_SURFACE *ds, const byte *src, int src_w, int src_h, R_RECT *src_rect, R_POINT *dst_pt);
int GFX_BufToBuffer(byte * dst_buf, int dst_w, int dst_h, const byte *src,
Index: reinherit.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/reinherit.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- reinherit.h 30 Apr 2004 23:02:23 -0000 1.12
+++ reinherit.h 1 May 2004 09:40:47 -0000 1.13
@@ -144,8 +144,6 @@
int screen_w;
int screen_h;
int screen_bpp;
-
- int fullscreen;
};
int SYSGFX_Init(R_SYSGFX_INIT *);
@@ -156,10 +154,6 @@
int SYSGFX_LockSurface(R_SURFACE *surface);
int SYSGFX_UnlockSurface(R_SURFACE *surface);
-R_SURFACE *SYSGFX_CreateSurface(int w, int h, int bpp);
-R_SURFACE *SYSGFX_FormatToDisplay(R_SURFACE *surface);
-int SYSGFX_DestroySurface(R_SURFACE *surface);
-
int SYSGFX_GetWhite(void);
int SYSGFX_GetBlack(void);
int SYSGFX_MatchColor(unsigned long colormask);
Index: render.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/render.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- render.cpp 1 May 2004 07:50:08 -0000 1.5
+++ render.cpp 1 May 2004 09:40:47 -0000 1.6
@@ -54,30 +54,6 @@
const char *test_txt = "The quick brown fox jumped over the lazy dog. She sells sea shells down by the sea shore.";
int RENDER_Register() {
- // Register "r_fullscreen" cfg cvar
- RenderModule.r_fullscreen = R_FULLSCREEN_DEFAULT;
-
- if (CVAR_Register_I(&RenderModule.r_fullscreen,
- "r_fullscreen", NULL, R_CVAR_CFG, 0, 1) != R_SUCCESS) {
- return R_FAILURE;
- }
-
- // Register "r_doubleres" cfg cvar
- RenderModule.r_doubleres = R_DOUBLERES_DEFAULT;
-
- if (CVAR_Register_I(&RenderModule.r_doubleres,
- "r_doubleres", NULL, R_CVAR_CFG, 0, 1) != R_SUCCESS) {
- return R_FAILURE;
- }
-
- // Register "r_hicolor" cfg cvar
- RenderModule.r_hicolor = R_HICOLOR_DEFAULT;
-
- if (CVAR_Register_I(&RenderModule.r_hicolor,
- "r_hicolor", NULL, R_CVAR_CFG, 0, 1) != R_SUCCESS) {
- return R_FAILURE;
- }
-
// Register "r_softcursor" cfg cvar
RenderModule.r_softcursor = R_SOFTCURSOR_DEFAULT;
@@ -102,28 +78,11 @@
gfx_init.backbuf_w = disp_info.logical_w;
gfx_init.backbuf_h = disp_info.logical_h;
- if (RenderModule.r_hicolor) {
- gfx_init.screen_bpp = 16;
- } else {
- gfx_init.screen_bpp = 8;
- }
+ gfx_init.screen_bpp = 8;
gfx_init.screen_w = disp_info.logical_w;
gfx_init.screen_h = disp_info.logical_h;
- // Don't try to double a game exceeding the resolution limit
- // (640x480 would get doubled to 1280 x 960!) */
- if (disp_info.logical_w > R_DOUBLE_RESLIMIT) {
- RenderModule.r_doubleres = 0;
- }
-
- if (RenderModule.r_doubleres) {
- gfx_init.screen_w *= 2;
- gfx_init.screen_h *= 2;
- }
-
- gfx_init.fullscreen = RenderModule.r_fullscreen;
-
if (SYSGFX_Init(&gfx_init) != R_SUCCESS) {
return R_FAILURE;
}
@@ -149,15 +108,6 @@
tmp_h = disp_info.logical_h + 4; // BG unbanking requres extra rows
tmp_bytepp = 1;
- if (RenderModule.r_doubleres) {
- tmp_w *= 2;
- tmp_h *= 2;
- }
-
- if (RenderModule.r_hicolor) {
- tmp_bytepp = 2;
- }
-
RenderModule.r_tmp_buf = (byte *)calloc(1, tmp_w * tmp_h * tmp_bytepp);
if (RenderModule.r_tmp_buf == NULL) {
@@ -193,7 +143,6 @@
int fps_width;
R_POINT mouse_pt;
int mouse_x, mouse_y;
- int surface_converted = 0;
if (!RenderModule.initialized) {
return R_FAILURE;
@@ -210,11 +159,6 @@
mouse_pt.x = mouse_x;
mouse_pt.y = mouse_y;
- if (RenderModule.r_doubleres) {
- mouse_pt.x /= 2;
- mouse_pt.y /= 2;
- }
-
SCENE_GetBGInfo(&bg_info);
GAME_GetDisplayInfo(&disp_info);
bg_pt.x = 0;
@@ -246,25 +190,6 @@
fps_width = FONT_GetStringWidth(SMALL_FONT_ID, txt_buf, 0, FONT_NORMAL);
FONT_Draw(SMALL_FONT_ID, backbuf_surface, txt_buf, 0, backbuf_surface->buf_w - fps_width, 2,
SYSGFX_GetWhite(), SYSGFX_GetBlack(), FONT_OUTLINE);
- switch (RenderModule.r_mode) {
- case RM_SCANLINES:
- FONT_Draw(SMALL_FONT_ID, backbuf_surface, "Scanlines", 0, 2, 2,
- SYSGFX_GetWhite(), SYSGFX_GetBlack(), FONT_OUTLINE);
- break;
- case RM_2XSAI:
- FONT_Draw(SMALL_FONT_ID, backbuf_surface, "2xSaI", 0, 2, 2,
- SYSGFX_GetWhite(), SYSGFX_GetBlack(), FONT_OUTLINE);
- break;
- case RM_SUPER2XSAI:
- FONT_Draw(SMALL_FONT_ID, backbuf_surface, "Super2xSaI", 0, 2, 2,
- SYSGFX_GetWhite(), SYSGFX_GetBlack(), FONT_OUTLINE);
- break;
- case RM_SUPEREAGLE:
- FONT_Draw(SMALL_FONT_ID, backbuf_surface, "SuperEagle", 0, 2, 2,
- SYSGFX_GetWhite(), SYSGFX_GetBlack(), FONT_OUTLINE);
- break;
- }
-
}
// Display "paused game" message, if applicable
@@ -298,39 +223,16 @@
CON_Draw(backbuf_surface);
// Display the current frame
- if (RenderModule.r_hicolor) {
- display_surface = SYSGFX_FormatToDisplay(backbuf_surface);
- if (display_surface == NULL) {
- R_printf(R_STDERR, "Error: Back buffer conversion failed!\n");
- return R_FAILURE;
- }
- surface_converted = 1;
- } else {
- display_surface = backbuf_surface;
- }
+ display_surface = backbuf_surface;
SYSGFX_LockSurface(screen_surface);
SYSGFX_LockSurface(display_surface);
- switch (RenderModule.r_mode) {
- case RM_SCANLINES:
- break;
- default:
- if (RenderModule.r_doubleres) {
- GFX_Scale2x(screen_surface, display_surface);
- } else {
- GFX_SimpleBlit(screen_surface, display_surface);
- }
- break;
- }
+ GFX_SimpleBlit(screen_surface, display_surface);
SYSGFX_UnlockSurface(display_surface);
SYSGFX_UnlockSurface(screen_surface);
- if (surface_converted) {
- SYSGFX_DestroySurface(display_surface);
- }
-
// FIXME
SDL_UpdateRect((SDL_Surface *)screen_surface->impl_src, 0, 0, 0, 0);
@@ -359,16 +261,6 @@
return;
}
-void RENDER_ConvertMousePt(R_POINT *mouse_pt) {
- assert(mouse_pt != NULL);
-
- if (RenderModule.r_doubleres) {
-
- mouse_pt->x /= 2;
- mouse_pt->y /= 2;
- }
-}
-
unsigned int RENDER_GetFlags() {
return RenderModule.r_flags;
}
@@ -381,37 +273,6 @@
RenderModule.r_flags ^= flag;
}
-int RENDER_SetMode(int mode) {
- switch (mode) {
- case RM_SCANLINES:
- if (!RenderModule.r_doubleres) {
- return R_FAILURE;
- }
- break;
- case RM_2XSAI:
- if (!RenderModule.r_doubleres || !RenderModule.r_hicolor) {
- return R_FAILURE;
- }
- break;
- case RM_SUPER2XSAI:
- if (!RenderModule.r_doubleres || !RenderModule.r_hicolor) {
- return R_FAILURE;
- }
- break;
- case RM_SUPEREAGLE:
- if (!RenderModule.r_doubleres || !RenderModule.r_hicolor) {
- return R_FAILURE;
- }
- break;
- default:
- break;
- }
-
- RenderModule.r_mode = mode;
-
- return R_SUCCESS;
-}
-
int RENDER_GetBufferInfo(R_BUFFER_INFO *r_bufinfo) {
assert(r_bufinfo != NULL);
Index: render.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/render.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- render.h 1 May 2004 07:50:08 -0000 1.4
+++ render.h 1 May 2004 09:40:47 -0000 1.5
@@ -34,8 +34,6 @@
#define R_HICOLOR_DEFAULT 1
#define R_SOFTCURSOR_DEFAULT 1
-#define R_DOUBLE_RESLIMIT 320
-
#define R_PAUSEGAME_MSG "PAWS GAME"
struct R_RENDER_MODULE {
@@ -43,8 +41,6 @@
// Init cvars
int r_fullscreen;
- int r_doubleres;
- int r_hicolor;
int r_softcursor;
// Module data
Index: render_mod.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/render_mod.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- render_mod.h 1 May 2004 07:50:08 -0000 1.4
+++ render_mod.h 1 May 2004 09:40:47 -0000 1.5
@@ -37,16 +37,6 @@
RF_GAMEPAUSE = 0x20
};
-enum RENDER_MODES {
- RM_NORMAL,
- RM_SCANLINES,
- RM_SCANLINES50,
- RM_2XSAI,
- RM_SUPER2XSAI,
- RM_SUPEREAGLE,
- RM_BILINEAR
-};
-
struct R_BUFFER_INFO {
byte *r_bg_buf;
int r_bg_buf_w;
@@ -59,11 +49,9 @@
int RENDER_Register();
int RENDER_Init();
int RENDER_DrawScene();
-void RENDER_ConvertMousePt(R_POINT *);
unsigned int RENDER_GetFlags();
void RENDER_SetFlag(unsigned int);
void RENDER_ToggleFlag(unsigned int);
-int RENDER_SetMode(int);
unsigned int RENDER_GetFrameCount(void);
unsigned int RENDER_ResetFrameCount(void);
int RENDER_GetBufferInfo(R_BUFFER_INFO *);
Index: sysgfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sysgfx.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- sysgfx.cpp 1 May 2004 07:39:39 -0000 1.5
+++ sysgfx.cpp 1 May 2004 09:40:47 -0000 1.6
@@ -45,11 +45,7 @@
assert(gfx_init != NULL);
- if (gfx_init->fullscreen) {
- flags = SDL_FULLSCREEN | SDL_HWPALETTE;
- } else {
- flags = SDL_HWPALETTE;
- }
+ flags = SDL_HWPALETTE;
// Test video mode availability */
result = SDL_VideoModeOK(gfx_init->screen_w, gfx_init->screen_h, gfx_init->screen_bpp, flags);
@@ -145,78 +141,6 @@
return R_SUCCESS;
}
-R_SURFACE *SYSGFX_FormatToDisplay(R_SURFACE *surface) {
- R_SURFACE *new_r_surface;
- SDL_Surface *new_sdl_surface;
-
- new_r_surface = (R_SURFACE *)malloc(sizeof *new_r_surface);
- if (new_r_surface == NULL) {
- return NULL;
- }
-
- new_sdl_surface = SDL_DisplayFormat((SDL_Surface *)surface->impl_src);
- if (new_sdl_surface == NULL) {
- free(new_r_surface);
- return NULL;
- }
-
- new_r_surface->buf = (byte *)new_sdl_surface->pixels;
- new_r_surface->buf_w = new_sdl_surface->w;
- new_r_surface->buf_h = new_sdl_surface->h;
- new_r_surface->buf_pitch = new_sdl_surface->pitch;
- new_r_surface->bpp = new_sdl_surface->format->BitsPerPixel;
-
- new_r_surface->clip_rect.left = 0;
- new_r_surface->clip_rect.top = 0;
- new_r_surface->clip_rect.right = new_sdl_surface->w - 1;
- new_r_surface->clip_rect.bottom = new_sdl_surface->h - 1;
-
- new_r_surface->impl_src = new_sdl_surface;
-
- return new_r_surface;
-}
-
-R_SURFACE *SYSGFX_CreateSurface(int w, int h, int bpp) {
- R_SURFACE *new_surface;
- SDL_Surface *new_sdl_surface;
-
- assert(bpp == 8); // 16bpp not supported, maybe not necessary?
- assert((w > 0) && (h > 0));
-
- new_surface = (R_SURFACE *)malloc(sizeof *new_surface);
- if (new_surface == NULL) {
- return NULL;
- }
-
- new_sdl_surface = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, bpp, 0, 0, 0, 0);
- if (new_sdl_surface == NULL) {
- free(new_surface);
- return NULL;
- }
-
- new_surface->buf_w = new_sdl_surface->w;
- new_surface->buf_h = new_sdl_surface->h;
- new_surface->buf_pitch = new_sdl_surface->pitch;
- new_surface->bpp = new_sdl_surface->format->BitsPerPixel;
-
- new_surface->clip_rect.left = 0;
- new_surface->clip_rect.top = 0;
- new_surface->clip_rect.right = w - 1;
- new_surface->clip_rect.bottom = h - 1;
-
- new_surface->impl_src = new_sdl_surface;
-
- return new_surface;
-}
-
-int SYSGFX_DestroySurface(R_SURFACE *surface) {
- SDL_FreeSurface((SDL_Surface *) surface->impl_src);
-
- free(surface);
-
- return R_SUCCESS;
-}
-
int SYSGFX_GetWhite(void) {
return SGfxModule.white_index;
}
Index: sysinput.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sysinput.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- sysinput.cpp 12 Apr 2004 21:40:48 -0000 1.1
+++ sysinput.cpp 1 May 2004 09:40:47 -0000 1.2
@@ -61,8 +61,6 @@
imouse_pt.x = mouse_x;
imouse_pt.y = mouse_y;
- RENDER_ConvertMousePt(&imouse_pt);
-
while (SDL_PollEvent(&sdl_event)) {
int in_char;
@@ -152,22 +150,6 @@
RENDER_ToggleFlag(RF_OBJECTMAP_TEST);
break;
- case SDLK_1:
- RENDER_SetMode(RM_NORMAL);
- break;
-
- case SDLK_4:
- RENDER_SetMode(RM_2XSAI);
- break;
-
- case SDLK_5:
- RENDER_SetMode(RM_SUPER2XSAI);
- break;
-
- case SDLK_6:
- RENDER_SetMode(RM_SUPEREAGLE);
- break;
-
case SDLK_TAB:
STHREAD_DebugStep();
break;
More information about the Scummvm-git-logs
mailing list