aboutsummaryrefslogtreecommitdiff
path: root/saga
diff options
context:
space:
mode:
authorEugene Sandulenko2004-08-03 00:40:16 +0000
committerEugene Sandulenko2004-08-03 00:40:16 +0000
commit415400f24e4041298ebd2b084f8fa4a32ea4e7c7 (patch)
treee6d08ba20f959c57dcd2276828f77be0684a4ac9 /saga
parentfe1ab79beeec83d156572c12a8f3e1cb874d7d7d (diff)
downloadscummvm-rg350-415400f24e4041298ebd2b084f8fa4a32ea4e7c7.tar.gz
scummvm-rg350-415400f24e4041298ebd2b084f8fa4a32ea4e7c7.tar.bz2
scummvm-rg350-415400f24e4041298ebd2b084f8fa4a32ea4e7c7.zip
Move TEXT_* to SagaEngine class.
svn-id: r14450
Diffstat (limited to 'saga')
-rw-r--r--saga/actor.cpp4
-rw-r--r--saga/events.cpp6
-rw-r--r--saga/gfx.h3
-rw-r--r--saga/ihnm_introproc.cpp1
-rw-r--r--saga/ite_introproc.cpp16
-rw-r--r--saga/render.cpp6
-rw-r--r--saga/saga.cpp1
-rw-r--r--saga/saga.h19
-rw-r--r--saga/scene.cpp6
-rw-r--r--saga/scene_mod.h2
-rw-r--r--saga/script.cpp1
-rw-r--r--saga/script.h2
-rw-r--r--saga/sdata.cpp1
-rw-r--r--saga/sdebug.cpp8
-rw-r--r--saga/sfuncs.cpp1
-rw-r--r--saga/sprite.cpp4
-rw-r--r--saga/sstack.cpp1
-rw-r--r--saga/sthread.cpp1
-rw-r--r--saga/text.cpp35
-rw-r--r--saga/text.h24
-rw-r--r--saga/text_mod.h66
21 files changed, 87 insertions, 121 deletions
diff --git a/saga/actor.cpp b/saga/actor.cpp
index cd343a7a31..beffeff7a0 100644
--- a/saga/actor.cpp
+++ b/saga/actor.cpp
@@ -33,7 +33,7 @@
#include "saga/sndres.h"
#include "saga/sprite_mod.h"
#include "saga/font.h"
-#include "saga/text_mod.h"
+#include "saga/text.h"
#include "saga/sound.h"
#include "saga/actor.h"
@@ -239,7 +239,7 @@ int Actor::drawList() {
diag_x = actor->s_pt.x;
diag_y = actor->s_pt.y;
diag_y -= ACTOR_DIALOGUE_HEIGHT;
- TEXT_Draw(MEDIUM_FONT_ID, back_buf, a_dialogue->d_string, diag_x, diag_y, actor->a_dcolor, 0,
+ _vm->textDraw(MEDIUM_FONT_ID, back_buf, a_dialogue->d_string, diag_x, diag_y, actor->a_dcolor, 0,
FONT_OUTLINE | FONT_CENTERED);
}
}
diff --git a/saga/events.cpp b/saga/events.cpp
index ad01f7c1cd..47957fd2aa 100644
--- a/saga/events.cpp
+++ b/saga/events.cpp
@@ -33,7 +33,7 @@
#include "saga/console_mod.h"
#include "saga/scene_mod.h"
#include "saga/interface_mod.h"
-#include "saga/text_mod.h"
+#include "saga/text.h"
#include "saga/palanim_mod.h"
#include "saga/render.h"
#include "saga/game_mod.h"
@@ -221,13 +221,13 @@ static int HandleOneShot(R_EVENT *event) {
case R_TEXT_EVENT:
switch (event->op) {
case EVENT_DISPLAY:
- TEXT_SetDisplay((R_TEXTLIST_ENTRY *)event->data, 1);
+ _vm->textSetDisplay((R_TEXTLIST_ENTRY *)event->data, 1);
break;
case EVENT_REMOVE:
{
R_SCENE_INFO scene_info;
SCENE_GetInfo(&scene_info);
- TEXT_DeleteEntry(scene_info.text_list, (R_TEXTLIST_ENTRY *)event->data);
+ _vm->textDeleteEntry(scene_info.text_list, (R_TEXTLIST_ENTRY *)event->data);
}
break;
default:
diff --git a/saga/gfx.h b/saga/gfx.h
index 10330dbb09..f4399a2000 100644
--- a/saga/gfx.h
+++ b/saga/gfx.h
@@ -28,6 +28,9 @@
namespace Saga {
+typedef Common::Point R_POINT;
+typedef Common::Rect R_RECT;
+
struct R_CLIPINFO {
// input members
const R_RECT *src_rect;
diff --git a/saga/ihnm_introproc.cpp b/saga/ihnm_introproc.cpp
index a1c215cf00..a630de0b02 100644
--- a/saga/ihnm_introproc.cpp
+++ b/saga/ihnm_introproc.cpp
@@ -32,7 +32,6 @@
#include "saga/events_mod.h"
#include "saga/rscfile_mod.h"
#include "saga/scene_mod.h"
-#include "saga/text_mod.h"
#include "saga/palanim_mod.h"
#include "saga/scene.h"
diff --git a/saga/ite_introproc.cpp b/saga/ite_introproc.cpp
index a74daac7e8..22b1351106 100644
--- a/saga/ite_introproc.cpp
+++ b/saga/ite_introproc.cpp
@@ -36,7 +36,7 @@
#include "saga/rscfile_mod.h"
#include "saga/scene_mod.h"
#include "saga/sndres.h"
-#include "saga/text_mod.h"
+#include "saga/text.h"
#include "saga/palanim_mod.h"
#include "saga/music.h"
@@ -286,7 +286,7 @@ int ITE_IntroCave1Proc(int param, R_SCENE_INFO *scene_info) {
for (i = INTRO_CAVE1_START; i < INTRO_CAVE1_END; i++) {
text_entry.string = IntroDiag[i].i_str;
- entry_p = TEXT_AddEntry(scene_info->text_list, &text_entry);
+ entry_p = _vm->textAddEntry(scene_info->text_list, &text_entry);
// Display text
event.type = R_ONESHOT_EVENT;
@@ -383,7 +383,7 @@ int ITE_IntroCave2Proc(int param, R_SCENE_INFO *scene_info) {
for (i = INTRO_CAVE2_START; i < INTRO_CAVE2_END; i++) {
text_entry.string = IntroDiag[i].i_str;
- entry_p = TEXT_AddEntry(scene_info->text_list, &text_entry);
+ entry_p = _vm->textAddEntry(scene_info->text_list, &text_entry);
// Display text
event.type = R_ONESHOT_EVENT;
@@ -479,7 +479,7 @@ int ITE_IntroCave3Proc(int param, R_SCENE_INFO *scene_info) {
for (i = INTRO_CAVE3_START; i < INTRO_CAVE3_END; i++) {
text_entry.string = IntroDiag[i].i_str;
- entry_p = TEXT_AddEntry(scene_info->text_list, &text_entry);
+ entry_p = _vm->textAddEntry(scene_info->text_list, &text_entry);
// Display text
event.type = R_ONESHOT_EVENT;
@@ -576,7 +576,7 @@ int ITE_IntroCave4Proc(int param, R_SCENE_INFO *scene_info) {
for (i = INTRO_CAVE4_START; i < INTRO_CAVE4_END; i++) {
text_entry.string = IntroDiag[i].i_str;
- entry_p = TEXT_AddEntry(scene_info->text_list, &text_entry);
+ entry_p = _vm->textAddEntry(scene_info->text_list, &text_entry);
// Display text
event.type = R_ONESHOT_EVENT;
@@ -698,7 +698,7 @@ int ITE_IntroValleyProc(int param, R_SCENE_INFO *scene_info) {
text_entry.text_x = credits[i].text_x;
text_entry.text_y = credits[i].text_y;
- entry_p = TEXT_AddEntry(scene_info->text_list, &text_entry);
+ entry_p = _vm->textAddEntry(scene_info->text_list, &text_entry);
// Display text
event.type = R_ONESHOT_EVENT;
@@ -804,7 +804,7 @@ int ITE_IntroTreeHouseProc(int param, R_SCENE_INFO *scene_info) {
text_entry.text_x = credits[i].text_x;
text_entry.text_y = credits[i].text_y;
- entry_p = TEXT_AddEntry(scene_info->text_list, &text_entry);
+ entry_p = _vm->textAddEntry(scene_info->text_list, &text_entry);
// Display text
event.type = R_ONESHOT_EVENT;
@@ -913,7 +913,7 @@ int ITE_IntroFairePathProc(int param, R_SCENE_INFO *scene_info) {
text_entry.text_x = credits[i].text_x;
text_entry.text_y = credits[i].text_y;
- entry_p = TEXT_AddEntry(scene_info->text_list, &text_entry);
+ entry_p = _vm->textAddEntry(scene_info->text_list, &text_entry);
// Display text
event.type = R_ONESHOT_EVENT;
diff --git a/saga/render.cpp b/saga/render.cpp
index a47c9ab73e..cf1edfae53 100644
--- a/saga/render.cpp
+++ b/saga/render.cpp
@@ -33,7 +33,7 @@
#include "saga/interface_mod.h"
#include "saga/scene_mod.h"
#include "saga/sprite_mod.h"
-#include "saga/text_mod.h"
+#include "saga/text.h"
#include "saga/actionmap.h"
#include "saga/objectmap.h"
@@ -147,7 +147,7 @@ int Render::drawScene() {
// Draw queued text strings
SCENE_GetInfo(&scene_info);
- TEXT_DrawList(scene_info.text_list, backbuf_surface);
+ _vm->textDrawList(scene_info.text_list, backbuf_surface);
// Handle user input
SYSINPUT_ProcessInput();
@@ -174,7 +174,7 @@ int Render::drawScene() {
// 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,
+ _vm->textDraw(MEDIUM_FONT_ID, backbuf_surface, test_txt, mouse_pt.x, mouse_pt.y,
_gfx->getWhite(), _gfx->getBlack(), FONT_OUTLINE | FONT_CENTERED);
}
diff --git a/saga/saga.cpp b/saga/saga.cpp
index 6599e97d9b..528d290770 100644
--- a/saga/saga.cpp
+++ b/saga/saga.cpp
@@ -52,7 +52,6 @@
#include "saga/sdata.h"
#include "saga/sndres.h"
#include "saga/sprite_mod.h"
-#include "saga/text_mod.h"
#include "saga/objectmap.h"
#include "saga/sound.h"
#include "saga/music.h"
diff --git a/saga/saga.h b/saga/saga.h
index 79ba70ef9d..1f0c8a107b 100644
--- a/saga/saga.h
+++ b/saga/saga.h
@@ -35,6 +35,9 @@
#include <limits.h>
#include <stddef.h>
+#include "saga/text.h"
+#include "saga/gfx.h"
+
namespace Saga {
class SndRes;
@@ -59,9 +62,6 @@ using Common::MemoryReadStream;
struct R_RSCFILE_CONTEXT;
struct R_SEMAPHORE;
-typedef Common::Point R_POINT;
-typedef Common::Rect R_RECT;
-
enum R_ERRORCODE {
R_MEM = -2,
R_FAILURE = -1,
@@ -116,6 +116,19 @@ public:
int decodeBGImage(const byte *image_data, size_t image_size,
byte **output_buf, size_t *output_buf_len, int *w, int *h);
const byte *getImagePal(const byte *image_data, size_t image_size);
+
+public:
+ R_TEXTLIST *textCreateList();
+ void textDestroyList(R_TEXTLIST *textlist);
+ void textClearList(R_TEXTLIST *textlist);
+ int textDrawList(R_TEXTLIST *textlist, R_SURFACE *ds);
+ R_TEXTLIST_ENTRY *textAddEntry(R_TEXTLIST *textlist, R_TEXTLIST_ENTRY *entry);
+ int textDeleteEntry(R_TEXTLIST *textlist, R_TEXTLIST_ENTRY *entry);
+ int textSetDisplay(R_TEXTLIST_ENTRY *entry, int val);
+ int textDraw(int font_id, R_SURFACE *ds, const char *string, int text_x, int text_y, int color,
+ int effect_color, int flags);
+ int textProcessList(R_TEXTLIST *textlist, long ms);
+
};
// FIXME: Global var. We use it until everything will be turned into objects
diff --git a/saga/scene.cpp b/saga/scene.cpp
index 4ec3d0ed5c..4f52096e19 100644
--- a/saga/scene.cpp
+++ b/saga/scene.cpp
@@ -39,7 +39,7 @@
#include "saga/render.h"
#include "saga/rscfile_mod.h"
#include "saga/script.h"
-#include "saga/text_mod.h"
+#include "saga/text.h"
#include "saga/sound.h"
#include "saga/music.h"
@@ -114,7 +114,7 @@ int SCENE_Init() {
debug(0, "SCENE_Init(): LUT has %d entries.", SceneModule.scene_max);
// Create scene module text list
- SceneModule.text_list = TEXT_CreateList();
+ SceneModule.text_list = _vm->textCreateList();
if (SceneModule.text_list == NULL) {
warning("Error: Couldn't create scene text list");
@@ -797,7 +797,7 @@ int SCENE_End() {
SceneModule.anim_entries = 0;
EVENT_ClearList();
- TEXT_ClearList(SceneModule.text_list);
+ _vm->textClearList(SceneModule.text_list);
SceneModule.scene_loaded = 0;
diff --git a/saga/scene_mod.h b/saga/scene_mod.h
index 0428e9d8be..0f4e46a62c 100644
--- a/saga/scene_mod.h
+++ b/saga/scene_mod.h
@@ -26,7 +26,7 @@
#ifndef SAGA_SCENE_MOD_H__
#define SAGA_SCENE_MOD_H__
-#include "saga/text_mod.h"
+#include "saga/text.h"
namespace Saga {
diff --git a/saga/script.cpp b/saga/script.cpp
index 88d78b4b89..6a0a744ef2 100644
--- a/saga/script.cpp
+++ b/saga/script.cpp
@@ -28,7 +28,6 @@
#include "saga/gfx.h"
#include "saga/rscfile_mod.h"
#include "saga/game_mod.h"
-#include "saga/text_mod.h"
#include "saga/console_mod.h"
#include "saga/cvar_mod.h"
diff --git a/saga/script.h b/saga/script.h
index 4478547d56..883ba872dd 100644
--- a/saga/script.h
+++ b/saga/script.h
@@ -28,7 +28,7 @@
#include "saga/sstack.h"
#include "saga/sdata.h"
-#include "saga/text_mod.h"
+#include "saga/text.h"
#include "saga/yslib.h"
namespace Saga {
diff --git a/saga/sdata.cpp b/saga/sdata.cpp
index 76e746de5f..c316208582 100644
--- a/saga/sdata.cpp
+++ b/saga/sdata.cpp
@@ -24,7 +24,6 @@
#include "saga/saga.h"
#include "saga/gfx.h"
-#include "saga/text_mod.h"
#include "saga/script_mod.h"
#include "saga/script.h"
#include "saga/sdata.h"
diff --git a/saga/sdebug.cpp b/saga/sdebug.cpp
index 1d3d6f3ef7..1995dafbbf 100644
--- a/saga/sdebug.cpp
+++ b/saga/sdebug.cpp
@@ -26,7 +26,7 @@
#include "saga/gfx.h"
#include "saga/console_mod.h"
-#include "saga/text_mod.h"
+#include "saga/text.h"
#include "saga/scene_mod.h"
#include "saga/font.h"
@@ -53,7 +53,7 @@ int SDEBUG_PrintInstr(R_SCRIPT_THREAD *thread) {
disp_buf[0] = 0;
if (_vm->_script->_dbg_txtentry != NULL) {
- TEXT_DeleteEntry(si.text_list, _vm->_script->_dbg_txtentry);
+ _vm->textDeleteEntry(si.text_list, _vm->_script->_dbg_txtentry);
_vm->_script->_dbg_txtentry = NULL;
}
@@ -514,8 +514,8 @@ int SDEBUG_PrintInstr(R_SCRIPT_THREAD *thread) {
break;
}
- _vm->_script->_dbg_txtentry = TEXT_AddEntry(si.text_list, &tl_e);
- TEXT_SetDisplay(_vm->_script->_dbg_txtentry, 1);
+ _vm->_script->_dbg_txtentry = _vm->textAddEntry(si.text_list, &tl_e);
+ _vm->textSetDisplay(_vm->_script->_dbg_txtentry, 1);
return R_SUCCESS;
}
diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp
index 4f26c74dfa..08f1db0caa 100644
--- a/saga/sfuncs.cpp
+++ b/saga/sfuncs.cpp
@@ -30,7 +30,6 @@
#include "saga/animation.h"
#include "saga/console_mod.h"
#include "saga/interface_mod.h"
-#include "saga/text_mod.h"
#include "saga/script.h"
#include "saga/sfuncs.h"
diff --git a/saga/sprite.cpp b/saga/sprite.cpp
index a003625238..696949f64d 100644
--- a/saga/sprite.cpp
+++ b/saga/sprite.cpp
@@ -29,7 +29,7 @@
#include "saga/scene_mod.h"
#include "saga/rscfile_mod.h"
-#include "saga/text_mod.h"
+#include "saga/text.h"
#include "saga/font.h"
#include "saga/sprite_mod.h"
@@ -398,7 +398,7 @@ int SPRITE_DrawOccluded(R_SURFACE *ds, R_SPRITELIST *sprite_list, int sprite_num
char buf[1024] = { 0 };
sprintf( buf, "dw: %d, dh: %d.", ci.draw_w, ci.draw_h );
- TEXT_Draw(2, ds, buf, spr_x - x_align, spr_y - y_align, 255, 0, FONT_OUTLINE);
+ _vm->textDraw(2, ds, buf, spr_x - x_align, spr_y - y_align, 255, 0, FONT_OUTLINE);
}
*/
return R_SUCCESS;
diff --git a/saga/sstack.cpp b/saga/sstack.cpp
index 4bba740473..adadd87c41 100644
--- a/saga/sstack.cpp
+++ b/saga/sstack.cpp
@@ -27,7 +27,6 @@
#include "saga/gfx.h"
#include "saga/console_mod.h"
-#include "saga/text_mod.h"
#include "saga/script.h"
#include "saga/sstack.h"
diff --git a/saga/sthread.cpp b/saga/sthread.cpp
index 5837b88e6f..faf20092ef 100644
--- a/saga/sthread.cpp
+++ b/saga/sthread.cpp
@@ -28,7 +28,6 @@
#include "saga/gfx.h"
#include "saga/actor.h"
#include "saga/console_mod.h"
-#include "saga/text_mod.h"
#include "saga/script.h"
#include "saga/script_mod.h"
diff --git a/saga/text.cpp b/saga/text.cpp
index ae9db954b1..f218ec98bd 100644
--- a/saga/text.cpp
+++ b/saga/text.cpp
@@ -29,12 +29,11 @@
#include "saga/gfx.h"
#include "saga/font.h"
-#include "saga/text_mod.h"
#include "saga/text.h"
namespace Saga {
-int TEXT_Draw(int font_id, R_SURFACE *ds, const char *string, int text_x, int text_y, int color,
+int SagaEngine::textDraw(int font_id, R_SURFACE *ds, const char *string, int text_x, int text_y, int color,
int effect_color, int flags) {
int string_w;
int string_len;
@@ -69,7 +68,7 @@ int TEXT_Draw(int font_id, R_SURFACE *ds, const char *string, int text_x, int te
return R_FAILURE;
}
- string_w = _vm->_font->getStringWidth(font_id, string, string_len, flags);
+ string_w = _font->getStringWidth(font_id, string, string_len, flags);
if (text_x < (ds->buf_w / 2)) {
// Fit to right side
@@ -82,12 +81,12 @@ int TEXT_Draw(int font_id, R_SURFACE *ds, const char *string, int text_x, int te
if (fit_w >= string_w) {
// Entire string fits, draw it
text_x = text_x - (string_w / 2);
- _vm->_font->draw(font_id, ds, string, string_len, text_x, text_y, color, effect_color, flags);
+ _font->draw(font_id, ds, string, string_len, text_x, text_y, color, effect_color, flags);
return R_SUCCESS;
}
// String won't fit on one line
- h = _vm->_font->getHeight(font_id);
+ h = _font->getHeight(font_id);
w_total = 0;
len_total = 0;
wc = 0;
@@ -106,7 +105,7 @@ int TEXT_Draw(int font_id, R_SURFACE *ds, const char *string, int text_x, int te
len = found_p - measure_p;
}
- w = _vm->_font->getStringWidth(font_id, measure_p, len, flags);
+ w = _font->getStringWidth(font_id, measure_p, len, flags);
measure_p = found_p;
if ((w_total + w) > fit_w) {
@@ -117,7 +116,7 @@ int TEXT_Draw(int font_id, R_SURFACE *ds, const char *string, int text_x, int te
}
// Wrap what we've got and restart
- _vm->_font->draw(font_id, ds, start_p, len_total, text_x - (w_total / 2), text_y, color,
+ _font->draw(font_id, ds, start_p, len_total, text_x - (w_total / 2), text_y, color,
effect_color, flags);
text_y += h + R_TEXT_LINESPACING;
w_total = 0;
@@ -132,7 +131,7 @@ int TEXT_Draw(int font_id, R_SURFACE *ds, const char *string, int text_x, int te
wc++;
if (found_p == NULL) {
// Since word hit NULL but fit, we are done
- _vm->_font->draw(font_id, ds, start_p, len_total, text_x - (w_total / 2), text_y, color,
+ _font->draw(font_id, ds, start_p, len_total, text_x - (w_total / 2), text_y, color,
effect_color, flags);
return R_SUCCESS;
}
@@ -141,13 +140,13 @@ int TEXT_Draw(int font_id, R_SURFACE *ds, const char *string, int text_x, int te
}
} else {
// Text is not centered; No formatting required
- _vm->_font->draw(font_id, ds, string, string_len, text_x, text_y, color, effect_color, flags);
+ _font->draw(font_id, ds, string, string_len, text_x, text_y, color, effect_color, flags);
}
return R_SUCCESS;
}
-R_TEXTLIST *TEXT_CreateList() {
+R_TEXTLIST *SagaEngine::textCreateList() {
R_TEXTLIST *new_textlist;
new_textlist = (R_TEXTLIST *)malloc(sizeof *new_textlist);
@@ -166,7 +165,7 @@ R_TEXTLIST *TEXT_CreateList() {
return new_textlist;
}
-void TEXT_ClearList(R_TEXTLIST *tlist) {
+void SagaEngine::textClearList(R_TEXTLIST *tlist) {
if (tlist != NULL) {
ys_dll_delete_all(tlist->list);
}
@@ -174,7 +173,7 @@ void TEXT_ClearList(R_TEXTLIST *tlist) {
return;
}
-void TEXT_DestroyList(R_TEXTLIST *tlist) {
+void SagaEngine::textDestroyList(R_TEXTLIST *tlist) {
if (tlist != NULL) {
ys_dll_destroy(tlist->list);
}
@@ -183,7 +182,7 @@ void TEXT_DestroyList(R_TEXTLIST *tlist) {
return;
}
-int TEXT_DrawList(R_TEXTLIST *textlist, R_SURFACE *ds) {
+int SagaEngine::textDrawList(R_TEXTLIST *textlist, R_SURFACE *ds) {
R_TEXTLIST_ENTRY *entry_p;
YS_DL_NODE *walk_p;
@@ -192,7 +191,7 @@ int TEXT_DrawList(R_TEXTLIST *textlist, R_SURFACE *ds) {
for (walk_p = ys_dll_head(textlist->list); walk_p != NULL; walk_p = ys_dll_next(walk_p)) {
entry_p = (R_TEXTLIST_ENTRY *)ys_dll_get_data(walk_p);
if (entry_p->display != 0) {
- TEXT_Draw(entry_p->font_id, ds, entry_p->string, entry_p->text_x, entry_p->text_y, entry_p->color,
+ textDraw(entry_p->font_id, ds, entry_p->string, entry_p->text_x, entry_p->text_y, entry_p->color,
entry_p->effect_color, entry_p->flags);
}
}
@@ -200,7 +199,7 @@ int TEXT_DrawList(R_TEXTLIST *textlist, R_SURFACE *ds) {
return R_SUCCESS;
}
-int TEXT_ProcessList(R_TEXTLIST *textlist, long ms) {
+int SagaEngine::textProcessList(R_TEXTLIST *textlist, long ms) {
R_TEXTLIST_ENTRY *entry_p;
YS_DL_NODE *walk_p;
YS_DL_NODE *temp_p;
@@ -220,7 +219,7 @@ int TEXT_ProcessList(R_TEXTLIST *textlist, long ms) {
}
-R_TEXTLIST_ENTRY *TEXT_AddEntry(R_TEXTLIST *textlist, R_TEXTLIST_ENTRY *entry) {
+R_TEXTLIST_ENTRY *SagaEngine::textAddEntry(R_TEXTLIST *textlist, R_TEXTLIST_ENTRY *entry) {
YS_DL_NODE *new_node = NULL;
if (entry != NULL) {
@@ -230,7 +229,7 @@ R_TEXTLIST_ENTRY *TEXT_AddEntry(R_TEXTLIST *textlist, R_TEXTLIST_ENTRY *entry) {
return (new_node != NULL) ? (R_TEXTLIST_ENTRY *)new_node->data : NULL;
}
-int TEXT_SetDisplay(R_TEXTLIST_ENTRY *entry, int val) {
+int SagaEngine::textSetDisplay(R_TEXTLIST_ENTRY *entry, int val) {
if (entry != NULL) {
entry->display = !!val;
return R_SUCCESS;
@@ -239,7 +238,7 @@ int TEXT_SetDisplay(R_TEXTLIST_ENTRY *entry, int val) {
return R_FAILURE;
}
-int TEXT_DeleteEntry(R_TEXTLIST *textlist, R_TEXTLIST_ENTRY *entry) {
+int SagaEngine::textDeleteEntry(R_TEXTLIST *textlist, R_TEXTLIST_ENTRY *entry) {
YS_DL_NODE *walk_p;
if (entry == NULL) {
diff --git a/saga/text.h b/saga/text.h
index ddd33fa358..668403fa5f 100644
--- a/saga/text.h
+++ b/saga/text.h
@@ -26,6 +26,8 @@
#ifndef SAGA_TEXT_H__
#define SAGA_TEXT_H__
+#include "saga/yslib.h"
+
namespace Saga {
#define R_TEXT_CENTERLIMIT 50
@@ -36,5 +38,27 @@ struct R_TEXTLIST_tag {
YS_DL_LIST *list;
};
+enum R_TEXT_FLAGS {
+ TEXT_TIMEOUT = 0x01
+};
+
+struct R_TEXTLIST_ENTRY {
+ struct R_TEXTLIST_ENTRY_tag *next;
+ struct R_TEXTLIST_ENTRY_tag *prev;
+ int display;
+ int id;
+ int text_x;
+ int text_y;
+ int color;
+ int effect_color;
+ int flags;
+ int font_id;
+ long time;
+ const char *string;
+ R_TEXTLIST_ENTRY() { memset(this, 0, sizeof(*this)); }
+};
+
+typedef struct R_TEXTLIST_tag R_TEXTLIST;
+
} // End of namespace Saga
#endif
diff --git a/saga/text_mod.h b/saga/text_mod.h
deleted file mode 100644
index 1e54d3c8ba..0000000000
--- a/saga/text_mod.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2004 The ScummVM project
- *
- * The ReInherit Engine is (C)2000-2003 by Daniel Balsom.
- *
- * 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$
- *
- */
-
-// Text / dialogue display management module public header
-
-#ifndef SAGA_TEXT_MOD_H_
-#define SAGA_TEXT_MOD_H_
-
-namespace Saga {
-
-enum R_TEXT_FLAGS {
- TEXT_TIMEOUT = 0x01
-};
-
-struct R_TEXTLIST_ENTRY {
- struct R_TEXTLIST_ENTRY_tag *next;
- struct R_TEXTLIST_ENTRY_tag *prev;
- int display;
- int id;
- int text_x;
- int text_y;
- int color;
- int effect_color;
- int flags;
- int font_id;
- long time;
- const char *string;
- R_TEXTLIST_ENTRY() { memset(this, 0, sizeof(*this)); }
-};
-
-typedef struct R_TEXTLIST_tag R_TEXTLIST;
-
-R_TEXTLIST *TEXT_CreateList();
-void TEXT_DestroyList(R_TEXTLIST *textlist);
-void TEXT_ClearList(R_TEXTLIST *textlist);
-int TEXT_DrawList(R_TEXTLIST *textlist, R_SURFACE *ds);
-R_TEXTLIST_ENTRY *TEXT_AddEntry(R_TEXTLIST *textlist, R_TEXTLIST_ENTRY *entry);
-int TEXT_DeleteEntry(R_TEXTLIST *textlist, R_TEXTLIST_ENTRY *entry);
-int TEXT_SetDisplay(R_TEXTLIST_ENTRY *entry, int val);
-int TEXT_Draw(int font_id, R_SURFACE *ds, const char *string, int text_x, int text_y, int color,
- int effect_color, int flags);
-int TEXT_ProcessList(R_TEXTLIST *textlist, long ms);
-
-} // End of namespace Saga
-
-#endif