aboutsummaryrefslogtreecommitdiff
path: root/saga
diff options
context:
space:
mode:
authorPaweł Kołodziejski2004-10-28 06:55:50 +0000
committerPaweł Kołodziejski2004-10-28 06:55:50 +0000
commit1d6de6f5e4eee21f888956dae7cc7a568f2264d4 (patch)
treed1578f22041636308ebe21a70151f257ea38c9eb /saga
parent7aa3cded0854a9bb59f27248ac99a90142f44dca (diff)
downloadscummvm-rg350-1d6de6f5e4eee21f888956dae7cc7a568f2264d4.tar.gz
scummvm-rg350-1d6de6f5e4eee21f888956dae7cc7a568f2264d4.tar.bz2
scummvm-rg350-1d6de6f5e4eee21f888956dae7cc7a568f2264d4.zip
replaced printf usage in saga
svn-id: r15693
Diffstat (limited to 'saga')
-rw-r--r--saga/cvar.cpp18
-rw-r--r--saga/sdebug.cpp9
-rw-r--r--saga/sthread.cpp16
3 files changed, 20 insertions, 23 deletions
diff --git a/saga/cvar.cpp b/saga/cvar.cpp
index 8856a018b3..d4793209f2 100644
--- a/saga/cvar.cpp
+++ b/saga/cvar.cpp
@@ -226,7 +226,7 @@ int CVAR_SetValue(CVAR_P cvar, char *value) {
*(cvar->t.i.var_p) = (cv_int_t) int_param;
#ifdef CVAR_TRACE
- printf("Set cvar to value %ld.\n", int_param);
+ debug(2, "Set cvar to value %ld.\n", int_param);
#endif
break;
@@ -274,7 +274,7 @@ int CVAR_SetValue(CVAR_P cvar, char *value) {
*(cvar->t.ui.var_p) = (cv_uint16_t) uint16_param;
#ifdef CVAR_TRACE
- printf("Set cvar to value %lu.\n", uint16_param);
+ debug(2, "Set cvar to value %lu.\n", uint16_param);
#endif
break;
case CVAR_FLOAT:
@@ -291,7 +291,7 @@ int CVAR_SetValue(CVAR_P cvar, char *value) {
cvar->t.s.var_str[cvar->t.s.ubound] = 0;
}
#ifdef CVAR_TRACE
- printf("Set cvar to value \"%s\".\n", cvar->t.s.var_str);
+ debug(2, "Set cvar to value \"%s\".\n", cvar->t.s.var_str);
#endif
break;
default:
@@ -311,7 +311,7 @@ CVAR_P CVAR_Find(const char *var_str) {
hash = CVAR_HashString(var_str);
#ifdef CVAR_TRACE
- printf("Performing lookup on hash bucket %d.\n", hash);
+ debug(2, "Performing lookup on hash bucket %d.\n", hash);
#endif
walk_ptr = CVHashTbl[hash];
while (walk_ptr != NULL) {
@@ -350,7 +350,7 @@ int CVAR_RegisterFunc(cv_func_t func, const char *func_name,
hash = CVAR_HashString(func_name);
#ifdef CVAR_TRACE
- printf("Added FUNC cvar to hash bucket %d.\n", hash);
+ debug(2, "Added FUNC cvar to hash bucket %d.\n", hash);
#endif
return CVAR_Add(hash, &new_cvar);
@@ -373,7 +373,7 @@ int CVAR_Register_I(cv_int_t * var_p, const char *var_name,
hash = CVAR_HashString(var_name);
#ifdef CVAR_TRACE
- printf("Added INT cvar to hash bucket %d.\n", hash);
+ debug(2, "Added INT cvar to hash bucket %d.\n", hash);
#endif
return CVAR_Add(hash, &new_cvar);
@@ -395,7 +395,7 @@ int CVAR_Register_UI(cv_uint16_t * var_p, const char *var_name,
hash = CVAR_HashString(var_name);
#ifdef CVAR_TRACE
- printf("Added UNSIGNED INT ccvar to hash bucket %d.\n", hash);
+ debug(2, "Added UNSIGNED INT ccvar to hash bucket %d.\n", hash);
#endif
return CVAR_Add(hash, &new_cvar);
@@ -417,7 +417,7 @@ int CVAR_Register_F(cv_float_t * var_p, const char *var_name,
hash = CVAR_HashString(var_name);
#ifdef CVAR_TRACE
- printf("Added FLOAT cvar to hash bucket %d.\n", hash);
+ debug(2, "Added FLOAT cvar to hash bucket %d.\n", hash);
#endif
return CVAR_Add(hash, &new_cvar);
@@ -438,7 +438,7 @@ int CVAR_Register_S(cv_char_t * var_str, const char *var_name, const char *secti
hash = CVAR_HashString(var_name);
#ifdef CVAR_TRACE
- printf("Added UNSIGNED INT var to hash bucket %d.\n", hash);
+ debug(2, "Added UNSIGNED INT var to hash bucket %d.\n", hash);
#endif
return CVAR_Add(hash, &new_cvar);
diff --git a/saga/sdebug.cpp b/saga/sdebug.cpp
index 866a9da9f7..2064533758 100644
--- a/saga/sdebug.cpp
+++ b/saga/sdebug.cpp
@@ -104,10 +104,10 @@ int Script::SDebugPrintInstr(SCRIPT_THREAD *thread) {
SD_ADDTXT(tmp_buf);
/*
if(( param >= 0 ) && ( param < diag_list->n_dialogue )) {
- printf(" ; \"%.*s\"", SCRIPT_STRINGLIMIT, diag_list->str[param] );
+ debug(2, " ; \"%.*s\"", SCRIPT_STRINGLIMIT, diag_list->str[param] );
}
else {
- printf(" ; Invalid dialogue string.\n" );
+ debug(2, " ; Invalid dialogue string.\n" );
}
*/
}
@@ -245,7 +245,7 @@ int Script::SDebugPrintInstr(SCRIPT_THREAD *thread) {
/*
for( i = 0 ; i < script_list->n_scripts ; i++ ) {
if( op_offset == script_list->scripts[i].offset ) {
- printf("; Entrypoint \"%s\".", script_list->scriptl_p + script_list->scripts[i].name_offset );
+ debug(2, "; Entrypoint \"%s\".", script_list->scriptl_p + script_list->scripts[i].name_offset );
break;
}
}
@@ -348,10 +348,9 @@ int Script::SDebugPrintInstr(SCRIPT_THREAD *thread) {
sprintf(tmp_buf, "%04X", n_switch2);
SD_ADDTXT(tmp_buf);
for (i = 0; i < n_switch2; i++) {
- //printf("\n");
switch_num = readS.readUint16LE();
switch_jmp = readS.readUint16LE();
- //printf( TAB "WEIGHT %04X, %04X", switch_num, switch_jmp);
+ //debug(2, "WEIGHT %04X, %04X", switch_num, switch_jmp);
}
}
break;
diff --git a/saga/sthread.cpp b/saga/sthread.cpp
index 864b86d351..161f51362d 100644
--- a/saga/sthread.cpp
+++ b/saga/sthread.cpp
@@ -556,25 +556,25 @@ int Script::SThreadRun(SCRIPT_THREAD *thread, int instr_limit) {
break;
case 0x28: // inc_v increment, don't push
unhandled = 1;
- printf("??? ");
+ //debug(2, "??? ");
scriptS.readByte();
scriptS.readUint16LE();
break;
case 0x29: // dec_v decrement, don't push
unhandled = 1;
- printf("??? ");
+ //debug(2, "??? ");
scriptS.readByte();
scriptS.readUint16LE();
break;
case 0x2A: // postinc
unhandled = 1;
- printf("??? ");
+ //debug(2, "??? ");
scriptS.readByte();
scriptS.readUint16LE();
break;
case 0x2B: // postdec
unhandled = 1;
- printf("??? ");
+ //debug(2, "??? ");
scriptS.readByte();
scriptS.readUint16LE();
break;
@@ -793,15 +793,13 @@ int Script::SThreadRun(SCRIPT_THREAD *thread, int instr_limit) {
// (DLGO): Add a dialogue option to interface
case 0x56:
{
- printf("DLGO | ");
+ SDataWord_T param3 = 0;
param1 = scriptS.readByte();
param2 = scriptS.readByte();
- printf("%02X %02X ", param1, param2);
-
if (param2 > 0) {
- SDataWord_T param3 = scriptS.readUint16LE();
- printf("%04X", param3);
+ param3 = scriptS.readUint16LE();
}
+ debug(2, "DLGO | %02X %02X %04X", param1, param2, param3);
}
break;
case 0x57: // animate