[Super-tux-commit] supertux/src gameloop.cpp,1.20,1.21 leveleditor.cpp,1.16,1.17 menu.cpp,1.16,1.17
Brought to you by:
wkendrick
From: Ingo R. <gr...@us...> - 2004-03-24 21:54:38
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5687 Modified Files: gameloop.cpp leveleditor.cpp menu.cpp player.cpp setup.cpp sound.cpp timer.cpp Log Message: - removed a few redundant "== true"'s Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- menu.cpp 24 Mar 2004 14:03:39 -0000 1.16 +++ menu.cpp 24 Mar 2004 21:43:56 -0000 1.17 @@ -285,7 +285,10 @@ { if(num_items != 0 && item != NULL) { - if((item[active_item].kind == MN_ACTION || item[active_item].kind == MN_TEXTFIELD || item[active_item].kind == MN_NUMFIELD) && item[active_item].toggled == true) + if((item[active_item].kind == MN_ACTION + || item[active_item].kind == MN_TEXTFIELD + || item[active_item].kind == MN_NUMFIELD) + && item[active_item].toggled) { item[active_item].toggled = false; show_menu = 0; @@ -328,7 +331,7 @@ int list_width = strlen(string_list_active(pitem.list)) * font_width; text_type* text_font = &white_text; - if(arrange_left == true) + if (arrange_left) x_pos += 24 - menu_width/2 + (text_width + input_width + list_width)/2; if(index == active_item) @@ -427,7 +430,7 @@ { text_draw_align(text_font, pitem.text, x_pos, y_pos, A_HMIDDLE, A_VMIDDLE, shadow_size); - if(pitem.toggled == true) + if(pitem.toggled) texture_draw(&checkbox_checked, x_pos + (text_width+font_width)/2, y_pos - 8); Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- setup.cpp 24 Mar 2004 14:35:11 -0000 1.16 +++ setup.cpp 24 Mar 2004 21:43:56 -0000 1.17 @@ -439,13 +439,13 @@ default: if(slot != -1) { - if(save == true) + if(save) { savegame(slot - 1); } else { - if(game_started == false) + if (game_started) { gameloop("default",slot - 1,ST_GL_LOAD_GAME); show_menu = true; @@ -479,7 +479,7 @@ case 4: if(use_music != options_menu->item[4].toggled) { - if(use_music == true) + if(use_music) { if(playing_music()) { @@ -603,7 +603,7 @@ { SDL_FreeSurface(screen); - if (use_fullscreen == true) + if (use_fullscreen) { screen = SDL_SetVideoMode(640, 480, 0, SDL_FULLSCREEN ) ; /* | SDL_HWSURFACE); */ if (screen == NULL) @@ -641,7 +641,7 @@ SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); - if (use_fullscreen == true) + if (use_fullscreen) { screen = SDL_SetVideoMode(640, 480, 0, SDL_FULLSCREEN | SDL_OPENGL) ; /* | SDL_HWSURFACE); */ if (screen == NULL) @@ -755,7 +755,7 @@ /* Init SDL Audio silently even if --disable-sound : */ - if (audio_device == true) + if (audio_device) { if (SDL_Init(SDL_INIT_AUDIO) < 0) { @@ -782,14 +782,14 @@ /* Open sound silently regarless the value of "use_sound": */ - if (audio_device == true) + if (audio_device) { if (open_audio(44100, AUDIO_S16, 2, 2048) < 0) { /* only print out message if sound or music was not disabled at command-line */ - if ((use_sound == true) || (use_music == true)) + if (use_sound || use_music) { fprintf(stderr, "\nWarning: I could not set up audio for 44100 Hz " Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- leveleditor.cpp 24 Mar 2004 17:41:04 -0000 1.16 +++ leveleditor.cpp 24 Mar 2004 21:43:56 -0000 1.17 @@ -612,7 +612,7 @@ i = true; } - if(i == true) + if(i) { level_free_gfx(); level_load_gfx(le_current_level); @@ -1014,13 +1014,13 @@ cursor_x = ((int)(pos_x + x) / 32) * 32; cursor_y = ((int) y / 32) * 32; - if(le_mouse_pressed[LEFT] == true) + if(le_mouse_pressed[LEFT]) { selection.x2 = x + pos_x; selection.y2 = y; } - if(le_mouse_pressed[RIGHT] == true) + if(le_mouse_pressed[RIGHT]) { pos_x += -1 * event.motion.xrel; } Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- player.cpp 24 Mar 2004 17:41:04 -0000 1.8 +++ player.cpp 24 Mar 2004 21:43:56 -0000 1.9 @@ -209,9 +209,8 @@ score_multiplier = 1; } - if(jumped_in_solid == true) + if(jumped_in_solid) { - if (isbrick(base.x, base.y) || isfullbox(base.x, base.y)) { @@ -285,7 +284,8 @@ } grabdistros(); - if(jumped_in_solid == true) + + if (jumped_in_solid) { ++base.y; ++old_base.y; @@ -460,7 +460,7 @@ } } } - else if(input_.up == UP && jumping == true) + else if(input_.up == UP && jumping) { if (on_ground()) { @@ -523,7 +523,7 @@ /* Jump/jumping? */ - if ( input_.up == DOWN || (input_.up == UP && jumping == true)) + if ( input_.up == DOWN || (input_.up == UP && jumping)) { handle_vertical_input(); } @@ -549,7 +549,7 @@ } else { - if (size == BIG && duck == true) + if (size == BIG && duck) { /* Make sure we're not standing back up into a solid! */ base.height = 64; @@ -978,7 +978,7 @@ base.x= 0; else if(base.x< scroll_x) base.x= scroll_x; - else if (base.x< 160 + scroll_x && scroll_x > 0 && debug_mode == true) + else if (base.x< 160 + scroll_x && scroll_x > 0 && debug_mode) { scroll_x = base.x- 160; /*base.x+= 160;*/ Index: sound.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sound.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- sound.cpp 24 Mar 2004 14:35:11 -0000 1.7 +++ sound.cpp 24 Mar 2004 21:43:56 -0000 1.8 @@ -123,7 +123,7 @@ /* this won't call the function if the user has disabled sound * either via menu or via command-line option */ - if ((use_sound == true) && (audio_device == true)) + if (use_sound && audio_device) { Mix_PlayChannel( whichSpeaker, snd, 0); @@ -156,7 +156,7 @@ int playing_music(void) { - if (use_music == true) + if (use_music) { return Mix_PlayingMusic(); } @@ -170,7 +170,7 @@ int halt_music(void) { - if ((use_music == true) && (audio_device == true)) + if (use_music && audio_device) { return Mix_HaltMusic(); } @@ -183,7 +183,7 @@ int play_music(Mix_Music *music, int loops) { - if ((use_music == true) && (audio_device == true)) + if (use_music && audio_device) { DEBUG_MSG(__PRETTY_FUNCTION__); return Mix_PlayMusic(music, loops); Index: timer.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/timer.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- timer.cpp 24 Mar 2004 13:52:34 -0000 1.4 +++ timer.cpp 24 Mar 2004 21:43:56 -0000 1.5 @@ -116,11 +116,13 @@ fread(&ptimer->period,sizeof(unsigned int),1,fi); fread(&diff_ticks,sizeof(unsigned int),1,fi); fread(&tick_mode,sizeof(unsigned int),1,fi); - if(tick_mode == true) + + if (tick_mode) ptimer->get_ticks = st_get_ticks; else ptimer->get_ticks = SDL_GetTicks; - if(diff_ticks != 0) + + if (diff_ticks != 0) ptimer->time = ptimer->get_ticks() - diff_ticks; else ptimer->time = 0; Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- gameloop.cpp 24 Mar 2004 21:18:08 -0000 1.20 +++ gameloop.cpp 24 Mar 2004 21:43:56 -0000 1.21 @@ -482,13 +482,9 @@ // Draw background: for (int y = 0; y < 15; ++y) - { - for (int x = 0; x < 21; ++x) - { - drawshape(32*x - fmodf(scroll_x, 32), y * 32, - current_level.tiles[(int)y][(int)x + (int)(scroll_x / 32)]); - } - } + for (int x = 0; x < 21; ++x) + drawshape(32*x - fmodf(scroll_x, 32), y * 32, + current_level.tiles[y][x + (int)(scroll_x / 32)]); for (unsigned int i = 0; i < bouncy_bricks.size(); ++i) bouncy_brick_draw(&bouncy_bricks[i]); @@ -692,7 +688,7 @@ SDL_Delay(50); } - if(debug_mode && debug_fps == true) + if(debug_mode && debug_fps) SDL_Delay(60); /*Draw the current scene to the screen */ |