mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-14 18:15:28 -04:00
Mac: Fix cocoa backend not compiling on 32 bit
This commit is contained in:
parent
1f1b9f983d
commit
11d21a711a
@ -20,7 +20,7 @@ extern void Window_CommonInit(void);
|
|||||||
extern int MapNativeKey(UInt32 key);
|
extern int MapNativeKey(UInt32 key);
|
||||||
|
|
||||||
static void RefreshWindowBounds(void) {
|
static void RefreshWindowBounds(void) {
|
||||||
CGRect win, view;
|
NSRect win, view;
|
||||||
int viewY;
|
int viewY;
|
||||||
|
|
||||||
win = [winHandle frame];
|
win = [winHandle frame];
|
||||||
@ -102,7 +102,7 @@ static void DoDrawFramebuffer(CGRect dirty);
|
|||||||
|
|
||||||
|
|
||||||
static void MakeContentView(void) {
|
static void MakeContentView(void) {
|
||||||
CGRect rect;
|
NSRect rect;
|
||||||
NSView* view;
|
NSView* view;
|
||||||
|
|
||||||
view = [winHandle contentView];
|
view = [winHandle contentView];
|
||||||
@ -153,7 +153,7 @@ static void ApplyIcon(void) { }
|
|||||||
#define WIN_MASK (NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask | NSMiniaturizableWindowMask)
|
#define WIN_MASK (NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask | NSMiniaturizableWindowMask)
|
||||||
void Window_Create(int width, int height) {
|
void Window_Create(int width, int height) {
|
||||||
CCWindowDelegate* del;
|
CCWindowDelegate* del;
|
||||||
CGRect rect;
|
NSRect rect;
|
||||||
|
|
||||||
/* Technically the coordinates for the origin are at bottom left corner */
|
/* Technically the coordinates for the origin are at bottom left corner */
|
||||||
/* But since the window is in centre of the screen, don't need to care here */
|
/* But since the window is in centre of the screen, don't need to care here */
|
||||||
@ -213,7 +213,7 @@ cc_result Window_ExitFullscreen(void) {
|
|||||||
|
|
||||||
void Window_SetSize(int width, int height) {
|
void Window_SetSize(int width, int height) {
|
||||||
/* Can't use setContentSize:, because that resizes from the bottom left corner. */
|
/* Can't use setContentSize:, because that resizes from the bottom left corner. */
|
||||||
CGRect rect = [winHandle frame];
|
NSRect rect = [winHandle frame];
|
||||||
|
|
||||||
rect.origin.y += WindowInfo.Height - height;
|
rect.origin.y += WindowInfo.Height - height;
|
||||||
rect.size.width += width - WindowInfo.Width;
|
rect.size.width += width - WindowInfo.Width;
|
||||||
@ -257,7 +257,7 @@ static void ProcessKeyChars(id ev) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static cc_bool GetMouseCoords(int* x, int* y) {
|
static cc_bool GetMouseCoords(int* x, int* y) {
|
||||||
CGPoint loc = [NSEvent mouseLocation];
|
NSPoint loc = [NSEvent mouseLocation];
|
||||||
*x = (int)loc.x - windowX;
|
*x = (int)loc.x - windowX;
|
||||||
*y = (DisplayInfo.Height - (int)loc.y) - windowY;
|
*y = (DisplayInfo.Height - (int)loc.y) - windowY;
|
||||||
// TODO: this seems to be off by 1
|
// TODO: this seems to be off by 1
|
||||||
@ -413,7 +413,7 @@ static void DoDrawFramebuffer(CGRect dirty) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Window_DrawFramebuffer(Rect2D r) {
|
void Window_DrawFramebuffer(Rect2D r) {
|
||||||
CGRect rect;
|
NSRect rect;
|
||||||
rect.origin.x = r.X;
|
rect.origin.x = r.X;
|
||||||
rect.origin.y = WindowInfo.Height - r.Y - r.Height;
|
rect.origin.y = WindowInfo.Height - r.Y - r.Height;
|
||||||
rect.size.width = r.Width;
|
rect.size.width = r.Width;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user