game: try to fix some details:
- always add help node in talk mode, - in shop/talk mode do no try to find a combat frame, ... - add a framerate_limiters in various loops of events, - try to improve the minimap update.
This commit is contained in:
@@ -1067,17 +1067,17 @@ bool handle_action(const sf::Event& event) {
|
|||||||
if(overall_mode != MODE_TALKING)
|
if(overall_mode != MODE_TALKING)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(overall_mode == MODE_SHOPPING) {
|
else if(overall_mode == MODE_SHOPPING) {
|
||||||
handle_shop_event(the_point);
|
handle_shop_event(the_point);
|
||||||
if(overall_mode != MODE_SHOPPING)
|
if(overall_mode != MODE_SHOPPING)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise they're in a terrain view mode
|
// Otherwise they're in a terrain view mode
|
||||||
location cur_loc = is_out() ? univ.party.out_loc : center;
|
else {
|
||||||
auto button_hit = UI::toolbar.button_hit(mainPtr, the_point);
|
location cur_loc = is_out() ? univ.party.out_loc : center;
|
||||||
|
auto button_hit = UI::toolbar.button_hit(mainPtr, the_point);
|
||||||
|
|
||||||
// MARK: Then, handle a button being hit.
|
// MARK: Then, handle a button being hit.
|
||||||
switch(button_hit) {
|
switch(button_hit) {
|
||||||
case TOOLBAR_NONE: break;
|
case TOOLBAR_NONE: break;
|
||||||
case TOOLBAR_MAGE: case TOOLBAR_PRIEST:
|
case TOOLBAR_MAGE: case TOOLBAR_PRIEST:
|
||||||
@@ -1154,122 +1154,123 @@ bool handle_action(const sf::Event& event) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: Begin: click in terrain
|
// MARK: Begin: click in terrain
|
||||||
if(the_point.in(world_screen) && (is_out() || is_town() || is_combat())){
|
if(the_point.in(world_screen) && (is_out() || is_town() || is_combat())){
|
||||||
int i = (the_point.x - 32) / 28;
|
int i = (the_point.x - 32) / 28;
|
||||||
int j = (the_point.y - 20) / 36;
|
int j = (the_point.y - 20) / 36;
|
||||||
location destination = cur_loc;
|
location destination = cur_loc;
|
||||||
|
|
||||||
// Check for quick look
|
// Check for quick look
|
||||||
if(right_button) {
|
if(right_button) {
|
||||||
previous_mode = overall_mode;
|
previous_mode = overall_mode;
|
||||||
if(is_combat()) overall_mode = MODE_LOOK_COMBAT;
|
if(is_combat()) overall_mode = MODE_LOOK_COMBAT;
|
||||||
if(is_out()) overall_mode = MODE_LOOK_OUTDOORS;
|
if(is_out()) overall_mode = MODE_LOOK_OUTDOORS;
|
||||||
if(is_town()) overall_mode = MODE_LOOK_TOWN;
|
if(is_town()) overall_mode = MODE_LOOK_TOWN;
|
||||||
}
|
|
||||||
|
|
||||||
// Moving/pausing
|
|
||||||
if(overall_mode == MODE_OUTDOORS || overall_mode == MODE_TOWN || overall_mode == MODE_COMBAT) {
|
|
||||||
if((i == 4) & (j == 4)) handle_pause(did_something, need_redraw);
|
|
||||||
else {
|
|
||||||
cur_direction = get_cur_direction(the_point);
|
|
||||||
destination.x += cur_direction.x;
|
|
||||||
destination.y += cur_direction.y;
|
|
||||||
handle_move(destination, did_something, need_redraw, need_reprint);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Looking at something
|
// Moving/pausing
|
||||||
else if(overall_mode == MODE_LOOK_OUTDOORS || overall_mode == MODE_LOOK_TOWN || overall_mode == MODE_LOOK_COMBAT) {
|
if(overall_mode == MODE_OUTDOORS || overall_mode == MODE_TOWN || overall_mode == MODE_COMBAT) {
|
||||||
if(overall_mode == MODE_LOOK_OUTDOORS) destination = univ.party.out_loc;
|
if((i == 4) & (j == 4)) handle_pause(did_something, need_redraw);
|
||||||
destination.x = destination.x + i - 4;
|
else {
|
||||||
destination.y = destination.y + j - 4;
|
cur_direction = get_cur_direction(the_point);
|
||||||
handle_look(destination, need_redraw, need_reprint);
|
destination.x += cur_direction.x;
|
||||||
// If option/ctrl not pressed, looking done, so restore center
|
destination.y += cur_direction.y;
|
||||||
bool look_done = true;
|
handle_move(destination, did_something, need_redraw, need_reprint);
|
||||||
if(sf::Keyboard::isKeyPressed(sf::Keyboard::LAlt)) look_done = false;
|
|
||||||
if(sf::Keyboard::isKeyPressed(sf::Keyboard::RAlt)) look_done = false;
|
|
||||||
if(sf::Keyboard::isKeyPressed(sf::Keyboard::LControl)) look_done = false;
|
|
||||||
if(sf::Keyboard::isKeyPressed(sf::Keyboard::RControl)) look_done = false;
|
|
||||||
if(look_done) {
|
|
||||||
if(right_button) overall_mode = previous_mode;
|
|
||||||
else if(overall_mode == MODE_LOOK_COMBAT) {
|
|
||||||
overall_mode = MODE_COMBAT;
|
|
||||||
center = univ.current_pc().combat_pos;
|
|
||||||
pause(5);
|
|
||||||
need_redraw = true;
|
|
||||||
}
|
}
|
||||||
else if(overall_mode == MODE_LOOK_TOWN) {
|
}
|
||||||
overall_mode = MODE_TOWN;
|
|
||||||
center = univ.party.town_loc;
|
// Looking at something
|
||||||
need_redraw = true;
|
else if(overall_mode == MODE_LOOK_OUTDOORS || overall_mode == MODE_LOOK_TOWN || overall_mode == MODE_LOOK_COMBAT) {
|
||||||
}
|
if(overall_mode == MODE_LOOK_OUTDOORS) destination = univ.party.out_loc;
|
||||||
else if(overall_mode == MODE_LOOK_OUTDOORS)
|
destination.x = destination.x + i - 4;
|
||||||
overall_mode = MODE_OUTDOORS;
|
destination.y = destination.y + j - 4;
|
||||||
|
handle_look(destination, need_redraw, need_reprint);
|
||||||
|
// If option/ctrl not pressed, looking done, so restore center
|
||||||
|
bool look_done = true;
|
||||||
|
if(sf::Keyboard::isKeyPressed(sf::Keyboard::LAlt)) look_done = false;
|
||||||
|
if(sf::Keyboard::isKeyPressed(sf::Keyboard::RAlt)) look_done = false;
|
||||||
|
if(sf::Keyboard::isKeyPressed(sf::Keyboard::LControl)) look_done = false;
|
||||||
|
if(sf::Keyboard::isKeyPressed(sf::Keyboard::RControl)) look_done = false;
|
||||||
|
if(look_done) {
|
||||||
|
if(right_button) overall_mode = previous_mode;
|
||||||
|
else if(overall_mode == MODE_LOOK_COMBAT) {
|
||||||
|
overall_mode = MODE_COMBAT;
|
||||||
|
center = univ.current_pc().combat_pos;
|
||||||
|
pause(5);
|
||||||
|
need_redraw = true;
|
||||||
|
}
|
||||||
|
else if(overall_mode == MODE_LOOK_TOWN) {
|
||||||
|
overall_mode = MODE_TOWN;
|
||||||
|
center = univ.party.town_loc;
|
||||||
|
need_redraw = true;
|
||||||
|
}
|
||||||
|
else if(overall_mode == MODE_LOOK_OUTDOORS)
|
||||||
|
overall_mode = MODE_OUTDOORS;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Talking to someone
|
||||||
|
else if(overall_mode == MODE_TALK_TOWN) {
|
||||||
|
destination.x = destination.x + i - 4;
|
||||||
|
destination.y = destination.y + j - 4;
|
||||||
|
handle_talk(destination, did_something, need_redraw, need_reprint);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Targeting a space
|
||||||
|
else if(overall_mode == MODE_SPELL_TARGET || overall_mode == MODE_FIRING || overall_mode == MODE_THROWING ||
|
||||||
|
overall_mode == MODE_FANCY_TARGET || overall_mode == MODE_TOWN_TARGET) {
|
||||||
|
destination = center;
|
||||||
|
destination.x += i - 4;
|
||||||
|
destination.y += j - 4;
|
||||||
|
handle_target_space(destination, did_something, need_redraw, need_reprint);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dropping an item
|
||||||
|
else if(overall_mode == MODE_DROP_TOWN || overall_mode == MODE_DROP_COMBAT) {
|
||||||
|
destination.x += i - 4;
|
||||||
|
destination.y += j - 4;
|
||||||
|
handle_drop_item(destination, need_redraw);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Using a space
|
||||||
|
else if(overall_mode == MODE_USE_TOWN) {
|
||||||
|
destination.x += i - 4;
|
||||||
|
destination.y += j - 4;
|
||||||
|
handle_use_space(destination, did_something, need_redraw);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bashing/lockpicking
|
||||||
|
else if(overall_mode == MODE_BASH_TOWN || overall_mode == MODE_PICK_TOWN) {
|
||||||
|
destination.x += i - 4;
|
||||||
|
destination.y += j - 4;
|
||||||
|
handle_bash_pick(destination, did_something, need_redraw, overall_mode == MODE_BASH_TOWN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// MARK: End: click in terrain
|
||||||
// Talking to someone
|
|
||||||
else if(overall_mode == MODE_TALK_TOWN) {
|
|
||||||
destination.x = destination.x + i - 4;
|
|
||||||
destination.y = destination.y + j - 4;
|
|
||||||
handle_talk(destination, did_something, need_redraw, need_reprint);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Targeting a space
|
|
||||||
else if(overall_mode == MODE_SPELL_TARGET || overall_mode == MODE_FIRING || overall_mode == MODE_THROWING ||
|
|
||||||
overall_mode == MODE_FANCY_TARGET || overall_mode == MODE_TOWN_TARGET) {
|
|
||||||
destination = center;
|
|
||||||
destination.x += i - 4;
|
|
||||||
destination.y += j - 4;
|
|
||||||
handle_target_space(destination, did_something, need_redraw, need_reprint);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dropping an item
|
|
||||||
else if(overall_mode == MODE_DROP_TOWN || overall_mode == MODE_DROP_COMBAT) {
|
|
||||||
destination.x += i - 4;
|
|
||||||
destination.y += j - 4;
|
|
||||||
handle_drop_item(destination, need_redraw);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Using a space
|
|
||||||
else if(overall_mode == MODE_USE_TOWN) {
|
|
||||||
destination.x += i - 4;
|
|
||||||
destination.y += j - 4;
|
|
||||||
handle_use_space(destination, did_something, need_redraw);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bashing/lockpicking
|
|
||||||
else if(overall_mode == MODE_BASH_TOWN || overall_mode == MODE_PICK_TOWN) {
|
|
||||||
destination.x += i - 4;
|
|
||||||
destination.y += j - 4;
|
|
||||||
handle_bash_pick(destination, did_something, need_redraw, overall_mode == MODE_BASH_TOWN);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// MARK: End: click in terrain
|
|
||||||
|
|
||||||
// MARK: Begin: Screen shift
|
// MARK: Begin: Screen shift
|
||||||
if(scrollableModes.count(overall_mode) && the_point.in(terrain_viewport) && !the_point.in(world_screen)) {
|
if(scrollableModes.count(overall_mode) && the_point.in(terrain_viewport) && !the_point.in(world_screen)) {
|
||||||
if(the_point.y < world_screen.top && center.y > univ.town->in_town_rect.top && center.y > 4) {
|
if(the_point.y < world_screen.top && center.y > univ.town->in_town_rect.top && center.y > 4) {
|
||||||
center.y--;
|
center.y--;
|
||||||
need_redraw = true;
|
need_redraw = true;
|
||||||
}
|
}
|
||||||
if(the_point.x < world_screen.left && center.x > univ.town->in_town_rect.left && center.x > 4) {
|
if(the_point.x < world_screen.left && center.x > univ.town->in_town_rect.left && center.x > 4) {
|
||||||
center.x--;
|
center.x--;
|
||||||
need_redraw = true;
|
need_redraw = true;
|
||||||
}
|
}
|
||||||
if(the_point.y > world_screen.bottom && center.y < univ.town->in_town_rect.bottom && center.y < univ.town->max_dim - 5) {
|
if(the_point.y > world_screen.bottom && center.y < univ.town->in_town_rect.bottom && center.y < univ.town->max_dim - 5) {
|
||||||
center.y++;
|
center.y++;
|
||||||
need_redraw = true;
|
need_redraw = true;
|
||||||
}
|
}
|
||||||
if(the_point.x > world_screen.right && center.x < univ.town->in_town_rect.right && center.x < univ.town->max_dim - 5) {
|
if(the_point.x > world_screen.right && center.x < univ.town->in_town_rect.right && center.x < univ.town->max_dim - 5) {
|
||||||
center.x++;
|
center.x++;
|
||||||
need_redraw = true;
|
need_redraw = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// MARK: End: Screen shift
|
||||||
}
|
}
|
||||||
// MARK: End: Screen shift
|
|
||||||
|
|
||||||
// MARK: Process clicks in PC stats area
|
// MARK: Process clicks in PC stats area
|
||||||
if(the_point.in(win_to_rects[WINRECT_PCSTATS])) {
|
if(the_point.in(win_to_rects[WINRECT_PCSTATS])) {
|
||||||
location pc_win_ul = win_to_rects[WINRECT_PCSTATS].topLeft();
|
location pc_win_ul = win_to_rects[WINRECT_PCSTATS].topLeft();
|
||||||
|
@@ -174,10 +174,6 @@ void end_shop_mode() {
|
|||||||
shop_sbar->hide();
|
shop_sbar->hide();
|
||||||
done_btn->hide();
|
done_btn->hide();
|
||||||
help_btn->hide();
|
help_btn->hide();
|
||||||
if(store_pre_shop_mode == MODE_TALKING) {
|
|
||||||
place_talk_str("You conclude your business.", "", 0, dummy_rect);
|
|
||||||
update_last_talk(TALK_BUSINESS);
|
|
||||||
}
|
|
||||||
|
|
||||||
overall_mode = store_pre_shop_mode;
|
overall_mode = store_pre_shop_mode;
|
||||||
if(overall_mode == MODE_TALK_TOWN)
|
if(overall_mode == MODE_TALK_TOWN)
|
||||||
@@ -186,7 +182,15 @@ void end_shop_mode() {
|
|||||||
center = univ.party.town_loc;
|
center = univ.party.town_loc;
|
||||||
update_explored(center);
|
update_explored(center);
|
||||||
}
|
}
|
||||||
stat_screen_mode = MODE_INVEN;
|
|
||||||
|
if (overall_mode == MODE_TALKING) {
|
||||||
|
// fixme: there must be a function to reset the talking state correctly
|
||||||
|
place_talk_str("You conclude your business.", "", 0, dummy_rect);
|
||||||
|
stat_screen_mode = MODE_SHOP;
|
||||||
|
help_btn->show();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
stat_screen_mode = MODE_INVEN;
|
||||||
put_item_screen(stat_window);
|
put_item_screen(stat_window);
|
||||||
put_pc_screen();
|
put_pc_screen();
|
||||||
// TODO: I suspect REFRESH_NONE will suffice here
|
// TODO: I suspect REFRESH_NONE will suffice here
|
||||||
|
@@ -607,10 +607,16 @@ void alter_space(short i,short j,ter_num_t ter) {
|
|||||||
location l(i,j);
|
location l(i,j);
|
||||||
l = local_to_global(l);
|
l = local_to_global(l);
|
||||||
univ.out[l.x][l.y] = ter;
|
univ.out[l.x][l.y] = ter;
|
||||||
univ.out->terrain[i][j] = ter;
|
if (univ.out->terrain[i][j] != ter) {
|
||||||
|
univ.out->terrain[i][j] = ter;
|
||||||
|
minimap::draw(true);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ter_num_t former = univ.town->terrain(i,j);
|
ter_num_t former = univ.town->terrain(i,j);
|
||||||
univ.town->terrain(i,j) = ter;
|
if (former!=ter) {
|
||||||
|
univ.town->terrain(i,j) = ter;
|
||||||
|
minimap::draw(true);
|
||||||
|
}
|
||||||
if(univ.scenario.ter_types[ter].special == eTerSpec::CONVEYOR)
|
if(univ.scenario.ter_types[ter].special == eTerSpec::CONVEYOR)
|
||||||
univ.town.belt_present = true;
|
univ.town.belt_present = true;
|
||||||
if(univ.scenario.ter_types[former].light_radius != univ.scenario.ter_types[ter].light_radius)
|
if(univ.scenario.ter_types[former].light_radius != univ.scenario.ter_types[ter].light_radius)
|
||||||
|
@@ -93,6 +93,9 @@ void set_visible(bool vis)
|
|||||||
windows.setVisible(true);
|
windows.setVisible(true);
|
||||||
visible = true;
|
visible = true;
|
||||||
draw(true);
|
draw(true);
|
||||||
|
// when a game is loaded, the windows is not adapted correctly
|
||||||
|
// try to force a new refresh
|
||||||
|
changed = true;
|
||||||
makeFrontWindow(mainPtr);
|
makeFrontWindow(mainPtr);
|
||||||
|
|
||||||
set_cursor(sword_curs);
|
set_cursor(sword_curs);
|
||||||
@@ -354,6 +357,9 @@ bool pollEvent()
|
|||||||
makeFrontWindow(mainPtr);
|
makeFrontWindow(mainPtr);
|
||||||
else if(event.type == sf::Event::KeyPressed) {
|
else if(event.type == sf::Event::KeyPressed) {
|
||||||
switch(event.key.code) {
|
switch(event.key.code) {
|
||||||
|
// checkme: the zone seems big enough
|
||||||
|
// but maybe we can check for arrows here to move
|
||||||
|
// in the zone
|
||||||
case sf::Keyboard::Escape:
|
case sf::Keyboard::Escape:
|
||||||
set_visible(false);
|
set_visible(false);
|
||||||
break;
|
break;
|
||||||
|
@@ -9,6 +9,7 @@
|
|||||||
#include "strdlog.hpp"
|
#include "strdlog.hpp"
|
||||||
#include "choicedlog.hpp"
|
#include "choicedlog.hpp"
|
||||||
#include "fileio.hpp"
|
#include "fileio.hpp"
|
||||||
|
#include "framerate_limiter.hpp"
|
||||||
#include "spell.hpp"
|
#include "spell.hpp"
|
||||||
#include "sounds.hpp"
|
#include "sounds.hpp"
|
||||||
#include "universe.hpp"
|
#include "universe.hpp"
|
||||||
@@ -2006,9 +2007,11 @@ void run_special(eSpecCtx which_mode, eSpecCtxType which_type, spec_num_t start_
|
|||||||
add_string_to_buf(debug);
|
add_string_to_buf(debug);
|
||||||
redraw_screen(REFRESH_TRANS);
|
redraw_screen(REFRESH_TRANS);
|
||||||
sf::Event evt;
|
sf::Event evt;
|
||||||
|
cFramerateLimiter fps_limiter;
|
||||||
while(true) {
|
while(true) {
|
||||||
if(mainPtr.pollEvent(evt) && (evt.type == sf::Event::KeyPressed || evt.type == sf::Event::MouseButtonPressed))
|
if(mainPtr.pollEvent(evt) && (evt.type == sf::Event::KeyPressed || evt.type == sf::Event::MouseButtonPressed))
|
||||||
break;
|
break;
|
||||||
|
fps_limiter.frame_finished();
|
||||||
}
|
}
|
||||||
if(evt.type == sf::Event::KeyPressed && evt.key.code == sf::Keyboard::Escape)
|
if(evt.type == sf::Event::KeyPressed && evt.key.code == sf::Keyboard::Escape)
|
||||||
univ.node_step_through = false;
|
univ.node_step_through = false;
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
#include "boe.global.hpp"
|
#include "boe.global.hpp"
|
||||||
|
|
||||||
|
#include "framerate_limiter.hpp"
|
||||||
#include "universe.hpp"
|
#include "universe.hpp"
|
||||||
#include "boe.newgraph.hpp"
|
#include "boe.newgraph.hpp"
|
||||||
#include "boe.graphics.hpp"
|
#include "boe.graphics.hpp"
|
||||||
@@ -124,15 +125,19 @@ void show_logo() {
|
|||||||
auto const &pict_to_draw = *ResMgr::textures.get("spidlogo", true);
|
auto const &pict_to_draw = *ResMgr::textures.get("spidlogo", true);
|
||||||
|
|
||||||
play_sound(-95);
|
play_sound(-95);
|
||||||
|
cFramerateLimiter fps_limiter;
|
||||||
while(sound_going(95)) {
|
while(sound_going(95)) {
|
||||||
draw_splash(pict_to_draw, mainPtr, logo_from);
|
draw_splash(pict_to_draw, mainPtr, logo_from);
|
||||||
handle_splash_events();
|
handle_splash_events();
|
||||||
|
fps_limiter.frame_finished();
|
||||||
}
|
}
|
||||||
if(!get_int_pref("ShowStartupSplash", true)) {
|
if(!get_int_pref("ShowStartupSplash", true)) {
|
||||||
sf::Time delay = time_in_ticks(60);
|
sf::Time delay = time_in_ticks(60);
|
||||||
sf::Clock timer;
|
sf::Clock timer;
|
||||||
while(timer.getElapsedTime() < delay)
|
while(timer.getElapsedTime() < delay) {
|
||||||
handle_splash_events();
|
handle_splash_events();
|
||||||
|
fps_limiter.frame_finished();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,9 +154,11 @@ void plop_fancy_startup() {
|
|||||||
play_sound(-22);
|
play_sound(-22);
|
||||||
sf::Clock timer;
|
sf::Clock timer;
|
||||||
|
|
||||||
|
cFramerateLimiter fps_limiter;
|
||||||
while(timer.getElapsedTime() < delay) {
|
while(timer.getElapsedTime() < delay) {
|
||||||
draw_splash(pict_to_draw, mainPtr, intro_from);
|
draw_splash(pict_to_draw, mainPtr, intro_from);
|
||||||
handle_splash_events();
|
handle_splash_events();
|
||||||
|
fps_limiter.frame_finished();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -26,9 +26,7 @@ void erase_hidden_towns(cOutdoors& sector, int quadrant_x, int quadrant_y);
|
|||||||
void erase_completed_specials(cArea& sector, std::function<void(location)> clear_spot);
|
void erase_completed_specials(cArea& sector, std::function<void(location)> clear_spot);
|
||||||
void erase_out_specials();
|
void erase_out_specials();
|
||||||
bool does_location_have_special(cOutdoors& sector, location loc, eTerSpec type);
|
bool does_location_have_special(cOutdoors& sector, location loc, eTerSpec type);
|
||||||
void clear_map();
|
|
||||||
void draw_map(bool need_refresh);
|
|
||||||
bool is_door(location destination);
|
bool is_door(location destination);
|
||||||
void display_map();
|
|
||||||
void check_done();
|
void check_done();
|
||||||
bool quadrant_legal(short i, short j) ;
|
bool quadrant_legal(short i, short j) ;
|
||||||
|
@@ -9,16 +9,19 @@
|
|||||||
#include "boe.ui.hpp"
|
#include "boe.ui.hpp"
|
||||||
|
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
|
||||||
#include "enum_map.hpp"
|
#include "enum_map.hpp"
|
||||||
#include "boe.consts.hpp"
|
#include "framerate_limiter.hpp"
|
||||||
#include "boe.locutils.hpp"
|
#include "mathutil.hpp"
|
||||||
#include "boe.graphics.hpp"
|
|
||||||
#include "render_shapes.hpp"
|
#include "render_shapes.hpp"
|
||||||
#include "render_image.hpp"
|
#include "render_image.hpp"
|
||||||
#include "res_image.hpp"
|
#include "res_image.hpp"
|
||||||
#include "mathutil.hpp"
|
|
||||||
#include "sounds.hpp"
|
#include "sounds.hpp"
|
||||||
|
|
||||||
|
#include "boe.consts.hpp"
|
||||||
|
#include "boe.locutils.hpp"
|
||||||
|
#include "boe.graphics.hpp"
|
||||||
|
|
||||||
namespace UI {
|
namespace UI {
|
||||||
cToolbar toolbar;
|
cToolbar toolbar;
|
||||||
}
|
}
|
||||||
@@ -60,6 +63,7 @@ eToolbarButton cToolbar::button_hit(sf::RenderWindow& win, location click) {
|
|||||||
bool done = false, clicked = false;
|
bool done = false, clicked = false;
|
||||||
win.setActive();
|
win.setActive();
|
||||||
active = i;
|
active = i;
|
||||||
|
cFramerateLimiter fps_limiter;
|
||||||
while(!done){
|
while(!done){
|
||||||
redraw_screen(REFRESH_NONE);
|
redraw_screen(REFRESH_NONE);
|
||||||
while(win.pollEvent(e)) {
|
while(win.pollEvent(e)) {
|
||||||
@@ -79,6 +83,8 @@ eToolbarButton cToolbar::button_hit(sf::RenderWindow& win, location click) {
|
|||||||
active = toolbar[i].bounds.contains(toPos) ? i : -1;
|
active = toolbar[i].bounds.contains(toPos) ? i : -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!done)
|
||||||
|
fps_limiter.frame_finished();
|
||||||
}
|
}
|
||||||
play_sound(37, time_in_ticks(5));
|
play_sound(37, time_in_ticks(5));
|
||||||
redraw_screen(REFRESH_NONE);
|
redraw_screen(REFRESH_NONE);
|
||||||
|
Reference in New Issue
Block a user