[Scummvm-cvs-logs] CVS: scummvm/saga actionmap.cpp,1.16,1.17 actor.cpp,1.15,1.16 animation.cpp,1.17,1.18 console.cpp,1.7,1.8 cvar.cpp,1.8,1.9 events.cpp,1.14,1.15 font.cpp,1.11,1.12 gfx.cpp,1.21,1.22 gfx.h,1.5,1.6 ihnm_introproc.cpp,1.9,1.10 input.cpp,1.5,1.6 interface.cpp,1.11,1.12 isomap.cpp,1.9,1.10 ite_introproc.cpp,1.13,1.14 objectmap.cpp,1.11,1.12 palanim.cpp,1.9,1.10 render.cpp,1.18,1.19 render.h,1.10,1.11 saga.h,1.19,1.20 scene.cpp,1.17,1.18 script.cpp,1.10,1.11 sdata.cpp,1.7,1.8 sdebug.cpp,1.5,1.6 sfuncs.cpp,1.7,1.8 sprite.cpp,1.10,1.11 sstack.cpp,1.4,1.5 sthread.cpp,1.10,1.11 text.cpp,1.3,1.4 gfx_mod.h,1.7,NONE
Jonathan Gray
khalek at users.sourceforge.net
Sun Aug 1 04:50:00 CEST 2004
Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14177
Modified Files:
actionmap.cpp actor.cpp animation.cpp console.cpp cvar.cpp
events.cpp font.cpp gfx.cpp gfx.h ihnm_introproc.cpp input.cpp
interface.cpp isomap.cpp ite_introproc.cpp objectmap.cpp
palanim.cpp render.cpp render.h saga.h scene.cpp script.cpp
sdata.cpp sdebug.cpp sfuncs.cpp sprite.cpp sstack.cpp
sthread.cpp text.cpp
Removed Files:
gfx_mod.h
Log Message:
merge gfx_mod.h into gfx.h and stick functions into a class
Index: actionmap.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/actionmap.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- actionmap.cpp 1 Aug 2004 10:02:41 -0000 1.16
+++ actionmap.cpp 1 Aug 2004 11:48:52 -0000 1.17
@@ -25,7 +25,7 @@
#include "saga.h"
#include "cvar_mod.h"
-#include "gfx_mod.h"
+#include "gfx.h"
#include "console_mod.h"
#include "actionmap.h"
@@ -159,11 +159,11 @@
for (i = 0; i < _n_exits; i++) {
if (_exits_tbl[i].pt_count == 2) {
- GFX_DrawFrame(ds,
+ _vm->_gfx->drawFrame(ds,
&_exits_tbl[i].pt_tbl[0],
&_exits_tbl[i].pt_tbl[1], color);
} else if (_exits_tbl[i].pt_count > 2) {
- GFX_DrawPolyLine(ds, _exits_tbl[i].pt_tbl,
+ _vm->_gfx->drawPolyLine(ds, _exits_tbl[i].pt_tbl,
_exits_tbl[i].pt_count, color);
}
}
Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/actor.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- actor.cpp 1 Aug 2004 10:02:41 -0000 1.15
+++ actor.cpp 1 Aug 2004 11:48:52 -0000 1.16
@@ -23,7 +23,7 @@
#include "saga.h"
#include "yslib.h"
-#include "gfx_mod.h"
+#include "gfx.h"
#include "game_mod.h"
#include "cvar_mod.h"
@@ -220,7 +220,7 @@
R_SURFACE *back_buf;
- back_buf = GFX_GetBackBuffer();
+ back_buf = _vm->_gfx->getBackBuffer();
for (walk_p = ys_dll_head(ActorModule.list); walk_p != NULL; walk_p = ys_dll_next(walk_p)) {
actor = (R_ACTOR *)ys_dll_get_data(walk_p);
Index: animation.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/animation.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- animation.cpp 1 Aug 2004 10:48:11 -0000 1.17
+++ animation.cpp 1 Aug 2004 11:48:52 -0000 1.18
@@ -23,7 +23,7 @@
// Background animation management module
#include "saga.h"
-#include "gfx_mod.h"
+#include "gfx.h"
#include "cvar_mod.h"
#include "console_mod.h"
Index: console.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/console.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- console.cpp 1 Aug 2004 01:56:21 -0000 1.7
+++ console.cpp 1 Aug 2004 11:48:52 -0000 1.8
@@ -24,11 +24,10 @@
// Console module
#include "saga.h"
-#include "gfx_mod.h"
+#include "gfx.h"
#include "font_mod.h"
#include "cvar_mod.h"
#include "events_mod.h"
-#include "gfx_mod.h"
#include "console_mod.h"
#include "console.h"
@@ -216,9 +215,9 @@
fill_rect.bottom = ConInfo.y_pos;
fill_rect.right = ds->buf_w - 1;
- GFX_DrawRect(ds, &fill_rect, GFX_MatchColor(R_CONSOLE_BGCOLOR));
- txt_fgcolor = GFX_MatchColor(R_CONSOLE_TXTCOLOR);
- txt_shcolor = GFX_MatchColor(R_CONSOLE_TXTSHADOW);
+ _vm->_gfx->drawRect(ds, &fill_rect, _vm->_gfx->matchColor(R_CONSOLE_BGCOLOR));
+ txt_fgcolor = _vm->_gfx->matchColor(R_CONSOLE_TXTCOLOR);
+ txt_shcolor = _vm->_gfx->matchColor(R_CONSOLE_TXTSHADOW);
FONT_Draw(SMALL_FONT_ID, ds, ">", 1, 2, ConInfo.y_pos - 10, txt_fgcolor, txt_shcolor, FONT_SHADOW);
FONT_Draw(SMALL_FONT_ID, ds, ConInfo.input_buf, strlen(ConInfo.input_buf),
@@ -353,7 +352,7 @@
percent = 1.0;
}
- back_buf = GFX_GetBackBuffer();
+ back_buf = _vm->_gfx->getBackBuffer();
CON_SetDropPos(percent);
CON_Draw(back_buf);
@@ -368,7 +367,7 @@
ConInfo.active = 0;
}
- back_buf = GFX_GetBackBuffer();
+ back_buf = _vm->_gfx->getBackBuffer();
CON_SetDropPos(1.0 - percent);
CON_Draw(back_buf);
Index: cvar.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/cvar.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cvar.cpp 1 Aug 2004 01:56:21 -0000 1.8
+++ cvar.cpp 1 Aug 2004 11:48:52 -0000 1.9
@@ -23,7 +23,7 @@
// Configuration Variable Module
#include "saga.h"
-#include "gfx_mod.h"
+#include "gfx.h"
#include "console_mod.h"
Index: events.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/events.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- events.cpp 1 Aug 2004 01:56:21 -0000 1.14
+++ events.cpp 1 Aug 2004 11:48:53 -0000 1.15
@@ -25,14 +25,13 @@
#include "saga.h"
-#include "gfx_mod.h"
+#include "gfx.h"
#include "yslib.h"
#include "animation.h"
#include "console_mod.h"
#include "scene_mod.h"
-#include "gfx_mod.h"
#include "interface_mod.h"
#include "text_mod.h"
#include "palanim_mod.h"
@@ -159,13 +158,13 @@
case R_PAL_EVENT:
switch (event->op) {
case EVENT_BLACKTOPAL:
- back_buf = GFX_GetBackBuffer();
- GFX_BlackToPal(back_buf, (PALENTRY *)event->data, event_pc);
+ back_buf = _vm->_gfx->getBackBuffer();
+ _vm->_gfx->blackToPal(back_buf, (PALENTRY *)event->data, event_pc);
break;
case EVENT_PALTOBLACK:
- back_buf = GFX_GetBackBuffer();
- GFX_PalToBlack(back_buf, (PALENTRY *)event->data, event_pc);
+ back_buf = _vm->_gfx->getBackBuffer();
+ _vm->_gfx->palToBlack(back_buf, (PALENTRY *)event->data, event_pc);
break;
default:
break;
@@ -249,7 +248,7 @@
if (SCENE_GetMode() == R_SCENE_MODE_NORMAL) {
- back_buf = GFX_GetBackBuffer();
+ back_buf = _vm->_gfx->getBackBuffer();
_vm->_render->getBufferInfo(&rbuf_info);
SCENE_GetBGInfo(&bginfo);
@@ -257,12 +256,12 @@
bg_pt.x = bginfo.bg_x;
bg_pt.y = bginfo.bg_y;
- GFX_BufToBuffer(rbuf_info.r_bg_buf, rbuf_info.r_bg_buf_w, rbuf_info.r_bg_buf_h,
+ _vm->_gfx->bufToBuffer(rbuf_info.r_bg_buf, rbuf_info.r_bg_buf_w, rbuf_info.r_bg_buf_h,
bginfo.bg_buf, bginfo.bg_w, bginfo.bg_h, NULL, &bg_pt);
if (event->param == SET_PALETTE) {
PALENTRY *pal_p;
SCENE_GetBGPal(&pal_p);
- GFX_SetPalette(back_buf, pal_p);
+ _vm->_gfx->setPalette(back_buf, pal_p);
}
}
}
Index: font.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/font.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- font.cpp 1 Aug 2004 10:02:41 -0000 1.11
+++ font.cpp 1 Aug 2004 11:48:53 -0000 1.12
@@ -23,7 +23,7 @@
// Font management and font drawing module
#include "saga.h"
-#include "gfx_mod.h"
+#include "gfx.h"
#include "rscfile_mod.h"
#include "game_mod.h"
Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/gfx.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- gfx.cpp 1 Aug 2004 01:56:21 -0000 1.21
+++ gfx.cpp 1 Aug 2004 11:48:53 -0000 1.22
@@ -28,7 +28,6 @@
// Coriolis Group Books, 1997
#include "saga/saga.h"
-#include "saga/gfx_mod.h"
#include "saga/gfx.h"
#include "common/system.h"
@@ -41,7 +40,7 @@
static byte cur_pal[R_PAL_ENTRIES * 4];
-int GFX_Init(OSystem *system, int width, int height) {
+Gfx::Gfx(OSystem *system, int width, int height) {
R_SURFACE r_back_buf;
_system = system;
@@ -66,10 +65,8 @@
GfxModule.black_index = -1;
// For now, always show the mouse cursor.
- GFX_SetCursor(1);
+ setCursor(1);
g_system->showMouse(true);
-
- return R_SUCCESS;
}
/*
@@ -78,7 +75,7 @@
}
*/
-int GFX_DrawPalette(R_SURFACE *dst_s) {
+int Gfx::drawPalette(R_SURFACE *dst_s) {
int x;
int y;
int color = 0;
@@ -93,7 +90,7 @@
pal_rect.left = (x * 8) + 4;
pal_rect.right = pal_rect.left + 8;
- GFX_DrawRect(dst_s, &pal_rect, color);
+ drawRect(dst_s, &pal_rect, color);
color++;
}
}
@@ -101,7 +98,7 @@
return 0;
}
-int GFX_SimpleBlit(R_SURFACE *dst_s, R_SURFACE *src_s) {
+int Gfx::simpleBlit(R_SURFACE *dst_s, R_SURFACE *src_s) {
byte *src_p;
byte *dst_p;
int y, w, p;
@@ -135,7 +132,7 @@
// - If src_rect is NULL, the entire buffer is copied./
// - The surface must match the logical dimensions of the buffer exactly.
// - Returns R_FAILURE on error
-int GFX_BufToSurface(R_SURFACE *ds, const byte *src, int src_w, int src_h,
+int Gfx::bufToSurface(R_SURFACE *ds, const byte *src, int src_w, int src_h,
R_RECT *src_rect, R_POINT *dst_pt) {
const byte *read_p;
byte *write_p;
@@ -261,7 +258,7 @@
return R_SUCCESS;
}
-int GFX_BufToBuffer(byte *dst_buf, int dst_w, int dst_h, const byte *src,
+int Gfx::bufToBuffer(byte *dst_buf, int dst_w, int dst_h, const byte *src,
int src_w, int src_h, R_RECT *src_rect, R_POINT *dst_pt) {
const byte *read_p;
byte *write_p;
@@ -383,7 +380,7 @@
// Fills a rectangle in the surface ds from point 'p1' to point 'p2' using
// the specified color.
-int GFX_DrawRect(R_SURFACE *ds, R_RECT *dst_rect, int color) {
+int Gfx::drawRect(R_SURFACE *ds, R_RECT *dst_rect, int color) {
byte *write_p;
int w;
@@ -423,7 +420,7 @@
return R_SUCCESS;
}
-int GFX_DrawFrame(R_SURFACE *ds, R_POINT *p1, R_POINT *p2, int color) {
+int Gfx::drawFrame(R_SURFACE *ds, R_POINT *p1, R_POINT *p2, int color) {
int left, top, right, bottom;
int min_x;
@@ -457,15 +454,15 @@
n_p4.x = min_x;
n_p4.y = max_y;
- GFX_DrawLine(ds, &n_p1, &n_p2, color);
- GFX_DrawLine(ds, &n_p2, &n_p3, color);
- GFX_DrawLine(ds, &n_p3, &n_p4, color);
- GFX_DrawLine(ds, &n_p4, &n_p1, color);
+ drawLine(ds, &n_p1, &n_p2, color);
+ drawLine(ds, &n_p2, &n_p3, color);
+ drawLine(ds, &n_p3, &n_p4, color);
+ drawLine(ds, &n_p4, &n_p1, color);
return R_SUCCESS;
}
-int GFX_DrawPolyLine(R_SURFACE *ds, R_POINT *pts, int pt_ct, int draw_color) {
+int Gfx::drawPolyLine(R_SURFACE *ds, R_POINT *pts, int pt_ct, int draw_color) {
R_POINT *first_pt = pts;
int last_i = 1;
int i;
@@ -477,16 +474,16 @@
}
for (i = 1; i < pt_ct; i++) {
- GFX_DrawLine(ds, &pts[i], &pts[i - 1], draw_color);
+ drawLine(ds, &pts[i], &pts[i - 1], draw_color);
last_i = i;
}
- GFX_DrawLine(ds, &pts[last_i], first_pt, draw_color);
+ drawLine(ds, &pts[last_i], first_pt, draw_color);
return R_SUCCESS;
}
-int GFX_GetClipInfo(R_CLIPINFO *clipinfo) {
+int Gfx::getClipInfo(R_CLIPINFO *clipinfo) {
Common::Rect s;
int d_x, d_y;
@@ -570,7 +567,7 @@
return R_SUCCESS;
}
-int GFX_ClipLine(R_SURFACE *ds, const R_POINT *src_p1, const R_POINT *src_p2,
+int Gfx::clipLine(R_SURFACE *ds, const R_POINT *src_p1, const R_POINT *src_p2,
R_POINT *dst_p1, R_POINT *dst_p2) {
const R_POINT *n_p1;
const R_POINT *n_p2;
@@ -642,7 +639,7 @@
// Coriolis Group Books, 1997
//
// Performs no clipping
-void GFX_DrawLine(R_SURFACE *ds, R_POINT *p1, R_POINT *p2, int color) {
+void Gfx::drawLine(R_SURFACE *ds, R_POINT *p1, R_POINT *p2, int color) {
byte *write_p;
int clip_result;
int temp;
@@ -658,7 +655,7 @@
int left, top, right, bottom;
int i, k;
- clip_result = GFX_ClipLine(ds, p1, p2, &clip_p1, &clip_p2);
+ clip_result = clipLine(ds, p1, p2, &clip_p1, &clip_p2);
if (clip_result < 0) {
// Line not visible
return;
@@ -817,19 +814,19 @@
return;
}
-R_SURFACE *GFX_GetBackBuffer() {
+R_SURFACE *Gfx::getBackBuffer() {
return &GfxModule.r_back_buf;
}
-int GFX_GetWhite(void) {
+int Gfx::getWhite(void) {
return GfxModule.white_index;
}
-int GFX_GetBlack(void) {
+int Gfx::getBlack(void) {
return GfxModule.black_index;
}
-int GFX_MatchColor(unsigned long colormask) {
+int Gfx::matchColor(unsigned long colormask) {
int i;
int red = (colormask & 0x0FF0000UL) >> 16;
int green = (colormask & 0x000FF00UL) >> 8;
@@ -866,7 +863,7 @@
return best_index;
}
-int GFX_SetPalette(R_SURFACE *surface, PALENTRY *pal) {
+int Gfx::setPalette(R_SURFACE *surface, PALENTRY *pal) {
byte red;
byte green;
byte blue;
@@ -905,7 +902,7 @@
// correct. We may have to reconsider this code later, but for now
// there is only one cursor image.
if (GfxModule.white_index != best_windex) {
- GFX_SetCursor(best_windex);
+ setCursor(best_windex);
}
// Set whitest and blackest color indices
@@ -917,7 +914,7 @@
return R_SUCCESS;
}
-int GFX_GetCurrentPal(PALENTRY *src_pal) {
+int Gfx::getCurrentPal(PALENTRY *src_pal) {
int i;
byte *ppal;
@@ -930,7 +927,7 @@
return R_SUCCESS;
}
-int GFX_PalToBlack(R_SURFACE *surface, PALENTRY *src_pal, double percent) {
+int Gfx::palToBlack(R_SURFACE *surface, PALENTRY *src_pal, double percent) {
int i;
//int fade_max = 255;
int new_entry;
@@ -980,7 +977,7 @@
return R_SUCCESS;
}
-int GFX_BlackToPal(R_SURFACE *surface, PALENTRY *src_pal, double percent) {
+int Gfx::blackToPal(R_SURFACE *surface, PALENTRY *src_pal, double percent) {
int new_entry;
double fpercent;
int color_delta;
@@ -1051,7 +1048,7 @@
// correct. We may have to reconsider this code later, but for now
// there is only one cursor image.
if (GfxModule.white_index != best_windex) {
- GFX_SetCursor(best_windex);
+ setCursor(best_windex);
}
_system->setPalette(cur_pal, 0, R_PAL_ENTRIES);
@@ -1059,7 +1056,7 @@
return R_SUCCESS;
}
-void GFX_SetCursor(int best_white) {
+void Gfx::setCursor(int best_white) {
int i;
byte keycolor = (best_white == 0) ? 1 : 0;
Index: gfx.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/gfx.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- gfx.h 2 May 2004 16:32:28 -0000 1.5
+++ gfx.h 1 Aug 2004 11:48:53 -0000 1.6
@@ -28,6 +28,49 @@
namespace Saga {
+struct R_CLIPINFO {
+ // input members
+ const R_RECT *src_rect;
+ const R_RECT *dst_rect;
+ const R_POINT *dst_pt;
+
+ // output members
+ int nodraw;
+ int src_draw_x;
+ int src_draw_y;
+ int dst_draw_x;
+ int dst_draw_y;
+ int draw_w;
+ int draw_h;
+};
+
+struct PALENTRY {
+ byte red;
+ byte green;
+ byte blue;
+};
+
+struct R_COLOR {
+ int red;
+ int green;
+ int blue;
+ int alpha;
+};
+
+struct R_SURFACE {
+ byte *buf;
+ int buf_w;
+ int buf_h;
+ int buf_pitch;
+ R_RECT clip_rect;
+};
+
+#define R_PAL_ENTRIES 256
+
+#define R_RGB_RED 0x00FF0000UL
+#define R_RGB_GREEN 0x0000FF00UL
+#define R_RGB_BLUE 0x000000FFUL
+
#define R_CURSOR_W 7
#define R_CURSOR_H 7
@@ -47,7 +90,32 @@
int black_index;
};
-void GFX_SetCursor(int best_white);
+class Gfx {
+public:
+ int simpleBlit(R_SURFACE *dst_s, R_SURFACE *src_s);
+ int drawPalette(R_SURFACE *dst_s);
+ int bufToSurface(R_SURFACE *ds, const byte *src, int src_w, int src_h, R_RECT *src_rect, R_POINT *dst_pt);
+ int bufToBuffer(byte * dst_buf, int dst_w, int dst_h, const byte *src,
+ int src_w, int src_h, R_RECT *src_rect, R_POINT *dst_pt);
+ int drawRect(R_SURFACE *ds, R_RECT *dst_rect, int color);
+ int drawFrame(R_SURFACE *ds, R_POINT *p1, R_POINT *p2, int color);
+ int drawPolyLine(R_SURFACE *ds, R_POINT *pts, int pt_ct, int draw_color);
+ int getClipInfo(R_CLIPINFO *clipinfo);
+ int clipLine(R_SURFACE *ds, const R_POINT *src_p1, const R_POINT *src_p2, R_POINT *dst_p1, R_POINT *dst_p2);
+ void drawLine(R_SURFACE * ds, R_POINT *p1, R_POINT *p2, int color);
+
+ Gfx(OSystem *system, int width, int height);
+ R_SURFACE *getBackBuffer();
+ int getWhite();
+ int getBlack();
+ int matchColor(unsigned long colormask);
+ int setPalette(R_SURFACE *surface, PALENTRY *pal);
+ int getCurrentPal(PALENTRY *src_pal);
+ int palToBlack(R_SURFACE *surface, PALENTRY *src_pal, double percent);
+ int blackToPal(R_SURFACE *surface, PALENTRY *src_pal, double percent);
+private:
+ void setCursor(int best_white);
+};
} // End of namespace Saga
Index: ihnm_introproc.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/ihnm_introproc.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- ihnm_introproc.cpp 1 Aug 2004 01:56:21 -0000 1.9
+++ ihnm_introproc.cpp 1 Aug 2004 11:48:53 -0000 1.10
@@ -25,7 +25,7 @@
#include "saga.h"
#include "yslib.h"
-#include "gfx_mod.h"
+#include "gfx.h"
#include "animation.h"
#include "cvar_mod.h"
@@ -139,7 +139,7 @@
case SCENE_BEGIN:
// Fade to black out of the intro CyberDreams logo anim
- GFX_GetCurrentPal(current_pal);
+ _vm->_gfx->getCurrentPal(current_pal);
event.type = R_CONTINUOUS_EVENT;
event.code = R_PAL_EVENT;
@@ -199,7 +199,7 @@
switch (param) {
case SCENE_BEGIN:
// Fade to black out of the intro DG logo anim
- GFX_GetCurrentPal(current_pal);
+ _vm->_gfx->getCurrentPal(current_pal);
event.type = R_CONTINUOUS_EVENT;
event.code = R_PAL_EVENT;
Index: input.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/input.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- input.cpp 1 Aug 2004 01:56:21 -0000 1.5
+++ input.cpp 1 Aug 2004 11:48:53 -0000 1.6
@@ -22,7 +22,7 @@
*/
#include "saga/saga.h"
-#include "saga/gfx_mod.h"
+#include "saga/gfx.h"
#include "saga/actor_mod.h"
#include "saga/console_mod.h"
#include "saga/interface_mod.h"
Index: interface.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/interface.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- interface.cpp 1 Aug 2004 01:56:21 -0000 1.11
+++ interface.cpp 1 Aug 2004 11:48:53 -0000 1.12
@@ -24,7 +24,7 @@
// Game interface module
#include "saga.h"
-#include "gfx_mod.h"
+#include "gfx.h"
#include "game_mod.h"
#include "cvar_mod.h"
#include "actor_mod.h"
@@ -250,7 +250,7 @@
R_RECT rect;
R_POINT origin;
- back_buf = GFX_GetBackBuffer();
+ back_buf = _vm->_gfx->getBackBuffer();
if (!IfModule.active) {
return R_SUCCESS;
@@ -266,7 +266,7 @@
rect.right = g_di.logical_w - 1;
rect.bottom = IfModule.i_desc.status_y;
- GFX_DrawRect(back_buf, &rect, IfModule.i_desc.status_bgcol);
+ _vm->_gfx->drawRect(back_buf, &rect, IfModule.i_desc.status_bgcol);
// Draw command panel background
if (IfModule.panel_mode == PANEL_COMMAND) {
@@ -276,7 +276,7 @@
origin.x = 0;
origin.y = g_di.logical_h - IfModule.c_panel.img_h;
- GFX_BufToSurface(back_buf, IfModule.c_panel.img, IfModule.c_panel.img_w,
+ _vm->_gfx->bufToSurface(back_buf, IfModule.c_panel.img, IfModule.c_panel.img_w,
IfModule.c_panel.img_h, NULL, &origin);
} else {
xbase = IfModule.d_panel.x;
@@ -285,7 +285,7 @@
origin.x = 0;
origin.y = g_di.logical_h - IfModule.c_panel.img_h;
- GFX_BufToSurface(back_buf, IfModule.d_panel.img, IfModule.d_panel.img_w,
+ _vm->_gfx->bufToSurface(back_buf, IfModule.d_panel.img, IfModule.d_panel.img_w,
IfModule.d_panel.img_h, NULL, &origin);
}
@@ -314,7 +314,7 @@
imouse_x = imouse_pt->x;
imouse_y = imouse_pt->y;
- back_buf = GFX_GetBackBuffer();
+ back_buf = _vm->_gfx->getBackBuffer();
// Get game display info
GAME_GetDisplayInfo(&g_di);
@@ -356,7 +356,7 @@
rect.right = g_di.logical_w - 1;
rect.bottom = IfModule.i_desc.status_y + IfModule.i_desc.status_h - 1;
- GFX_DrawRect(ds, &rect, IfModule.i_desc.status_bgcol);
+ _vm->_gfx->drawRect(ds, &rect, IfModule.i_desc.status_bgcol);
string_w = FONT_GetStringWidth(SMALL_FONT_ID, IfModule.status_txt, 0, 0);
Index: isomap.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/isomap.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- isomap.cpp 1 Aug 2004 10:02:41 -0000 1.9
+++ isomap.cpp 1 Aug 2004 11:48:53 -0000 1.10
@@ -25,7 +25,7 @@
#include "saga.h"
#include "game_mod.h"
-#include "gfx_mod.h"
+#include "gfx.h"
#include "isomap_mod.h"
#include "isomap.h"
@@ -138,7 +138,7 @@
R_GAME_DISPLAYINFO disp_info;
GAME_GetDisplayInfo(&disp_info);
R_RECT iso_rect(disp_info.logical_w - 1, disp_info.scene_h - 1);
- GFX_DrawRect(dst_s, &iso_rect, 0);
+ _vm->_gfx->drawRect(dst_s, &iso_rect, 0);
ISOMAP_DrawMetamap(dst_s, -1000, -500);
return R_SUCCESS;
Index: ite_introproc.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/ite_introproc.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- ite_introproc.cpp 1 Aug 2004 09:15:12 -0000 1.13
+++ ite_introproc.cpp 1 Aug 2004 11:48:53 -0000 1.14
@@ -25,7 +25,7 @@
// Intro sequence scene procedures
#include "saga.h"
-#include "gfx_mod.h"
+#include "gfx.h"
#include "yslib.h"
#include "animation.h"
@@ -240,7 +240,7 @@
switch (param) {
case SCENE_BEGIN:
// Fade to black out of the intro DG/NWC logo animation
- GFX_GetCurrentPal(current_pal);
+ _vm->_gfx->getCurrentPal(current_pal);
event.type = R_CONTINUOUS_EVENT;
event.code = R_PAL_EVENT;
event.op = EVENT_PALTOBLACK;
Index: objectmap.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/objectmap.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- objectmap.cpp 1 Aug 2004 01:56:21 -0000 1.11
+++ objectmap.cpp 1 Aug 2004 11:48:53 -0000 1.12
@@ -28,7 +28,7 @@
// p. 24-46, code: p. 34-45
#include "saga.h"
-#include "gfx_mod.h"
+#include "gfx.h"
#include "cvar_mod.h"
#include "console_mod.h"
#include "font_mod.h"
@@ -291,7 +291,7 @@
return R_FAILURE;
}
-// Uses GFX_DrawLine to display all clickareas for each object in the
+// Uses Gfx::drawLine to display all clickareas for each object in the
// currently loaded object map resource.
int OBJECTMAP_Draw(R_SURFACE *ds, R_POINT *imouse_pt, int color, int color2) {
R_OBJECTMAP_ENTRY *object_map;
@@ -338,16 +338,17 @@
pointcount = 0;
if (clickarea->n_points == 2) {
// 2 points represent a box
- GFX_DrawFrame(ds, &clickarea->points[0], &clickarea->points[1], draw_color);
+ _vm->_gfx->drawFrame(ds, &clickarea->points[0], &clickarea->points[1], draw_color);
} else if (clickarea->n_points > 2) {
// Otherwise draw a polyline
- GFX_DrawPolyLine(ds, clickarea->points, clickarea->n_points, draw_color);
+ _vm->_gfx->drawPolyLine(ds, clickarea->points, clickarea->n_points, draw_color);
}
}
}
if (draw_txt) {
- FONT_Draw(SMALL_FONT_ID, ds, txt_buf, 0, 2, 2, GFX_GetWhite(), GFX_GetBlack(), FONT_OUTLINE);
+ FONT_Draw(SMALL_FONT_ID, ds, txt_buf, 0, 2, 2,
+ _vm->_gfx->getWhite(), _vm->_gfx->getBlack(), FONT_OUTLINE);
}
return R_SUCCESS;
Index: palanim.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/palanim.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- palanim.cpp 1 Aug 2004 01:56:21 -0000 1.9
+++ palanim.cpp 1 Aug 2004 11:48:53 -0000 1.10
@@ -23,7 +23,7 @@
// Palette animation module
#include "saga.h"
-#include "gfx_mod.h"
+#include "gfx.h"
#include "events_mod.h"
#include "game_mod.h"
@@ -146,8 +146,8 @@
return R_FAILURE;
}
- GFX_GetCurrentPal(pal);
- back_buf = GFX_GetBackBuffer();
+ _vm->_gfx->getCurrentPal(pal);
+ back_buf = _vm->_gfx->getBackBuffer();
for (i = 0; i < PAnimData.entry_count; i++) {
cycle = PAnimData.entries[i].cycle;
@@ -167,7 +167,7 @@
}
}
- GFX_SetPalette(back_buf, pal);
+ _vm->_gfx->setPalette(back_buf, pal);
event.type = R_ONESHOT_EVENT;
event.code = R_PALANIM_EVENT;
Index: render.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/render.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- render.cpp 1 Aug 2004 07:56:08 -0000 1.18
+++ render.cpp 1 Aug 2004 11:48:53 -0000 1.19
@@ -24,7 +24,7 @@
// Main rendering loop
#include "saga.h"
-#include "gfx_mod.h"
+#include "gfx.h"
#include "timer.h"
#include "actor_mod.h"
#include "console_mod.h"
@@ -56,9 +56,8 @@
// Initialize system graphics
GAME_GetDisplayInfo(&disp_info);
- if (GFX_Init(system, disp_info.logical_w, disp_info.logical_h) != R_SUCCESS) {
- return;
- }
+ _vm->_gfx = new Gfx(system, disp_info.logical_w, disp_info.logical_h);
+ _gfx = _vm->_gfx;
// Initialize FPS timer callback
g_timer->installTimerProc(&fpsTimerCallback, 1000000, this);
@@ -87,7 +86,7 @@
_tmp_buf_w = tmp_w;
_tmp_buf_h = tmp_h;
- _backbuf_surface = GFX_GetBackBuffer();
+ _backbuf_surface = _gfx->getBackBuffer();
_flags = 0;
_initialized = true;
@@ -135,8 +134,8 @@
// Display scene maps, if applicable
if (getFlags() & RF_OBJECTMAP_TEST) {
- OBJECTMAP_Draw(backbuf_surface, &mouse_pt, GFX_GetWhite(), GFX_GetBlack());
- _vm->_actionMap->draw(backbuf_surface, GFX_MatchColor(R_RGB_RED));
+ OBJECTMAP_Draw(backbuf_surface, &mouse_pt, _gfx->getWhite(), _gfx->getBlack());
+ _vm->_actionMap->draw(backbuf_surface, _gfx->matchColor(R_RGB_RED));
}
// Draw queued actors
@@ -155,7 +154,7 @@
sprintf(txt_buf, "%d", _fps);
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,
- GFX_GetWhite(), GFX_GetBlack(), FONT_OUTLINE);
+ _gfx->getWhite(), _gfx->getBlack(), FONT_OUTLINE);
}
// Display "paused game" message, if applicable
@@ -163,7 +162,7 @@
int msg_len = strlen(R_PAUSEGAME_MSG);
int msg_w = FONT_GetStringWidth(BIG_FONT_ID, R_PAUSEGAME_MSG, msg_len, FONT_OUTLINE);
FONT_Draw(BIG_FONT_ID, backbuf_surface, R_PAUSEGAME_MSG, msg_len,
- (backbuf_surface->buf_w - msg_w) / 2, 90, GFX_GetWhite(), GFX_GetBlack(), FONT_OUTLINE);
+ (backbuf_surface->buf_w - msg_w) / 2, 90, _gfx->getWhite(), _gfx->getBlack(), FONT_OUTLINE);
}
// Update user interface
@@ -173,12 +172,12 @@
// Display text formatting test, if applicable
if (_flags & RF_TEXT_TEST) {
TEXT_Draw(MEDIUM_FONT_ID, backbuf_surface, test_txt, mouse_pt.x, mouse_pt.y,
- GFX_GetWhite(), GFX_GetBlack(), FONT_OUTLINE | FONT_CENTERED);
+ _gfx->getWhite(), _gfx->getBlack(), FONT_OUTLINE | FONT_CENTERED);
}
// Display palette test, if applicable
if (_flags & RF_PALETTE_TEST) {
- GFX_DrawPalette(backbuf_surface);
+ _gfx->drawPalette(backbuf_surface);
}
// Draw console
Index: render.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/render.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- render.h 1 Aug 2004 00:03:45 -0000 1.10
+++ render.h 1 Aug 2004 11:48:53 -0000 1.11
@@ -70,6 +70,7 @@
SagaEngine *_vm;
OSystem *_system;
bool _initialized;
+ Gfx *_gfx;
// Module data
R_SURFACE *_backbuf_surface;
Index: saga.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saga.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- saga.h 1 Aug 2004 01:56:21 -0000 1.19
+++ saga.h 1 Aug 2004 11:48:53 -0000 1.20
@@ -43,6 +43,7 @@
class Anim;
class Render;
class ActionMap;
+class Gfx;
using Common::MemoryReadStream;
@@ -91,6 +92,7 @@
Anim *_anim;
Render *_render;
ActionMap *_actionMap;
+ Gfx *_gfx;
private:
int decodeBGImageRLE(const byte *inbuf, size_t inbuf_len, byte *outbuf, size_t outbuf_len);
Index: scene.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/scene.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- scene.cpp 1 Aug 2004 09:15:12 -0000 1.17
+++ scene.cpp 1 Aug 2004 11:48:53 -0000 1.18
@@ -25,7 +25,7 @@
#include "saga.h"
#include "yslib.h"
-#include "gfx_mod.h"
+#include "gfx.h"
#include "game_mod.h"
#include "animation.h"
#include "console_mod.h"
@@ -731,7 +731,7 @@
switch (SceneModule.scene_mode) {
case R_SCENE_MODE_NORMAL:
- GFX_BufToSurface(dst_s, buf_info.r_bg_buf, disp_info.logical_w,
+ _vm->_gfx->bufToSurface(dst_s, buf_info.r_bg_buf, disp_info.logical_w,
MAX(disp_info.scene_h, SceneModule.bg.h), NULL, &bg_pt);
break;
case R_SCENE_MODE_ISO:
@@ -855,7 +855,7 @@
_vm->_sound->stopVoice();
// Fade palette to black from intro scene
- GFX_GetCurrentPal(current_pal);
+ _vm->_gfx->getCurrentPal(current_pal);
event.type = R_CONTINUOUS_EVENT;
event.code = R_PAL_EVENT;
Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/script.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- script.cpp 1 Aug 2004 01:56:22 -0000 1.10
+++ script.cpp 1 Aug 2004 11:48:53 -0000 1.11
@@ -25,7 +25,7 @@
#include "saga.h"
#include "yslib.h"
-#include "gfx_mod.h"
+#include "gfx.h"
#include "rscfile_mod.h"
#include "game_mod.h"
#include "text_mod.h"
Index: sdata.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sdata.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- sdata.cpp 1 Aug 2004 01:56:22 -0000 1.7
+++ sdata.cpp 1 Aug 2004 11:48:53 -0000 1.8
@@ -23,7 +23,7 @@
// Type SDataWord_T must be unpadded
#include "saga.h"
-#include "gfx_mod.h"
+#include "gfx.h"
#include "text_mod.h"
#include "script_mod.h"
#include "script.h"
Index: sdebug.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sdebug.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- sdebug.cpp 1 Aug 2004 01:56:22 -0000 1.5
+++ sdebug.cpp 1 Aug 2004 11:48:53 -0000 1.6
@@ -24,7 +24,7 @@
// Scripting module simple thread debugging support
#include "saga.h"
-#include "gfx_mod.h"
+#include "gfx.h"
#include "actor_mod.h"
#include "console_mod.h"
#include "text_mod.h"
Index: sfuncs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sfuncs.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- sfuncs.cpp 1 Aug 2004 01:56:22 -0000 1.7
+++ sfuncs.cpp 1 Aug 2004 11:48:53 -0000 1.8
@@ -25,7 +25,7 @@
#include "saga.h"
-#include "gfx_mod.h"
+#include "gfx.h"
#include "actor_mod.h"
#include "animation.h"
#include "console_mod.h"
Index: sprite.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sprite.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- sprite.cpp 1 Aug 2004 01:56:22 -0000 1.10
+++ sprite.cpp 1 Aug 2004 11:48:53 -0000 1.11
@@ -25,7 +25,7 @@
#include "saga.h"
#include "game_mod.h"
-#include "gfx_mod.h"
+#include "gfx.h"
#include "scene_mod.h"
#include "rscfile_mod.h"
@@ -360,7 +360,7 @@
ci.src_rect = &spr_src_rect;
ci.dst_pt = &spr_pt;
- GFX_GetClipInfo(&ci);
+ _vm->_gfx->getClipInfo(&ci);
if (ci.nodraw) {
return R_SUCCESS;
Index: sstack.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sstack.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- sstack.cpp 1 Aug 2004 01:56:22 -0000 1.4
+++ sstack.cpp 1 Aug 2004 11:48:53 -0000 1.5
@@ -25,7 +25,7 @@
#include "saga.h"
-#include "gfx_mod.h"
+#include "gfx.h"
#include "console_mod.h"
#include "text_mod.h"
Index: sthread.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sthread.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- sthread.cpp 1 Aug 2004 01:56:22 -0000 1.10
+++ sthread.cpp 1 Aug 2004 11:48:53 -0000 1.11
@@ -26,7 +26,7 @@
#include "yslib.h"
-#include "gfx_mod.h"
+#include "gfx.h"
#include "actor_mod.h"
#include "console_mod.h"
#include "text_mod.h"
Index: text.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/text.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- text.cpp 1 Aug 2004 01:56:22 -0000 1.3
+++ text.cpp 1 Aug 2004 11:48:53 -0000 1.4
@@ -26,7 +26,7 @@
#include "saga.h"
#include "yslib.h"
-#include "gfx_mod.h"
+#include "gfx.h"
#include "font_mod.h"
#include "text_mod.h"
--- gfx_mod.h DELETED ---
More information about the Scummvm-git-logs
mailing list