From 0299ea07c7c45fa9d4afdc09bc0c28931a97dcce Mon Sep 17 00:00:00 2001 From: Marcus Comstedt Date: Sat, 2 Feb 2002 23:33:24 +0000 Subject: Keep a copy of the game icon, for savegame purposes. svn-id: r3556 --- dc/dc.h | 2 +- dc/dcmain.cpp | 9 +++++---- dc/selector.cpp | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dc/dc.h b/dc/dc.h index 814d8cfe88..1c47b13010 100644 --- a/dc/dc.h +++ b/dc/dc.h @@ -3,5 +3,5 @@ extern void checkSound(Scumm *s); extern void handleInput(struct mapledev *pad, int16 &mouse_x, int16 &mouse_y, byte &leftBtnPressed, byte &rightBtnPressed, int &keyPressed); -extern bool selectGame(Scumm *s, char *&); +extern bool selectGame(Scumm *s, char *&, class Icon &); diff --git a/dc/dcmain.cpp b/dc/dcmain.cpp index 761c922f1b..67e2c9d516 100644 --- a/dc/dcmain.cpp +++ b/dc/dcmain.cpp @@ -25,10 +25,13 @@ #include "gui.h" #include "sound.h" #include "dc.h" +#include "icon.h" + Scumm scumm; ScummDebugger debugger; Gui gui; +Icon icon; SoundEngine sound; SOUND_DRIVER_TYPE snd_driv; @@ -79,16 +82,14 @@ int main() dc_setup_ta(); init_arm(); - if(!selectGame(&scumm, argv[1])) + if(!selectGame(&scumm, argv[1], icon)) exit(0); sound.initialize(&scumm, &snd_driv); - printf("Sound initalized.\n"); scumm._gui = &gui; scumm.scummMain(argc, argv); - printf("scummMain called.\n"); gui.init(&scumm); last_time = Timer(); @@ -108,6 +109,6 @@ int main() } } while(1); - printf("All done. Returning to menu.\n"); + /* NOTREACHED */ exit(0); } diff --git a/dc/selector.cpp b/dc/selector.cpp index a91ba484c5..d58dcced81 100644 --- a/dc/selector.cpp +++ b/dc/selector.cpp @@ -353,7 +353,7 @@ int gameMenu(Game *games, int num_games) } } -bool selectGame(Scumm *s, char *&ret) +bool selectGame(Scumm *s, char *&ret, Icon &icon) { Game *games = new Game[MAX_GAMES]; int selected, num_games; @@ -393,6 +393,7 @@ bool selectGame(Scumm *s, char *&ret) if(selected>=0) { chdir(the_game.dir); ret = the_game.filename_base; + icon = the_game.icon; return true; } else return false; -- cgit v1.2.3