Fix Windows build
This commit is contained in:
@@ -2027,7 +2027,8 @@ bool handle_keystroke(sf::Event& event){
|
||||
break;
|
||||
case 'a': // Show automap
|
||||
if(overall_mode < MODE_TALK_TOWN) {
|
||||
pass_point = mainPtr.mapCoordsToPixel({overall_mode == MODE_OUTDOORS ? 180 : 221, 405}, mainView);
|
||||
pass_point = loc(overall_mode == MODE_OUTDOORS ? 180 : 221, 405);
|
||||
pass_point = mainPtr.mapCoordsToPixel(pass_point, mainView);
|
||||
pass_event.mouseButton.x = pass_point.x;
|
||||
pass_event.mouseButton.y = pass_point.y;
|
||||
are_done = handle_action(pass_event);
|
||||
@@ -2045,7 +2046,8 @@ bool handle_keystroke(sf::Event& event){
|
||||
|
||||
case 'b': case 'L': // Bash door, pick lock
|
||||
if(overall_mode == MODE_TOWN || overall_mode == MODE_BASH_TOWN) {
|
||||
pass_point = mainPtr.mapCoordsToPixel({chr == 'b' ? 1002 : 1003, 0}, mainView);
|
||||
pass_point = loc(chr == 'b' ? 1002 : 1003, 0);
|
||||
pass_point = mainPtr.mapCoordsToPixel(pass_point, mainView);
|
||||
pass_event.mouseButton.x = pass_point.x;
|
||||
pass_event.mouseButton.y = pass_point.y;
|
||||
are_done = handle_action(pass_event);
|
||||
|
@@ -149,6 +149,9 @@ void adjust_window_mode() {
|
||||
}
|
||||
|
||||
rectangle windRect(mainPtr);
|
||||
#ifdef _WIN32
|
||||
windRect.height() -= menubarHeight;
|
||||
#endif
|
||||
if(mode == 0) {
|
||||
ul.x = (windRect.right - width) / 2;
|
||||
ul.y = (windRect.bottom - height) / 2;
|
||||
@@ -157,13 +160,17 @@ void adjust_window_mode() {
|
||||
ul.x = 10;
|
||||
else ul.x = windRect.right - width - 10;
|
||||
if(mode == 1 || mode == 2)
|
||||
ul.y = 28 + menubarHeight;
|
||||
ul.y = 28
|
||||
#ifndef _WIN32
|
||||
+ menubarHeight;
|
||||
#endif
|
||||
;
|
||||
else ul.y = windRect.bottom - height - 28;
|
||||
}
|
||||
|
||||
// Initialize the viewport for the game UI
|
||||
mainView.setSize(width, height);
|
||||
mainView.setCenter(/*ul.x +*/ width / 2, /*ul.y +*/ height / 2);
|
||||
mainView.setCenter(width / 2, height / 2);
|
||||
sf::FloatRect mainPort;
|
||||
mainPort.left = float(ul.x) / windRect.width();
|
||||
mainPort.top = float(ul.y) / windRect.height();
|
||||
|
Reference in New Issue
Block a user