aboutsummaryrefslogtreecommitdiff
path: root/sdl.cpp
diff options
context:
space:
mode:
authorLudvig Strigeus2001-10-09 19:02:28 +0000
committerLudvig Strigeus2001-10-09 19:02:28 +0000
commit907f51287c6b5f2f4248dc2ca80e9a286159d790 (patch)
tree55513139ea82775f5de99652535471ad69959599 /sdl.cpp
parent3c2f425cc1296452e466da57ac38c17bba24ff8a (diff)
downloadscummvm-rg350-907f51287c6b5f2f4248dc2ca80e9a286159d790.tar.gz
scummvm-rg350-907f51287c6b5f2f4248dc2ca80e9a286159d790.tar.bz2
scummvm-rg350-907f51287c6b5f2f4248dc2ca80e9a286159d790.zip
command line parameter support
svn-id: r3414
Diffstat (limited to 'sdl.cpp')
-rw-r--r--sdl.cpp37
1 files changed, 21 insertions, 16 deletions
diff --git a/sdl.cpp b/sdl.cpp
index 8c7184e4d9..d76164de70 100644
--- a/sdl.cpp
+++ b/sdl.cpp
@@ -17,14 +17,15 @@
*
* Change Log:
* $Log$
+ * Revision 1.3 2001/10/09 19:02:28 strigeus
+ * command line parameter support
+ *
* Revision 1.2 2001/10/09 17:38:20 strigeus
* Autodetection of endianness.
*
* Revision 1.1.1.1 2001/10/09 14:30:13 strigeus
- *
* initial revision
*
- *
*/
#define NEED_SDL_HEADERS
@@ -187,13 +188,21 @@ void updateScreen(Scumm *s) {
numDirtyRects = 0;
}
-#undef main
-int main(int argc, char* argv[]) {
+void initGraphics(Scumm *s) {
if (SDL_Init(SDL_INIT_VIDEO)==-1) {
- printf("Could not initialize SDL: %s.\n", SDL_GetError());
- return -1;
+ error("Could not initialize SDL: %s.\n", SDL_GetError());
+ exit(1);
}
-
+
+ /* Clean up on exit */
+ atexit(SDL_Quit);
+
+#if !defined(SCALEUP_2x2)
+ screen = SDL_SetVideoMode(320, 200, 8, SDL_SWSURFACE);
+#else
+ screen = SDL_SetVideoMode(640, 400, 8, SDL_SWSURFACE);
+#endif
+
printf("%d %d, %d %d, %d %d %d, %d %d %d %d %d\n",
sizeof(int8), sizeof(uint8),
sizeof(int16), sizeof(uint16),
@@ -204,16 +213,12 @@ int main(int argc, char* argv[]) {
&((CodeHeader*)0)->unk4
);
- /* Clean up on exit */
- atexit(SDL_Quit);
-#if !defined(SCALEUP_2x2)
- screen = SDL_SetVideoMode(320, 200, 8, SDL_SWSURFACE);
-#else
- screen = SDL_SetVideoMode(640, 400, 8, SDL_SWSURFACE);
-#endif
- scumm._videoMode = 0x13;
- scumm.scummMain();
+}
+#undef main
+int main(int argc, char* argv[]) {
+ scumm._videoMode = 0x13;
+ scumm.scummMain(argc, argv);
return 0;
}