[Tux4kids-commits] r1338 - branches/commonification/tuxmath/trunk/src
Bolesław Kulbabiński
bolekk-guest at alioth.debian.org
Mon Aug 3 14:55:45 UTC 2009
Author: bolekk-guest
Date: 2009-08-03 14:55:45 +0000 (Mon, 03 Aug 2009)
New Revision: 1338
Modified:
branches/commonification/tuxmath/trunk/src/fileops_media.c
branches/commonification/tuxmath/trunk/src/menu.c
branches/commonification/tuxmath/trunk/src/titlescreen.c
Log:
small bug fixes in tuxmath
Modified: branches/commonification/tuxmath/trunk/src/fileops_media.c
===================================================================
--- branches/commonification/tuxmath/trunk/src/fileops_media.c 2009-08-03 11:08:47 UTC (rev 1337)
+++ branches/commonification/tuxmath/trunk/src/fileops_media.c 2009-08-03 14:55:45 UTC (rev 1338)
@@ -166,7 +166,7 @@
/* Load animated graphics: */
for (i = 0; i < NUM_SPRITES; i++)
{
- sprintf(fn, "%s%s%s", DATA_PREFIX, "/images/", image_filenames[i]);
+ sprintf(fn, "%s%s%s", DATA_PREFIX, "/images/", sprite_filenames[i]);
sprites[i] = LoadSprite(fn, IMG_ALPHA);
if (sprites[i] == NULL)
Modified: branches/commonification/tuxmath/trunk/src/menu.c
===================================================================
--- branches/commonification/tuxmath/trunk/src/menu.c 2009-08-03 11:08:47 UTC (rev 1337)
+++ branches/commonification/tuxmath/trunk/src/menu.c 2009-08-03 14:55:45 UTC (rev 1338)
@@ -189,9 +189,10 @@
{
if(strcmp(attr_val, "RUN_MAIN_MENU") == 0)
node->activity = RUN_MAIN_MENU;
- for(i = 0; i < n_of_activities; i++)
- if(strcmp(attr_val, activities[i]) == 0)
- node->activity = i;
+ else
+ for(i = 0; i < n_of_activities; i++)
+ if(strcmp(attr_val, activities[i]) == 0)
+ node->activity = i;
}
else
DEBUGMSG(debug_menu_parser, "read_attributes(): unknown attribute %s , omitting\n", attr_name);
@@ -420,7 +421,7 @@
{
if (inRect(menu->submenu[menu->first_entry + i]->button_rect, event.motion.x, event.motion.y))
{
- if(snd_hover)
+ if(old_loc != i && snd_hover)
PlaySound(snd_hover);
loc = i;
break; /* from for loop */
Modified: branches/commonification/tuxmath/trunk/src/titlescreen.c
===================================================================
--- branches/commonification/tuxmath/trunk/src/titlescreen.c 2009-08-03 11:08:47 UTC (rev 1337)
+++ branches/commonification/tuxmath/trunk/src/titlescreen.c 2009-08-03 14:55:45 UTC (rev 1338)
@@ -114,6 +114,7 @@
const char* title_path = DATA_PREFIX "/images/title/title1.svg";
const char* egg_path = DATA_PREFIX "/images/title/egg.svg";
const char* tux_path = DATA_PREFIX "/images/tux/bigtux";
+char* menu_music_path = DATA_PREFIX "/sounds/tuxi.ogg";
/* beak coordinates relative to tux rect */
const float beak_pos[4] = {0.36, 0.21, 0.27, 0.14};
@@ -233,6 +234,7 @@
/* load menus */
SetActivitiesList(N_OF_ACTIVITIES, activities);
SetImagePathPrefix(DATA_PREFIX);
+ SetMenuSounds(menu_music_path, sounds[SND_POP], sounds[SND_TOCK]);
LoadMenu(MENU_MAIN, DATA_PREFIX "/menus/main_menu.xml");
PrerenderAll();
@@ -337,7 +339,7 @@
/* Start playing menu music if desired: */
if (Opts_GetGlobalOpt(MENU_MUSIC))
{
- AudioMusicLoad("tuxi.ogg", -1);
+ AudioMusicLoad(menu_music_path, -1);
}
/* If necessary, have the user log in */
@@ -514,7 +516,7 @@
AudioMusicUnload();
start_campaign();
if (Opts_GetGlobalOpt(MENU_MUSIC)) //Turn menu music back on
- AudioMusicLoad( "tuxi.ogg", -1 );
+ AudioMusicLoad(menu_music_path, -1 );
break;
case RUN_ACADEMY:
@@ -548,7 +550,7 @@
AudioMusicUnload();
game();
if (Opts_GetGlobalOpt(MENU_MUSIC)) //Turn menu music back on
- AudioMusicLoad( "tuxi.ogg", -1 );
+ AudioMusicLoad(menu_music_path, -1 );
Opts_SetHelpMode(0);
break;
@@ -566,7 +568,7 @@
AudioMusicUnload();
game();
if (Opts_GetGlobalOpt(MENU_MUSIC))
- AudioMusicLoad( "tuxi.ogg", -1 );
+ AudioMusicLoad(menu_music_path, -1 );
}
else
fprintf(stderr, "\nCould not find demo config file\n");
@@ -618,7 +620,7 @@
}
if (Opts_GetGlobalOpt(MENU_MUSIC)) //Turn menu music back on
- {AudioMusicLoad("tuxi.ogg", -1);}
+ {AudioMusicLoad(menu_music_path, -1);}
}
else // Something went wrong - could not read lesson config file:
{
@@ -659,7 +661,7 @@
AudioMusicUnload();
game();
if (Opts_GetGlobalOpt(MENU_MUSIC))
- AudioMusicLoad( "tuxi.ogg", -1 );
+ AudioMusicLoad(menu_music_path, -1 );
/* See if player made high score list! */
read_high_scores(); /* Update, in case other users have added to it */
hs_table = arcade_high_score_tables[choice];
@@ -704,7 +706,7 @@
write_user_config_file();
if (Opts_GetGlobalOpt(MENU_MUSIC))
- AudioMusicLoad( "tuxi.ogg", -1 );
+ AudioMusicLoad(menu_music_path, -1 );
}
return 0;
@@ -728,7 +730,7 @@
AudioMusicUnload();
mp_run_multiplayer();
if (Opts_GetGlobalOpt(MENU_MUSIC))
- AudioMusicLoad( "tuxi.ogg", -1 );
+ AudioMusicLoad(menu_music_path, -1 );
}
int run_factoroids(int choice)
@@ -744,7 +746,7 @@
fractions();
if (Opts_GetGlobalOpt(MENU_MUSIC))
- AudioMusicLoad( "tuxi.ogg", -1 );
+ AudioMusicLoad(menu_music_path, -1 );
hs_table = factoroids_high_score_tables[choice];
if (check_score_place(hs_table, Opts_LastScore()) < HIGH_SCORES_SAVED){
@@ -811,7 +813,7 @@
while (n_users) {
// Get the user choice
- PrerenderMenu(1);
+ PrerenderMenu(MENU_LOGIN);
chosen_login = RunMenu(MENU_LOGIN, true, DrawTitleScreen, HandleTitleScreenEvents, HandleTitleScreenAnimations, NULL);
// Determine whether there were any modifier (CTRL) keys pressed
mod = SDL_GetModState();
@@ -889,7 +891,7 @@
for(i = 0; i < num_lessons; i++)
sprite_names[i] = lesson_list_goldstars[i] ? "goldstar" : "no_goldstar";
- CreateOneLevelMenu(MENU_MAIN, num_lessons, lesson_list_titles, sprite_names, NULL, NULL);
+ CreateOneLevelMenu(MENU_LESSONS, num_lessons, lesson_list_titles, sprite_names, NULL, NULL);
free(sprite_names);
PrerenderMenu(MENU_LESSONS);
More information about the Tux4kids-commits
mailing list