aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/game.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2009-02-26 23:03:35 +0000
committerFilippos Karapetis2009-02-26 23:03:35 +0000
commit6c879e96d122aa4746276d94a46d339595c9f0d4 (patch)
tree48dcfcdb1f094e9f4abe54eae86d6c410b3b7dbd /engines/sci/engine/game.cpp
parent2d1fd81f90ca0583d1e28b57926079cec3d6c48c (diff)
downloadscummvm-rg350-6c879e96d122aa4746276d94a46d339595c9f0d4.tar.gz
scummvm-rg350-6c879e96d122aa4746276d94a46d339595c9f0d4.tar.bz2
scummvm-rg350-6c879e96d122aa4746276d94a46d339595c9f0d4.zip
- Removed engine/sys_strings.*
- Renamed sys_string_t -> SystemString, sys_strings_t -> SystemStrings svn-id: r38916
Diffstat (limited to 'engines/sci/engine/game.cpp')
-rw-r--r--engines/sci/engine/game.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp
index 03fbb74266..337f20f09f 100644
--- a/engines/sci/engine/game.cpp
+++ b/engines/sci/engine/game.cpp
@@ -633,7 +633,11 @@ int script_init_engine(EngineState *s, sci_version_t version) {
s->sys_strings = s->seg_manager->allocateSysStrings(&s->sys_strings_segment);
// Allocate static buffer for savegame and CWD directories
- sys_string_acquire(s->sys_strings, SYS_STRING_SAVEDIR, "savedir", MAX_SAVE_DIR_SIZE);
+ SystemString *str = &s->sys_strings->strings[SYS_STRING_SAVEDIR];
+ str->name = strdup("savedir");
+ str->max_size = MAX_SAVE_DIR_SIZE;
+ str->value = (char*)sci_malloc(MAX_SAVE_DIR_SIZE + 1);
+ str->value[0] = 0; // Set to empty string
s->save_dir_copy = make_reg(s->sys_strings_segment, SYS_STRING_SAVEDIR);
s->save_dir_edit_offset = 0;
@@ -677,7 +681,9 @@ int script_init_engine(EngineState *s, sci_version_t version) {
}
void script_set_gamestate_save_dir(EngineState *s, const char *path) {
- sys_string_set(s->sys_strings, SYS_STRING_SAVEDIR, path);
+ SystemString *str = &s->sys_strings->strings[SYS_STRING_SAVEDIR];
+ strncpy(str->value, path, str->max_size);
+ str->value[str->max_size] = 0; // Make sure to terminate
}
void script_free_vm_memory(EngineState *s) {
@@ -759,7 +765,12 @@ int game_init(EngineState *s) {
s->status_bar_foreground = 0;
s->status_bar_background = s->resmgr->sci_version >= SCI_VERSION_01_VGA ? 255 : 15;
- sys_string_acquire(s->sys_strings, SYS_STRING_PARSER_BASE, "parser-base", MAX_PARSER_BASE);
+ SystemString *str = &s->sys_strings->strings[SYS_STRING_PARSER_BASE];
+ str->name = strdup("parser-base");
+ str->max_size = MAX_PARSER_BASE;
+ str->value = (char*)sci_malloc(MAX_PARSER_BASE + 1);
+ str->value[0] = 0; // Set to empty string
+
s->parser_base = make_reg(s->sys_strings_segment, SYS_STRING_PARSER_BASE);
s->game_start_time = g_system->getMillis();