// 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]);
SDL_Delay(50);
}
- if(debug_mode && debug_fps == true)
+ if(debug_mode && debug_fps)
SDL_Delay(60);
/*Draw the current scene to the screen */
i = true;
}
- if(i == true)
+ if(i)
{
level_free_gfx();
level_load_gfx(le_current_level);
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;
}
{
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;
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)
{
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);
score_multiplier = 1;
}
- if(jumped_in_solid == true)
+ if(jumped_in_solid)
{
-
if (isbrick(base.x, base.y) ||
isfullbox(base.x, base.y))
{
}
grabdistros();
- if(jumped_in_solid == true)
+
+ if (jumped_in_solid)
{
++base.y;
++old_base.y;
}
}
}
- else if(input_.up == UP && jumping == true)
+ else if(input_.up == UP && jumping)
{
if (on_ground())
{
/* Jump/jumping? */
- if ( input_.up == DOWN || (input_.up == UP && jumping == true))
+ if ( input_.up == DOWN || (input_.up == UP && jumping))
{
handle_vertical_input();
}
}
else
{
- if (size == BIG && duck == true)
+ if (size == BIG && duck)
{
/* Make sure we're not standing back up into a solid! */
base.height = 64;
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;*/
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;
case 4:
if(use_music != options_menu->item[4].toggled)
{
- if(use_music == true)
+ if(use_music)
{
if(playing_music())
{
{
SDL_FreeSurface(screen);
- if (use_fullscreen == true)
+ if (use_fullscreen)
{
screen = SDL_SetVideoMode(640, 480, 0, SDL_FULLSCREEN ) ; /* | SDL_HWSURFACE); */
if (screen == NULL)
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)
/* Init SDL Audio silently even if --disable-sound : */
- if (audio_device == true)
+ if (audio_device)
{
if (SDL_Init(SDL_INIT_AUDIO) < 0)
{
/* 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 "
/* 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);
int playing_music(void)
{
- if (use_music == true)
+ if (use_music)
{
return Mix_PlayingMusic();
}
int halt_music(void)
{
- if ((use_music == true) && (audio_device == true))
+ if (use_music && audio_device)
{
return Mix_HaltMusic();
}
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);
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;