From 3ca1682f26afd1522031b61e91db92da9e05f12a Mon Sep 17 00:00:00 2001 From: Marcus Comstedt Date: Sat, 16 Mar 2002 18:13:30 +0000 Subject: Now sets path to game with -p. svn-id: r3769 --- dc/dc.h | 2 +- dc/dcmain.cpp | 7 +++---- dc/selector.cpp | 12 +++++++++--- 3 files changed, 13 insertions(+), 8 deletions(-) (limited to 'dc') diff --git a/dc/dc.h b/dc/dc.h index c117648d48..5e6e43bda6 100644 --- a/dc/dc.h +++ b/dc/dc.h @@ -4,5 +4,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 *&, class Icon &); +extern bool selectGame(Scumm *s, char *&, char *&, class Icon &); diff --git a/dc/dcmain.cpp b/dc/dcmain.cpp index 0e3c92ed56..bb1dc20521 100644 --- a/dc/dcmain.cpp +++ b/dc/dcmain.cpp @@ -41,7 +41,6 @@ void cd_playtrack(int track, int offset, int delay) {;} void cd_play(int track, int num_loops, int start_frame) {;} void cd_stop() {;} int cd_is_running() {return 0;} -void cd_playtrack(int track, int offset, int delay) { void launcherLoop() { /* No launcher on DC yet => stub function */ @@ -77,8 +76,8 @@ void waitForTimer(Scumm *s, int time) } } -static char *argv[] = { "scummvm", NULL, NULL }; -static int argc = 2; +static char *argv[] = { "scummvm", NULL, NULL, NULL }; +static int argc = 3; int main() { @@ -98,7 +97,7 @@ int main() initSound(); - if(!selectGame(&scumm, argv[1], icon)) + if(!selectGame(&scumm, argv[2], argv[1], icon)) exit(0); sound.initialize(&scumm, &snd_driv); diff --git a/dc/selector.cpp b/dc/selector.cpp index 4b7e321388..747181d516 100644 --- a/dc/selector.cpp +++ b/dc/selector.cpp @@ -234,10 +234,13 @@ static int findGames(Scumm *s, Game *games, int max) if(games[curr_game].dir[i]=='/') break; if(i>=0) { - games[curr_game].dir[strlen(games[curr_game].dir)-1]='\0'; strcpy(games[curr_game].filename_base, games[curr_game].dir+i+1); + games[curr_game].filename_base[strlen(games[curr_game]. + filename_base)-1]='\0'; +#if 0 games[curr_game].dir[i+1]='\0'; +#endif } } checkName(s, games[curr_game]); @@ -412,7 +415,7 @@ int gameMenu(Game *games, int num_games) } } -bool selectGame(Scumm *s, char *&ret, Icon &icon) +bool selectGame(Scumm *s, char *&ret, char *&dir_ret, Icon &icon) { Game *games = new Game[MAX_GAMES]; int selected, num_games; @@ -449,10 +452,13 @@ bool selectGame(Scumm *s, char *&ret, Icon &icon) delete games; if(selected>=0) { -#if 1 +#if 0 chdir(the_game.dir); #else chdir("/"); + static char dirarg[258]; + sprintf(dirarg, "-p%s", the_game.dir); + dir_ret = dirarg; #endif ret = the_game.filename_base; icon = the_game.icon; -- cgit v1.2.3