diff --git a/src/game/boe.actions.cpp b/src/game/boe.actions.cpp index e3d094f9..adda44aa 100644 --- a/src/game/boe.actions.cpp +++ b/src/game/boe.actions.cpp @@ -1593,7 +1593,9 @@ bool handle_keystroke(const sf::Event& event){ abort = false; if (abort) { play_sound(37); - add_string_to_buf("Cancelled."); + add_string_to_buf(" Cancelled."); + if (overall_mode==MODE_COMBAT) + center = univ.current_pc().combat_pos; print_buf(); obscureCursor(); return false; diff --git a/src/game/boe.dlgutil.cpp b/src/game/boe.dlgutil.cpp index e1e2f7ec..435c16e6 100644 --- a/src/game/boe.dlgutil.cpp +++ b/src/game/boe.dlgutil.cpp @@ -52,7 +52,6 @@ extern location center; extern std::shared_ptr text_sbar,item_sbar,shop_sbar; extern std::shared_ptr done_btn, help_btn; extern bool map_visible; -extern sf::RenderWindow mini_map; extern cUniverse univ; extern sf::Texture pc_gworld; extern std::map skill_max; diff --git a/src/game/boe.graphics.cpp b/src/game/boe.graphics.cpp index 7695ab08..ba99fd6e 100644 --- a/src/game/boe.graphics.cpp +++ b/src/game/boe.graphics.cpp @@ -756,7 +756,7 @@ void draw_terrain(short mode) { where_draw.x += i - 6; where_draw.y += j - 6; if(!(is_out())) - light_area[i][j] = (is_town()) ? (can_see_light(view_loc,where_draw,sight_obscurity)<=4) : combat_pt_in_light(where_draw); + light_area[i][j] = is_town() ? can_see_light(view_loc,where_draw,sight_obscurity)<=4 : combat_pt_in_light(where_draw); if((where_draw.x < 0) || (where_draw.x > max_dim - 1) || (where_draw.y < 0) || (where_draw.y > max_dim - 1)) unexplored_area[i][j] = 0; diff --git a/src/game/boe.graphutil.cpp b/src/game/boe.graphutil.cpp index b8080e33..fb857035 100644 --- a/src/game/boe.graphutil.cpp +++ b/src/game/boe.graphutil.cpp @@ -30,7 +30,6 @@ extern eGameMode overall_mode; extern short current_spell_range; extern cUniverse univ; extern effect_pat_type current_pat; -extern sf::RenderWindow mini_map; extern short combat_posing_monster , current_working_monster ; // 0-5 PC 100 + x - monster x extern sf::RenderTexture terrain_screen_gworld; diff --git a/src/game/boe.newgraph.cpp b/src/game/boe.newgraph.cpp index c6f7befa..294807f7 100644 --- a/src/game/boe.newgraph.cpp +++ b/src/game/boe.newgraph.cpp @@ -155,7 +155,9 @@ void apply_unseen_mask() { void apply_light_mask(bool onWindow) { static Region dark_mask_region; rectangle temp = {0,0,108,84},paint_rect,base_rect = {0,0,36,28}; - rectangle big_to = {13,13,337,265}; + // I correct the values to make the display ok + // but I am not sure what are the correct values + rectangle big_to = {13+2,13+14,337+3,265+15}; bool same_mask = true; if(!get_bool_pref("DrawTerrainFrills", true) || fog_lifted) return; @@ -174,18 +176,16 @@ void apply_light_mask(bool onWindow) { // Process the light array for(short i = 1; i < 12; i++) for(short j = 1; j < 12; j++) - if((light_area[i - 1][j - 1] >= 1) && (light_area[i + 1][j - 1] >= 1) && - (light_area[i - 1][j] >= 1) && (light_area[i + 1][j] >= 1) && - (light_area[i - 1][j + 1] >= 1) && (light_area[i + 1][j + 1] >= 1) && - (light_area[i][j - 1] >= 1) && (light_area[i][j + 1] >= 1)) { + if(light_area[i-1][j-1] >= 1 && light_area[i][j-1] >= 1 && light_area[i+1][j-1]>=1 && + light_area[i-1][j+0] >= 1 && light_area[i][j+0] >= 1 && light_area[i+1][j+0]>=1 && + light_area[i-1][j+1] >= 1 && light_area[i][j+1] >= 1 && light_area[i+1][j+1]>=1) { light_area[i][j] = 2; } for(short i = 1; i < 12; i++) for(short j = 1; j < 12; j++) - if((light_area[i - 1][j - 1] >= 2) && (light_area[i + 1][j - 1] >= 2) && - (light_area[i - 1][j] >= 2) && (light_area[i + 1][j] >= 2) && - (light_area[i - 1][j + 1] >= 2) && (light_area[i + 1][j + 1] >= 2) && - (light_area[i][j - 1] >= 2) && (light_area[i][j + 1] >= 2)) { + if(light_area[i-1][j-1] >= 2 && light_area[i][j-1] >= 2 && light_area[i+1][j-1]>=2 && + light_area[i-1][j+0] >= 2 && light_area[i][j+0] >= 2 && light_area[i+1][j+0]>=2 && + light_area[i-1][j+1] >= 2 && light_area[i][j+1] >= 2 && light_area[i+1][j+1]>=2) { light_area[i][j] = 3; } @@ -213,7 +213,8 @@ void apply_light_mask(bool onWindow) { for(short i = 1; i < 12; i++) for(short j = 1; j < 12; j++) { if(light_area[i][j] == 2) { - int xOffset = 13 + 28 * (i - 3), yOffset = 13 + 36 * (j - 3); + // UNSURE WHY 28+...,18+... seems to gives better result that 13+...,13+... + int xOffset = 28 + 28 * (i - 3), yOffset = 18 + 36 * (j - 3); Region oval_region; oval_region.addEllipse(temp); oval_region.offset(xOffset, yOffset); diff --git a/src/game/boe.town.cpp b/src/game/boe.town.cpp index 35b174cd..7a71f022 100644 --- a/src/game/boe.town.cpp +++ b/src/game/boe.town.cpp @@ -1214,11 +1214,6 @@ bool does_location_have_special(cOutdoors& sector, location loc, eTerSpec specia void clear_map() { rectangle map_world_rect(map_gworld); -// if(!map_visible) { -// return; -// } -// draw_map(mini_map,11); - fill_rect(map_gworld, map_world_rect, sf::Color::Black); } diff --git a/src/pcedit/pc.main.cpp b/src/pcedit/pc.main.cpp index 75307940..b5b28f35 100644 --- a/src/pcedit/pc.main.cpp +++ b/src/pcedit/pc.main.cpp @@ -169,7 +169,7 @@ void adjust_window (sf::RenderWindow& mainPtr, sf::View& mainView) { // Apply view to the main window mainPtr.setView(mainView); -#ifndef SFML_SYSTEM_MAC // This overrides Dock icon on OSX, which isn't what we want at all +#ifndef __APPLE__ // This overrides Dock icon on OSX, which isn't what we want at all auto const & icon = *ResMgr::textures.get("icon", true); mainPtr.setIcon(icon->getSize().x, icon->getSize().y, icon->copyToImage().getPixelsPtr()); #endif diff --git a/src/scenedit/scen.main.cpp b/src/scenedit/scen.main.cpp index 0fa272db..f4edc924 100644 --- a/src/scenedit/scen.main.cpp +++ b/src/scenedit/scen.main.cpp @@ -190,7 +190,7 @@ void adjust_windows (sf::RenderWindow & mainPtr, sf::View & mainView) { // Apply view to the main window mainPtr.setView(mainView); -#ifndef SFML_SYSTEM_MAC // This overrides Dock icon on OSX, which isn't what we want at all +#ifndef __APPLE__ // This overrides Dock icon on OSX, which isn't what we want at all auto const & icon = *ResMgr::textures.get("icon", true); mainPtr.setIcon(icon->getSize().x, icon->getSize().y, icon->copyToImage().getPixelsPtr()); #endif