aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gameDetector.cpp3
-rw-r--r--gui.cpp1
-rw-r--r--gui.h145
-rw-r--r--resource.cpp4
-rw-r--r--scummvm.dsp12
-rw-r--r--sdl.cpp55
-rw-r--r--simon/midi.cpp6
7 files changed, 64 insertions, 162 deletions
diff --git a/gameDetector.cpp b/gameDetector.cpp
index 089e52bd55..4eb75b06de 100644
--- a/gameDetector.cpp
+++ b/gameDetector.cpp
@@ -330,8 +330,7 @@ int GameDetector::detectMain(int argc, char **argv)
}
if (!_gameDataPath) {
- warning
- ("No path was provided. Assuming that data file are in the current directory");
+ warning("No path was provided. Assuming that data file are in the current directory");
_gameDataPath = (char *)malloc(sizeof(char) * 2);
strcpy(_gameDataPath, "");
}
diff --git a/gui.cpp b/gui.cpp
index 36c7848542..76bd4a4dc9 100644
--- a/gui.cpp
+++ b/gui.cpp
@@ -22,6 +22,7 @@
#include "stdafx.h"
#include "scumm.h"
#include "gui.h"
+#include "guimaps.h"
#ifdef _WIN32_WCE
// Additional variables for Win32 specific GUI
diff --git a/gui.h b/gui.h
index abe93167f5..bbd964c7db 100644
--- a/gui.h
+++ b/gui.h
@@ -1,3 +1,23 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2002 The ScummVM project
+ *
+ * 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$
+ */
+
#if !defined(gui_h)
#define gui_h
@@ -27,100 +47,6 @@ enum {
};
-static const char* string_map_table_custom[] = {
- "Master Volume :", //0
- "Music Volume :", //1
- "SFX Volume :", //2
- "+", //3
- "-", //4
- "Sound", //5
- "Keys", //6
- "About", //7
- "Pocket ScummVM", //8
- "Build " SCUMMVM_VERSION "(" SCUMMVM_CVS ")", //9
- "ScummVM http://scummvm.sourceforge.net", //10
- "All games (c) LucasArts", //11
- "Quit", //12
- "Pause", //13
- "Save", //14
- "Skip", //15
- "Hide", //16
- "Options" //17
-};
-
-static ResString string_map_table_v7[] = {
- {96, "game name and version"}, //that's how it's supposed to be
- {77, "Select a game to LOAD"},
- {76, "Name your SAVE game"},
- {70, "save"}, //boot8
- {71, "load"}, //boot9
- {72, "play"}, //boot10
- {73, "cancel"}, //boot11
- {74, "quit"}, //boot12
- {75, "ok"}, //boot13
- {85, "game paused"}, // boot3
-
- /* this is the almost complete string map for v7
- {63, "how may I serve you?"},
- {64, "the dig v1.0"}, //(game name/version)
- {67, "text display only"},
- {68, "c:\\dig"}, //boot007 (save path ?)
- {69, "the dig"}, //boot21 (game name)
- {70, "save"}, //boot8
- {71, "load"}, //boot9
- {72, "play"}, //boot10
- {73, "cancel"}, //boot11
- {74, "quit"}, //boot12
- {75, "ok"}, //boot13
- {76, "name your save game"}, //boot19
- {77, "select a game to load"}, //boot20
- {78, "you must enter a name"},//boot14
- {79, "saving '%s'"}, //boot17
- {80, "loading '%s'"}, //boot18
- {81, "the game was NOT saved"}, //boot15
- {82, "the game was NOT loaded"}, //boot16
- {83, "how may I serve you?"},
- {84, "how may I serve you?"},
- {85, "game paused"}, // boot3
- {86, "Are you sure you want to restart"},
- {87, "Are you sure you want to quit?"}, //boot05
- {89, "how may I serve you?"},
- {90, "music"}, //boot22
- {91, "voice"}, //boot23
- {92, "sfx"}, //boot24
- {93, "disabled"}, //boot25
- {94, "text speed"}, //boot26
- {95, "text display"}, //boot27
- {96, "the dig v1.0"},*/
-
-};
-
-static ResString string_map_table_v6[] = {
- {117, "How may I serve you?"},
- {109, "Select a game to LOAD"},
- {108, "Name your SAVE game"},
- {96, "Save"},
- {97, "Load"},
- {98, "Play"},
- {99, "Cancel"},
- {100, "Quit"},
- {101, "Ok"},
- {93, "Game paused"},
-};
-
-static ResString string_map_table_v5[] = {
- {0, "How may I serve you?"},
- {20, "Select a game to LOAD"},
- {19, "Name your SAVE game"},
- {7, "Save"},
- {8, "Load"},
- {9, "Play"},
- {10, "Cancel"},
- {11, "Quit"},
- {12, "Ok"},
- {4, "Game paused"}
-};
-
struct GuiWidget {
byte _type;
byte _page;
@@ -199,33 +125,4 @@ public:
void handleKeysDialogCommand(int cmd);
void handleLauncherDialogCommand(int cmd);
};
-
-// Built-in font
-static byte guifont[] = {0,0,99,1,226,8,4,8,6,8,6,0,0,0,0,0,0,0,0,0,0,0,8,2,1,8,0,0,0,0,0,0,0,0,0,0,0,0,4,3,7,8,7,7,8,4,5,5,8,7,4,7,3,8,7,7,7,7,8,7,7,7,7,7,3,4,7,5,7,7,8,7,7,7,7,7,7,7,7,5,7,7,
-7,8,7,7,7,7,7,7,7,7,7,8,7,7,7,5,8,5,8,8,7,7,7,6,7,7,7,7,7,5,6,7,5,8,7,7,7,7,7,7,7,7,7,8,7,7,7,5,3,5,0,8,7,7,7,7,7,7,0,6,7,7,7,5,5,5,7,0,6,8,8,7,7,7,7,7,0,7,7,0,0,
-0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,1,3,6,12,
-24,62,3,0,128,192,96,48,24,124,192,0,0,3,62,24,12,6,3,1,0,192,124,24,48,96,192,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,237,74,72,0,0,0,0,0,128,128,128,0,0,0,0,0,0,0,0,0,0,0,0,0,60,66,153,161,161,153,66,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,96,96,96,96,0,0,96,0,102,102,102,0,0,0,0,0,102,102,255,102,255,102,102,0,24,62,96,60,6,124,24,0,98,102,12,24,48,102,70,0,60,102,60,56,103,102,63,0,96,48,16,0,0,0,0,0,24,48,96,96,96,48,24,0,96,48,24,24,24,48,96,0,
-0,102,60,255,60,102,0,0,0,24,24,126,24,24,0,0,0,0,0,0,0,48,48,96,0,0,0,126,0,0,0,0,0,0,0,0,0,96,96,0,0,3,6,12,24,48,96,0,60,102,102,102,102,102,60,0,24,24,56,24,24,24,126,0,60,102,6,12,48,96,126,0,60,102,6,28,6,102,60,0,6,
-14,30,102,127,6,6,0,126,96,124,6,6,102,60,0,60,102,96,124,102,102,60,0,126,102,12,24,24,24,24,0,60,102,102,60,102,102,60,0,60,102,102,62,6,102,60,0,0,0,96,0,0,96,0,0,0,0,48,0,0,48,48,96,14,24,48,96,48,24,14,0,0,0,120,0,120,0,0,0,112,24,
-12,6,12,24,112,0,60,102,6,12,24,0,24,0,0,0,0,255,255,0,0,0,24,60,102,126,102,102,102,0,124,102,102,124,102,102,124,0,60,102,96,96,96,102,60,0,120,108,102,102,102,108,120,0,126,96,96,120,96,96,126,0,126,96,96,120,96,96,96,0,60,102,96,110,102,102,60,0,102,102,102,
-126,102,102,102,0,120,48,48,48,48,48,120,0,30,12,12,12,12,108,56,0,102,108,120,112,120,108,102,0,96,96,96,96,96,96,126,0,99,119,127,107,99,99,99,0,102,118,126,126,110,102,102,0,60,102,102,102,102,102,60,0,124,102,102,124,96,96,96,0,60,102,102,102,102,60,14,0,124,102,102,124,
-120,108,102,0,60,102,96,60,6,102,60,0,126,24,24,24,24,24,24,0,102,102,102,102,102,102,60,0,102,102,102,102,102,60,24,0,99,99,99,107,127,119,99,0,102,102,60,24,60,102,102,0,102,102,102,60,24,24,24,0,126,6,12,24,48,96,126,0,120,96,96,96,96,96,120,0,3,6,12,24,48,
-96,192,0,120,24,24,24,24,24,120,0,0,0,0,0,0,219,219,0,0,0,0,0,0,0,0,255,102,102,102,0,0,0,0,0,0,0,60,6,62,102,62,0,0,96,96,124,102,102,124,0,0,0,60,96,96,96,60,0,0,6,6,62,102,102,62,0,0,0,60,102,126,96,60,0,0,14,24,62,24,24,
-24,0,0,0,62,102,102,62,6,124,0,96,96,124,102,102,102,0,0,48,0,112,48,48,120,0,0,12,0,12,12,12,12,120,0,96,96,108,120,108,102,0,0,112,48,48,48,48,120,0,0,0,102,127,127,107,99,0,0,0,124,102,102,102,102,0,0,0,60,102,102,102,60,0,0,0,124,102,102,124,96,
-96,0,0,62,102,102,62,6,6,0,0,124,102,96,96,96,0,0,0,62,96,60,6,124,0,0,24,126,24,24,24,14,0,0,0,102,102,102,102,62,0,0,0,102,102,102,60,24,0,0,0,99,107,127,62,54,0,0,0,102,60,24,60,102,0,0,0,102,102,102,62,12,120,0,0,126,12,24,48,126,0,
-24,48,48,96,48,48,24,0,96,96,96,0,96,96,96,0,96,48,48,24,48,48,96,0,0,0,0,0,0,0,0,0,8,12,14,255,255,14,12,8,60,102,96,96,102,60,24,56,102,0,102,102,102,102,62,0,12,24,60,102,126,96,60,0,24,36,60,6,62,102,62,0,102,0,60,6,62,102,62,0,48,
-24,60,6,62,102,62,0,0,0,0,0,0,0,0,0,0,60,96,96,96,60,24,56,24,36,60,102,126,96,60,0,102,0,60,102,126,96,60,0,48,24,60,102,126,96,60,0,0,216,0,112,48,48,120,0,48,72,0,112,48,48,120,0,96,48,0,112,48,48,120,0,102,24,60,102,126,102,102,0,0,0,
-0,0,0,0,0,0,24,48,124,96,120,96,124,0,0,0,108,26,126,216,110,0,30,40,40,126,72,136,142,0,24,36,60,102,102,102,60,0,102,0,60,102,102,102,60,0,48,24,60,102,102,102,60,0,24,36,0,102,102,102,62,0,48,24,102,102,102,102,62,0,0,0,0,0,0,0,0,0,102,60,102,
-102,102,102,60,0,102,0,102,102,102,102,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,24,60,6,62,102,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,28,54,54,124,102,102,124,64,0,0,0};
-
-#endif
+#endif \ No newline at end of file
diff --git a/resource.cpp b/resource.cpp
index 92b37771de..d5b74443da 100644
--- a/resource.cpp
+++ b/resource.cpp
@@ -415,7 +415,7 @@ void Scumm::allocResTypeData(int id, uint32 tag, int num, const char *name,
void Scumm::loadCharset(int no)
{
- int i, line = 0;
+ int i;
byte *ptr;
debug(9, "loadCharset(%d)", no);
@@ -923,7 +923,7 @@ void Scumm::expireResources(uint32 size)
int i, j;
byte flag;
byte best_counter;
- int best_type, best_res;
+ int best_type, best_res = 0;
uint32 oldAllocatedSize;
// return;
diff --git a/scummvm.dsp b/scummvm.dsp
index 1ebfea3245..4339e34d57 100644
--- a/scummvm.dsp
+++ b/scummvm.dsp
@@ -161,10 +161,6 @@ SOURCE=.\simon\midi.cpp
# End Source File
# Begin Source File
-SOURCE=.\sdl.cpp
-# End Source File
-# Begin Source File
-
SOURCE=.\simon\simon.cpp
# End Source File
# Begin Source File
@@ -368,6 +364,10 @@ SOURCE=.\scummvm.cpp
# End Source File
# Begin Source File
+SOURCE=.\sdl.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\sound.cpp
!IF "$(CFG)" == "scummvm - Win32 Release"
@@ -488,6 +488,10 @@ SOURCE=.\gui.h
# End Source File
# Begin Source File
+SOURCE=.\guimaps.h
+# End Source File
+# Begin Source File
+
SOURCE=.\mp3_cd.h
# End Source File
# Begin Source File
diff --git a/sdl.cpp b/sdl.cpp
index b13c0bfb8b..749ce9f456 100644
--- a/sdl.cpp
+++ b/sdl.cpp
@@ -2,7 +2,6 @@
#include "stdafx.h"
#include "scumm.h"
-#include "gui.h"
#include "SDL_thread.h"
#include "gameDetector.h"
@@ -208,40 +207,17 @@ void OSystem_SDL::load_gfx_mode() {
scaling = 1;
_internal_scaling = 1;
_driver_flags = 0;
-
+
+ _sai_func = NULL;
switch(_driver) {
case GFX_2XSAI:
_sai_func = _2xSaI;
- goto def_2xsai_drv;
+ break;
case GFX_SUPER2XSAI:
_sai_func = Super2xSaI;
- goto def_2xsai_drv;
+ break;
case GFX_SUPEREAGLE:
_sai_func = SuperEagle;
- def_2xsai_drv:;
-
- _driver_flags = DF_FORCE_FULL_ON_PALETTE | DF_WANT_RECT_OPTIM | DF_2xSAI | DF_SEPARATE_HWSCREEN;
-
- Init_2xSaI(565);
- sdl_screen = SDL_CreateRGBSurface(SDL_SWSURFACE, 320, 200, 8, 0, 0, 0, 0);
- if (sdl_screen == NULL)
- error("SDL_CreateRGBSurface(SDL_SWSURFACE, 320, 200, 8, 0, 0, 0, 0) failed");
-
- sdl_hwscreen = SDL_SetVideoMode(640, 400, 16, SDL_SWSURFACE);
- if (sdl_hwscreen == NULL)
- error("sdl_hwscreen failed");
-
- {
- /* Need some extra bytes around when using 2XSAI */
- uint16 *tmp_screen = (uint16*)calloc(320*204 + 16,sizeof(uint16));
- sdl_tmpscreen = SDL_CreateRGBSurfaceFrom(tmp_screen + TMP_SCREEN_OFFS, 320, 200, 16,
- 320*2, 0,0,0,0);
- if (sdl_tmpscreen == NULL)
- error("sdl_tmpscreen failed");
- }
-
- dirty_checksums = (uint32*)calloc(CKSUM_NUM*2, sizeof(uint32));
- scaling = 2;
break;
case GFX_DOUBLESIZE:
@@ -268,6 +244,29 @@ void OSystem_SDL::load_gfx_mode() {
error("sdl_screen failed");
break;
}
+
+ if (_sai_func) {
+ uint16 *tmp_screen = (uint16*)calloc(320*204 + 16,sizeof(uint16));
+ _driver_flags = DF_FORCE_FULL_ON_PALETTE | DF_WANT_RECT_OPTIM | DF_2xSAI | DF_SEPARATE_HWSCREEN;
+
+ Init_2xSaI(565);
+ sdl_screen = SDL_CreateRGBSurface(SDL_SWSURFACE, 320, 200, 8, 0, 0, 0, 0);
+ if (sdl_screen == NULL)
+ error("SDL_CreateRGBSurface(SDL_SWSURFACE, 320, 200, 8, 0, 0, 0, 0) failed");
+
+ sdl_hwscreen = SDL_SetVideoMode(640, 400, 16, SDL_SWSURFACE);
+ if (sdl_hwscreen == NULL)
+ error("sdl_hwscreen failed");
+
+ /* Need some extra bytes around when using 2XSAI */
+ sdl_tmpscreen = SDL_CreateRGBSurfaceFrom(tmp_screen + TMP_SCREEN_OFFS, 320, 200, 16,
+ 320*2, 0,0,0,0);
+ if (sdl_tmpscreen == NULL)
+ error("sdl_tmpscreen failed");
+
+ dirty_checksums = (uint32*)calloc(CKSUM_NUM*2, sizeof(uint32));
+ scaling = 2;
+ }
}
void OSystem_SDL::unload_gfx_mode() {
diff --git a/simon/midi.cpp b/simon/midi.cpp
index 79bcb47c8f..ab6923b604 100644
--- a/simon/midi.cpp
+++ b/simon/midi.cpp
@@ -25,7 +25,6 @@
#include "system.h"
#include "simon.h"
-
void MidiPlayer::read_from_file(void *dst, uint size) {
if (fread(dst, size, 1, _input) != 1)
error("Midi read error");
@@ -188,6 +187,7 @@ byte MidiPlayer::track_read_byte(Track *t) {
}
void MidiPlayer::initialize() {
+#ifdef WIN32
uint i;
MyMidiHdr *mmh;
MIDIPROPTIMEDIV mptd;
@@ -236,6 +236,7 @@ void MidiPlayer::initialize() {
}
_midi_var9 = true;
+#endif
}
int MidiPlayer::fill(uint x, MyMidiHdr *mmh) {
@@ -294,6 +295,7 @@ int MidiPlayer::fill(uint x, MyMidiHdr *mmh) {
}
int MidiPlayer::fill_helper(NoteRec *nr, MyMidiHdr *mmh) {
+#ifdef WIN32
byte *lpdata;
uint b;
@@ -338,7 +340,7 @@ int MidiPlayer::fill_helper(NoteRec *nr, MyMidiHdr *mmh) {
mmh->b += 12;
}
-
+#endif
return 0;
}