OSX: try to correct some dialog and minimap problems...
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
@@ -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))
|
||||
|
@@ -26,7 +26,7 @@
|
||||
// Standard C++ Library".
|
||||
// ============================================================================
|
||||
|
||||
#include <gzstream.h>
|
||||
#include "gzstream.h"
|
||||
#include <iostream>
|
||||
#include <string.h> // for memcpy
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user