From 9ae54838b94e4505ec095b8c6de9b17299069816 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 27 Apr 2004 11:22:13 +0000 Subject: cleanup svn-id: r13652 --- saga/module.mk | 3 +- saga/reinherit.h | 24 ---------------- saga/render.cpp | 2 ++ saga/saga.cpp | 2 ++ saga/sys_fs.cpp | 82 ------------------------------------------------------- saga/systimer.cpp | 26 +++++++++++++++++- saga/systimer.h | 28 ++++++------------- 7 files changed, 39 insertions(+), 128 deletions(-) delete mode 100644 saga/sys_fs.cpp diff --git a/saga/module.mk b/saga/module.mk index fc6f7d3dbf..2857f15fe6 100644 --- a/saga/module.mk +++ b/saga/module.mk @@ -47,8 +47,7 @@ MODULE_OBJS = \ saga/systimer.o \ saga/sysmusic.o \ saga/syssound.o \ - saga/sysio.o \ - saga/sys_fs.o + saga/sysio.o MODULE_DIRS += \ saga diff --git a/saga/reinherit.h b/saga/reinherit.h index 2790da77f4..851a650393 100644 --- a/saga/reinherit.h +++ b/saga/reinherit.h @@ -184,14 +184,6 @@ int TRANSITION_Dissolve(uchar * dst_img, int SYSIO_Init(void); int SYSIO_Shutdown(void); -/* - * System : Filesystem -\*--------------------------------------------------------------------------*/ - -int SYSFS_GetFileLen(FILE * file_p, ulong * len); -int SYSFS_GetFQFN(const char *f_dir, - const char *f_name, char *buf, size_t buf_len); - /* * System : Sound \*--------------------------------------------------------------------------*/ @@ -265,22 +257,6 @@ int SYSGFX_PalToBlack(R_SURFACE * surface, PALENTRY * src_pal, double percent); int SYSGFX_BlackToPal(R_SURFACE * surface, PALENTRY * src_pal, double percent); -/* - * System : Timer -\*--------------------------------------------------------------------------*/ -typedef struct R_SYSTIMER_tag R_SYSTIMER; - -typedef void (*R_SYSTIMER_CALLBACK) (unsigned long, void *); - -int SYSTIMER_InitMSCounter(void); -unsigned long SYSTIMER_ReadMSCounter(void); - -int SYSTIMER_ResetMSCounter(void); -int SYSTIMER_Sleep(uint msec); -int SYSTIMER_CreateTimer(R_SYSTIMER **, - unsigned long, void *, R_SYSTIMER_CALLBACK); -int SYSTIMER_DestroyTimer(R_SYSTIMER *); - /* * System : Input \*--------------------------------------------------------------------------*/ diff --git a/saga/render.cpp b/saga/render.cpp index 70afb0245b..ba0f3e5c7f 100644 --- a/saga/render.cpp +++ b/saga/render.cpp @@ -30,6 +30,8 @@ #include "reinherit.h" +#include "systimer.h" + #include "yslib.h" #include diff --git a/saga/saga.cpp b/saga/saga.cpp index d52ea1ae38..78252619b0 100644 --- a/saga/saga.cpp +++ b/saga/saga.cpp @@ -34,6 +34,8 @@ #include "reinherit.h" +#include "systimer.h" + #include "rscfile_mod.h" #include "render_mod.h" #include "actor_mod.h" diff --git a/saga/sys_fs.cpp b/saga/sys_fs.cpp deleted file mode 100644 index 4fd26c5356..0000000000 --- a/saga/sys_fs.cpp +++ /dev/null @@ -1,82 +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$ - * - */ -#include "reinherit.h" - -namespace Saga { - -int -SYSFS_GetFQFN(const char *f_dir, const char *f_name, char *buf, size_t buf_len) -{ - size_t f_dir_len; - size_t f_name_len; - char sep_buf[2] = { R_DIRECTORY_SEP }; - - size_t i; - - if ((f_dir == NULL) || (f_name == NULL) || (buf == NULL)) { - - return R_FAILURE; - } - - f_dir_len = strlen(f_dir); - f_name_len = strlen(f_name); - - buf[0] = 0; - - strncat(buf, f_dir, buf_len); - -#if R_DIRECTORY_SEP != '/' - /* Convert frontslashes to backslashes */ - for (i = 0; i < f_dir_len; i++) { - if (buf[i] == '/') { - buf[i] = R_DIRECTORY_SEP; - } - } -#endif - - for (i = f_dir_len - 1; i > 0; i--) { - - /* Remove any trailing whitespace */ - if (isspace(buf[i])) { - buf[i] = 0; - } else { - break; - } - } - - f_dir_len = strlen(buf); - - if (buf[f_dir_len - 1] != R_DIRECTORY_SEP) { - - /* Append a proper directory separator if req. */ - strncat(buf, sep_buf, buf_len); - } - - strncat(buf, f_name, buf_len); - - return R_SUCCESS; -} - -} // End of namespace Saga - - diff --git a/saga/systimer.cpp b/saga/systimer.cpp index dd76f43849..0b0a86cdb3 100644 --- a/saga/systimer.cpp +++ b/saga/systimer.cpp @@ -31,7 +31,31 @@ namespace Saga { -R_SYSTIMER_DATA R_TimerData; +struct R_SYSTIMER { + + int t_running; + + unsigned long t_interval; + void *t_param; + + R_SYSTIMER_CALLBACK t_callback_f; + SDL_TimerID t_sdl_timerid; +}; + +struct R_SYSTIMER_DATA { + + int initialized; + + Uint32 t_start_ticks; + + Uint32 t_current_ticks; + Uint32 t_previous_ticks; + +}; + +static R_SYSTIMER_DATA R_TimerData; + +static Uint32 SYSTIMER_Callback(Uint32 interval, void *param); int SYSTIMER_InitMSCounter(void) { diff --git a/saga/systimer.h b/saga/systimer.h index d4fd81cdc1..5a759518b3 100644 --- a/saga/systimer.h +++ b/saga/systimer.h @@ -25,29 +25,19 @@ namespace Saga { -struct R_SYSTIMER_DATA { +typedef void (*R_SYSTIMER_CALLBACK) (unsigned long, void *); - int initialized; +struct R_SYSTIMER; - Uint32 t_start_ticks; +int SYSTIMER_InitMSCounter(void); +unsigned long SYSTIMER_ReadMSCounter(void); - Uint32 t_current_ticks; - Uint32 t_previous_ticks; +int SYSTIMER_ResetMSCounter(void); +int SYSTIMER_Sleep(uint msec); +int SYSTIMER_CreateTimer(R_SYSTIMER **, + unsigned long, void *, R_SYSTIMER_CALLBACK); +int SYSTIMER_DestroyTimer(R_SYSTIMER *); -}; - -struct R_SYSTIMER_tag { - - int t_running; - - unsigned long t_interval; - void *t_param; - - R_SYSTIMER_CALLBACK t_callback_f; - SDL_TimerID t_sdl_timerid; -}; - -Uint32 SYSTIMER_Callback(Uint32 interval, void *param); } // End of namespace Saga -- cgit v1.2.3