Fix Mac build (again)

This commit is contained in:
2014-12-30 17:41:50 -05:00
parent 0b330432b4
commit 099a6a61b0
7 changed files with 21 additions and 21 deletions

View File

@@ -57,4 +57,15 @@ void obscureCursor();
void set_cursor(cursor_type which_curs);
void restore_cursor();
// Filenames for the cursors
static const char*const cursors[25] = {
"wand", "eyedropper", "brush", "spraycan",
"eraser", "topleft", "bottomright", "hand",
"NW", "N", "NE",
"W", "wait", "E",
"SW", "S", "SE",
"sword", "boot", "drop", "target",
"talk", "key", "look", "watch",
};
#endif

View File

@@ -11,6 +11,8 @@
#include <string>
#include "restypes.hpp"
extern cursor_type current_cursor;
static NSImage* imageFromURL(CFURLRef url){
CGImageSourceRef imageSource = CGImageSourceCreateWithURL(url, NULL);
CGImageRef theImage = nil;
@@ -40,7 +42,7 @@ static NSImage* imageFromURL(CFURLRef url){
return newImage;
}
Cursor::Cursor(std::string path, float hotSpotX, float hotSpotY){
Cursor::Cursor(fs::path path, float hotSpotX, float hotSpotY){
FSRef ref;
FSPathMakeRef((UInt8*)path.c_str(), &ref, NULL);
CFURLRef imgPath = CFURLCreateFromFSRef(NULL, &ref);

View File

@@ -8,16 +8,6 @@
extern cursor_type current_cursor;
extern sf::RenderWindow mainPtr;
const std::string cursors[25] = {
"wand", "eyedropper", "brush", "spraycan",
"eraser", "topleft", "bottomright", "hand",
"NW", "N", "NE",
"W", "wait", "E",
"SW", "S", "SE",
"sword", "boot", "drop", "target",
"talk", "key", "look", "watch",
};
static const COLORREF clrMagenta = RGB(255, 0, 255);
// This function adapted from <http://web.archive.org/web/20130502044728/http://marknelson.us/2002/07/01/rendering-transparent-gifs-revisited/>

View File

@@ -39,7 +39,7 @@ int getMenubarHeight();
class ModalSession {
void* session;
sf::Window& parent;
sf::Window* parent;
public:
void pumpEvents();
ModalSession(sf::Window& win, sf::Window& parent);

View File

@@ -105,7 +105,7 @@ void setWindowFloating(sf::Window& win, bool floating) {
}
}
ModalSession::ModalSession(sf::Window& win) {
ModalSession::ModalSession(sf::Window& win, sf::Window& /*parent*/) {
sf::WindowHandle handle = win.getSystemHandle();
id nsHandle = id(handle);
if([nsHandle isKindOfClass: [NSWindow class]])

View File

@@ -200,15 +200,15 @@ void ModalSession::pumpEvents() {
HWND win_handle = (HWND)session;
}
ModalSession::ModalSession(sf::Window& win, sf::Window& parent) : parent(parent) {
ModalSession::ModalSession(sf::Window& win, sf::Window& parent) : parent(&parent) {
session = win.getSystemHandle();
EnableWindow(parent.getSystemHandle(), false);
EnableWindow(parent->getSystemHandle(), false);
}
ModalSession::~ModalSession() {
HWND win_handle = (HWND)session;
EnableWindow(parent.getSystemHandle(), true);
RedrawWindow(parent.getSystemHandle(), NULL, NULL, RDW_NOCHILDREN | RDW_UPDATENOW);
EnableWindow(parent->getSystemHandle(), true);
RedrawWindow(parent->getSystemHandle(), NULL, NULL, RDW_NOCHILDREN | RDW_UPDATENOW);
}
void set_up_apple_events() {