Remove FlushAndPause() function
This commit is contained in:
@@ -3047,7 +3047,8 @@ bool monst_cast_mage(cCreature *caster,short targ)////
|
||||
break;
|
||||
j = get_ran(1,2,3);
|
||||
}
|
||||
FlushAndPause(12); // gives sound time to end
|
||||
mainPtr.display(); // TODO: Needed?
|
||||
sf::sleep(time_in_ticks(12)); // gives sound time to end
|
||||
x = get_ran(4,1,4);
|
||||
for (i = 0; i < j; i++){
|
||||
play_sound(-61);
|
||||
@@ -3131,7 +3132,8 @@ bool monst_cast_mage(cCreature *caster,short targ)////
|
||||
x = get_ran(3,1,4);
|
||||
play_sound(25);
|
||||
play_sound(-61);
|
||||
FlushAndPause(12); // gives sound time to end
|
||||
mainPtr.display(); // TODO: Needed?
|
||||
sf::sleep(time_in_ticks(12)); // gives sound time to end
|
||||
summon_monster(85,caster->cur_loc,
|
||||
((caster->attitude % 2 != 1) ? 0 : 100) + x,caster->attitude);
|
||||
break;
|
||||
|
||||
@@ -520,7 +520,7 @@ void main_button_click(short mode,RECT button_rect)
|
||||
draw_buttons(1);
|
||||
if (play_sounds == true)
|
||||
play_sound(37);
|
||||
else FlushAndPause(5);
|
||||
else sf::sleep(time_in_ticks(5));
|
||||
draw_buttons(0);
|
||||
undo_clip(mainPtr);
|
||||
}
|
||||
@@ -532,11 +532,12 @@ void arrow_button_click(RECT button_rect)
|
||||
clip_rect(mainPtr, button_rect);
|
||||
|
||||
refresh_stat_areas(1);
|
||||
mainPtr.display();
|
||||
if (play_sounds == true)
|
||||
play_sound(37);
|
||||
else FlushAndPause(5);
|
||||
refresh_stat_areas(0);
|
||||
else sf::sleep(time_in_ticks(5));
|
||||
undo_clip(mainPtr);
|
||||
refresh_stat_areas(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1615,14 +1616,15 @@ void boom_space(location where,short mode,short type,short damage,short sound)
|
||||
TEXT.style = sf::Text::Regular;
|
||||
}
|
||||
play_sound((skip_boom_delay?-1:1)*sound_to_play[sound]);
|
||||
mainPtr.display();
|
||||
if ((sound == 6) && (fast_bang == 0) && (!skip_boom_delay))
|
||||
FlushAndPause(12);
|
||||
sf::sleep(time_in_ticks(12));
|
||||
|
||||
|
||||
if (fast_bang == 0 && !skip_boom_delay) {
|
||||
del_len = PSD[SDF_GAME_SPEED] * 3 + 4;
|
||||
if (play_sounds == false)
|
||||
FlushAndPause(del_len);
|
||||
sf::sleep(time_in_ticks(del_len));
|
||||
}
|
||||
redraw_terrain();
|
||||
if ((overall_mode >= MODE_COMBAT/*9*/) && (overall_mode != MODE_LOOK_OUTDOORS) && (overall_mode != MODE_LOOK_TOWN) && (overall_mode != MODE_RESTING))
|
||||
@@ -1801,7 +1803,8 @@ void draw_targeting_line(location where_curs)
|
||||
}
|
||||
}
|
||||
|
||||
FlushAndPause(4);
|
||||
mainPtr.display();
|
||||
sf::sleep(time_in_ticks(4));
|
||||
|
||||
redraw_rect2.inset(-5,-5);
|
||||
redraw_partial_terrain(redraw_rect2);
|
||||
@@ -1841,20 +1844,6 @@ void redraw_partial_terrain(RECT redraw_rect)
|
||||
|
||||
}
|
||||
|
||||
void FlushAndPause(unsigned long ticks)
|
||||
{
|
||||
// TODO: Not quite sure what should be done here.
|
||||
#if 0
|
||||
RgnHandle portRegion = NewRgn();
|
||||
GrafPtr port;
|
||||
GetPort(&port);
|
||||
GetPortVisibleRegion(port,portRegion);
|
||||
QDFlushPortBuffer(port,portRegion);
|
||||
DisposeRgn(portRegion);
|
||||
#endif
|
||||
sf::sleep(time_in_ticks(ticks));
|
||||
}
|
||||
|
||||
/*
|
||||
void HideShowMenuBar( )
|
||||
{
|
||||
|
||||
@@ -44,7 +44,6 @@ void redraw_partial_terrain(RECT redraw_rect);
|
||||
bool is_nature(char i, char j, unsigned char ground_t);
|
||||
void put_dialog_graphic(short graphic_num,short spec_g,RECT draw_rect);
|
||||
void draw_startup_stats();
|
||||
void FlushAndPause(unsigned long ticks);
|
||||
void draw_trim(short q,short r,short which_trim,ter_num_t ground_ter);
|
||||
|
||||
ter_num_t get_ground_from_ter(ter_num_t ter);
|
||||
|
||||
@@ -508,9 +508,10 @@ void do_missile_anim(short num_steps,location missile_origin,short sound_num)
|
||||
to_rect.offset(current_terrain_ul);
|
||||
rect_draw_some_item(temp_gworld.getTexture(),missile_place_rect[i],to_rect,ul);
|
||||
}
|
||||
mainPtr.display();
|
||||
if ((PSD[SDF_GAME_SPEED] == 3) || ((PSD[SDF_GAME_SPEED] == 1) && (t % 4 == 0)) ||
|
||||
((PSD[SDF_GAME_SPEED] == 2) && (t % 3 == 0)))
|
||||
FlushAndPause(1);
|
||||
sf::sleep(time_in_ticks(1));
|
||||
}
|
||||
|
||||
// Exit gracefully, and clean up screen
|
||||
@@ -680,7 +681,8 @@ void do_explosion_anim(short sound_num,short special_draw)
|
||||
rect_draw_some_item(temp_gworld.getTexture(),explode_place_rect[i],to_rect,ul);
|
||||
}
|
||||
//if (((PSD[SDF_GAME_SPEED] == 1) && (t % 3 == 0)) || ((PSD[SDF_GAME_SPEED] == 2) && (t % 2 == 0)))
|
||||
FlushAndPause(2 * (1 + PSD[SDF_GAME_SPEED]));
|
||||
mainPtr.display();
|
||||
sf::sleep(time_in_ticks(2 * (1 + PSD[SDF_GAME_SPEED])));
|
||||
}
|
||||
|
||||
// Exit gracefully, and clean up screen
|
||||
@@ -710,9 +712,10 @@ void click_shop_rect(RECT area_rect)
|
||||
{
|
||||
|
||||
draw_shop_graphics(1,area_rect);
|
||||
mainPtr.display();
|
||||
if (play_sounds == true)
|
||||
play_sound(37);
|
||||
else FlushAndPause(5);
|
||||
else sf::sleep(time_in_ticks(5));
|
||||
draw_shop_graphics(0,area_rect);
|
||||
|
||||
}
|
||||
@@ -946,9 +949,10 @@ void click_talk_rect(char *str_to_place,char *str_to_place2,RECT c_rect)
|
||||
{
|
||||
|
||||
place_talk_str(str_to_place,str_to_place2,1,c_rect);
|
||||
mainPtr.display();
|
||||
if (play_sounds == true)
|
||||
play_sound(37);
|
||||
else FlushAndPause(5);
|
||||
else sf::sleep(time_in_ticks(5));
|
||||
place_talk_str(str_to_place,str_to_place2,0,c_rect);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "dlogutil.h"
|
||||
#include "winutil.h"
|
||||
#include "boe.menus.h"
|
||||
#include "mathutil.h"
|
||||
|
||||
#include <vector>
|
||||
using std::vector;
|
||||
@@ -41,6 +42,7 @@ extern eGameMode overall_mode;
|
||||
|
||||
RECT startup_button[6];
|
||||
|
||||
// TODO: Always returns false, so make it void
|
||||
bool handle_startup_press(location the_point)
|
||||
{
|
||||
std::string scen_name;
|
||||
@@ -52,9 +54,10 @@ bool handle_startup_press(location the_point)
|
||||
for (i = 0; i < 5; i++)
|
||||
if (the_point.in(startup_button[i]) == true) {
|
||||
draw_start_button(i,5);
|
||||
mainPtr.display(); // TODO: I suspect this won't work
|
||||
if (play_sounds == true)
|
||||
play_sound(37);
|
||||
else FlushAndPause(5);
|
||||
else sf::sleep(time_in_ticks(5));
|
||||
draw_start_button(i,0);
|
||||
switch (i) {
|
||||
case STARTBTN_LOAD:
|
||||
@@ -109,12 +112,6 @@ bool handle_startup_press(location the_point)
|
||||
scen_name = scen_headers.strs(scen).file;
|
||||
put_party_in_scen(scen_name);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
FlushAndPause(50);
|
||||
return true;
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user