aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2004-08-11 14:04:12 +0000
committerEugene Sandulenko2004-08-11 14:04:12 +0000
commit23d5d1fb8235ced4e29bb0b771ba6aa972a46ad1 (patch)
tree5f8e75f8849ae8549230af5bb84bb5782c402df8
parentc41b0ad99ae1beb9c2f769a226b339c198d41102 (diff)
downloadscummvm-rg350-23d5d1fb8235ced4e29bb0b771ba6aa972a46ad1.tar.gz
scummvm-rg350-23d5d1fb8235ced4e29bb0b771ba6aa972a46ad1.tar.bz2
scummvm-rg350-23d5d1fb8235ced4e29bb0b771ba6aa972a46ad1.zip
Move SYSINPUT_* and TRANSITION_* to SagaEngine class
svn-id: r14555
-rw-r--r--saga/events.cpp12
-rw-r--r--saga/input.cpp7
-rw-r--r--saga/render.cpp4
-rw-r--r--saga/saga.h16
-rw-r--r--saga/transitions.cpp2
5 files changed, 20 insertions, 21 deletions
diff --git a/saga/events.cpp b/saga/events.cpp
index 9b4338c95c..9e8815b898 100644
--- a/saga/events.cpp
+++ b/saga/events.cpp
@@ -173,9 +173,9 @@ int Events::handleContinuous(R_EVENT *event) {
case EVENT_DISSOLVE:
_vm->_render->getBufferInfo(&buf_info);
_vm->_scene->getBGInfo(&bg_info);
- TRANSITION_Dissolve(buf_info.r_bg_buf, buf_info.r_bg_buf_w, buf_info.r_bg_buf_h,
- buf_info.r_bg_buf_w, bg_info.bg_buf, bg_info.bg_w,
- bg_info.bg_h, bg_info.bg_p, 0, 0, 0, event_pc);
+ _vm->transitionDissolve(buf_info.r_bg_buf, buf_info.r_bg_buf_w,
+ buf_info.r_bg_buf_h, buf_info.r_bg_buf_w, bg_info.bg_buf, bg_info.bg_w,
+ bg_info.bg_h, bg_info.bg_p, 0, 0, 0, event_pc);
break;
case EVENT_DISSOLVE_BGMASK:
// we dissolve it centered.
@@ -186,9 +186,9 @@ int Events::handleContinuous(R_EVENT *event) {
_vm->_render->getBufferInfo(&buf_info);
_vm->_scene->getBGMaskInfo(&w, &h, &mask_buf, &len);
- TRANSITION_Dissolve(buf_info.r_bg_buf, buf_info.r_bg_buf_w, buf_info.r_bg_buf_h,
- buf_info.r_bg_buf_w, mask_buf, w, h, 0, 1, (320 - w) / 2,
- (200 - h) / 2, event_pc);
+ _vm->transitionDissolve(buf_info.r_bg_buf, buf_info.r_bg_buf_w,
+ buf_info.r_bg_buf_h, buf_info.r_bg_buf_w, mask_buf, w, h, 0, 1,
+ (320 - w) / 2, (200 - h) / 2, event_pc);
break;
default:
break;
diff --git a/saga/input.cpp b/saga/input.cpp
index 9b71e97e6f..9a4188849d 100644
--- a/saga/input.cpp
+++ b/saga/input.cpp
@@ -28,13 +28,10 @@
#include "saga/interface.h"
#include "saga/render.h"
#include "saga/scene.h"
-#include "saga/script_mod.h"
namespace Saga {
-static R_POINT _mousePos;
-
-int SYSINPUT_ProcessInput() {
+int SagaEngine::processInput() {
OSystem::Event event;
R_POINT imouse_pt;
@@ -131,7 +128,7 @@ int SYSINPUT_ProcessInput() {
return R_SUCCESS;
}
-R_POINT SYSINPUT_GetMousePos() {
+R_POINT SagaEngine::getMousePos() {
return _mousePos;
}
diff --git a/saga/render.cpp b/saga/render.cpp
index c9558fed9f..0193a2642b 100644
--- a/saga/render.cpp
+++ b/saga/render.cpp
@@ -124,7 +124,7 @@ int Render::drawScene() {
backbuf_surface = _backbuf_surface;
// Get mouse coordinates
- mouse_pt = SYSINPUT_GetMousePos();
+ mouse_pt = _vm->getMousePos();
_vm->_scene->getBGInfo(&bg_info);
GAME_GetDisplayInfo(&disp_info);
@@ -149,7 +149,7 @@ int Render::drawScene() {
_vm->textDrawList(scene_info.text_list, backbuf_surface);
// Handle user input
- SYSINPUT_ProcessInput();
+ _vm->processInput();
// Display rendering information
if (_flags & RF_SHOW_FPS) {
diff --git a/saga/saga.h b/saga/saga.h
index 35c33ca637..0db43dcca8 100644
--- a/saga/saga.h
+++ b/saga/saga.h
@@ -80,13 +80,6 @@ enum SAGAGameId {
GID_IHNM
};
-int TRANSITION_Dissolve(byte *dst_img, int dst_w, int dst_h, int dst_p, const byte *src_img,
- int src_w, int src_h, int src_p, int flags, int x, int y,
- double percent);
-
-int SYSINPUT_ProcessInput(void);
-R_POINT SYSINPUT_GetMousePos();
-
class SagaEngine : public Engine {
void errorString(const char *buf_input, char *buf_output);
@@ -145,6 +138,15 @@ public:
int effect_color, int flags);
int textProcessList(R_TEXTLIST *textlist, long ms);
+ int transitionDissolve(byte *dst_img, int dst_w, int dst_h, int dst_p,
+ const byte *src_img, int src_w, int src_h, int src_p, int flags, int x, int y,
+ double percent);
+
+ int processInput(void);
+ R_POINT getMousePos();
+
+ private:
+ R_POINT _mousePos;
};
// FIXME: Global var. We use it until everything will be turned into objects
diff --git a/saga/transitions.cpp b/saga/transitions.cpp
index c366e1289d..28cc7f6932 100644
--- a/saga/transitions.cpp
+++ b/saga/transitions.cpp
@@ -30,7 +30,7 @@ namespace Saga {
@param flag if set to 1, do zero masking
*/
-int TRANSITION_Dissolve(byte *dst_img, int dst_w, int dst_h, int dst_p, const byte *src_img,
+int SagaEngine::transitionDissolve(byte *dst_img, int dst_w, int dst_h, int dst_p, const byte *src_img,
int src_w, int src_h, int src_p, int flags, int x, int y,
double percent) {
#define XOR_MASK 0xB400;