OSX: try to correct some dialog and minimap problems...

This commit is contained in:
Laurent Alonso(fr)
2020-04-28 13:17:52 +02:00
committed by Celtic Minstrel
parent 224e89aabc
commit 18185fe873
4 changed files with 8 additions and 5 deletions

View File

@@ -542,6 +542,7 @@ void cDialog::run(std::function<void(cDialog&)> onopen){
currentFocus = iter->first;
}
}
#if 0
// Sometimes it seems like the Cocoa menu handling clobbers the active rendering context.
// For whatever reason, delaying 100 milliseconds appears to fix this.
sf::sleep(sf::milliseconds(100));
@@ -549,6 +550,7 @@ void cDialog::run(std::function<void(cDialog&)> onopen){
// Instantiating a window and then closing it seems to fix the update error, because magic.
win.create(sf::VideoMode(1,1),"");
win.close();
#endif
win.create(sf::VideoMode(winRect.width(), winRect.height()), "Dialog", sf::Style::Titlebar);
win.setPosition({parentPos.x + int(parentSz.x - winRect.width()) / 2, parentPos.y + int(parentSz.y - winRect.height()) / 2});
draw();
@@ -1047,7 +1049,7 @@ xBadVal::~xBadVal() throw(){
bool cDialog::doAnimations = false;
void cDialog::draw(){
win.setActive();
win.setActive(false);
tileImage(win,winRect,::bg[bg]);
if(doAnimations && animTimer.getElapsedTime().asMilliseconds() >= 500) {
cPict::advanceAnim();
@@ -1060,6 +1062,7 @@ void cDialog::draw(){
iter++;
}
win.setActive();
win.display();
}

View File

@@ -226,7 +226,7 @@ void cControl::setFormat(eFormat prop, short val) {
newVal = eFrameStyle(val);
break;
case TXT_COLOUR: // Interpret as a shade of grey
newVal = sf::Color{val, val, val};
newVal = sf::Color{sf::Uint8(val), sf::Uint8(val), sf::Uint8(val)};
break;
}
if(!manageFormat(prop, true, &newVal))

View File

@@ -26,7 +26,7 @@
// Standard C++ Library".
// ============================================================================
#include <gzstream.h>
#include "gzstream.h"
#include <iostream>
#include <string.h> // for memcpy

View File

@@ -1474,7 +1474,7 @@ void draw_map(bool need_refresh) {
map_gworld.display();
}
mini_map.setActive();
mini_map.setActive(false);
// Now place terrain map gworld
TextStyle style;
@@ -1528,7 +1528,7 @@ void draw_map(bool need_refresh) {
}
}
}
mini_map.setActive();
mini_map.display();
// Now exit gracefully