aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Rolfi2002-03-09 13:48:02 +0000
committerEnrico Rolfi2002-03-09 13:48:02 +0000
commitf6fac2385a5f1c4a382936e1b654c1077b45a244 (patch)
tree253b5e2d375b2e7e6e01aa631802b548e844c088
parent23ef65091b8d807244ce9c5541493c45ac61e7ad (diff)
downloadscummvm-rg350-f6fac2385a5f1c4a382936e1b654c1077b45a244.tar.gz
scummvm-rg350-f6fac2385a5f1c4a382936e1b654c1077b45a244.tar.bz2
scummvm-rg350-f6fac2385a5f1c4a382936e1b654c1077b45a244.zip
Added the config file support for the MacOS classic port. Inserted an atexit call so now the cursor is re-enabled on quit.
svn-id: r3712
-rw-r--r--sdl.cpp41
1 files changed, 40 insertions, 1 deletions
diff --git a/sdl.cpp b/sdl.cpp
index b73f7bb9e4..d47bda2124 100644
--- a/sdl.cpp
+++ b/sdl.cpp
@@ -41,6 +41,10 @@ static SDL_CD *cdrom;
static int current_shake_pos;
+void resetCursor(void) {
+ SDL_ShowCursor(SDL_ENABLE);
+}
+
void updateScreen(Scumm *s);
void updatePalette(Scumm *s) {
@@ -113,7 +117,7 @@ void waitForTimer(Scumm *s, int msec_delay) {
warning("Full screen failed");
}
- #if defined(__APPLE__)
+ #if defined(__APPLE__) || defined(MACOS)
if (event.key.keysym.sym=='q' && event.key.keysym.mod&KMOD_LMETA) {
exit(1);
}
@@ -622,6 +626,7 @@ void initGraphics(Scumm *s, bool fullScreen, unsigned int scaleFactor) {
/* Clean up on exit */
atexit(SDL_Quit);
+ atexit(resetCursor);
char buf[512], *gameName;
@@ -690,6 +695,40 @@ void initGraphics(Scumm *s, bool fullScreen, unsigned int scaleFactor) {
int main(int argc, char* argv[]) {
int delta;
int last_time, new_time;
+
+#if defined(MACOS)
+ /* support for config file on macos */
+
+ char *argitem;
+ char *argstr;
+ FILE *argf;
+
+ if (( argf = fopen("configuration.macos", "r")) == NULL) {
+ error("Can't open configuration file.\n");
+ exit(1);
+ }
+
+ argc=0;
+ argstr = (char *) malloc(64);
+ argstr = fgets(argstr, 64, argf);
+ if ((argitem = strchr(argstr, '\n'))!=NULL)
+ *argitem = '\0';
+
+ argitem = strtok(argstr, " ");
+
+ while (argitem!=NULL) {
+ argv = (char**) realloc(argv, (argc+1)*8);
+ argv[argc] = (char *) malloc(64);
+ strcpy(argv[argc], argitem);
+ argc++;
+
+ argitem = strtok(NULL, " ");
+ }
+
+ free(argstr);
+ fclose(argf);
+
+#endif
sound.initialize(&scumm, &snd_driv);