summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/geometry_type.hpp7
-rw-r--r--src/os/macosx/osx_stdafx.h4
-rw-r--r--src/video/cocoa/cocoa_v.h2
-rw-r--r--src/video/cocoa/cocoa_v.mm7
-rw-r--r--src/video/cocoa/event.mm5
-rw-r--r--src/video/cocoa/fullscreen.mm5
-rw-r--r--src/video/cocoa/wnd_quartz.mm9
-rw-r--r--src/video/cocoa/wnd_quickdraw.mm9
8 files changed, 30 insertions, 18 deletions
diff --git a/src/core/geometry_type.hpp b/src/core/geometry_type.hpp
index d6cd225dd..be89acdb7 100644
--- a/src/core/geometry_type.hpp
+++ b/src/core/geometry_type.hpp
@@ -10,6 +10,13 @@
#define Point OTTD_Point
#endif /* __AMIGA__ */
+#if defined(__APPLE__)
+ /* Mac OS X already has both Rect and Point declared */
+ #define Rect OTTD_Rect
+ #define Point OTTD_Point
+#endif /* __APPLE__ */
+
+
struct Point {
int x;
int y;
diff --git a/src/os/macosx/osx_stdafx.h b/src/os/macosx/osx_stdafx.h
index 9567d70ba..3de85799e 100644
--- a/src/os/macosx/osx_stdafx.h
+++ b/src/os/macosx/osx_stdafx.h
@@ -10,9 +10,7 @@
#undef true
/* Name conflict */
-#define Rect OTTDRect
-#define Point OTTDPoint
-#define GetTime OTTDGetTime
+#define GetTime OTTD_GetTime
#define SL_ERROR OSX_SL_ERROR
diff --git a/src/video/cocoa/cocoa_v.h b/src/video/cocoa/cocoa_v.h
index 34b931261..c37a1691d 100644
--- a/src/video/cocoa/cocoa_v.h
+++ b/src/video/cocoa/cocoa_v.h
@@ -40,7 +40,7 @@ public:
virtual void MakeDirty(int left, int top, int width, int height) = 0;
virtual void UpdatePalette(uint first_color, uint num_colors) = 0;
- virtual uint ListModes(OTTDPoint* modes, uint max_modes) = 0;
+ virtual uint ListModes(OTTD_Point* modes, uint max_modes) = 0;
virtual bool ChangeResolution(int w, int h) = 0;
diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm
index 90434c5d6..3ca9f8113 100644
--- a/src/video/cocoa/cocoa_v.mm
+++ b/src/video/cocoa/cocoa_v.mm
@@ -57,12 +57,11 @@ extern "C" OSErr CPSSetFrontProcess(CPSProcessSerNum* psn);
#include "../../openttd.h"
#include "../../debug.h"
#include "../../variables.h"
+#include "../../core/geometry_type.hpp"
#include "cocoa_v.h"
#include "../../blitter/factory.hpp"
#include "../../fileio.h"
-
-#undef Point
-#undef Rect
+#include "../../gfx_func.h"
@interface OTTDMain : NSObject
@@ -199,7 +198,7 @@ static void setupApplication()
static void QZ_UpdateVideoModes()
{
uint i, count;
- OTTDPoint modes[32];
+ OTTD_Point modes[32];
assert(_cocoa_subdriver != NULL);
diff --git a/src/video/cocoa/event.mm b/src/video/cocoa/event.mm
index 76e148e9a..a76754d0d 100644
--- a/src/video/cocoa/event.mm
+++ b/src/video/cocoa/event.mm
@@ -40,12 +40,13 @@
#include "../../debug.h"
#include "../../os/macosx/splash.h"
#include "../../variables.h"
+#include "../../core/geometry_type.hpp"
#include "cocoa_v.h"
#include "cocoa_keys.h"
#include "../../blitter/factory.hpp"
+#include "../../gfx_func.h"
+#include "../../network/network.h"
-#undef Point
-#undef Rect
/* Right Mouse Button Emulation enum */
enum {
diff --git a/src/video/cocoa/fullscreen.mm b/src/video/cocoa/fullscreen.mm
index f7612f6c9..4eb404a16 100644
--- a/src/video/cocoa/fullscreen.mm
+++ b/src/video/cocoa/fullscreen.mm
@@ -42,9 +42,10 @@ extern "C" void HideMenuBar();
#include "../../stdafx.h"
#include "../../debug.h"
#include "../../variables.h"
+#include "../../core/geometry_type.hpp"
#include "cocoa_v.h"
+#include "../../gfx_func.h"
-#undef Point
#undef Rect
@@ -447,7 +448,7 @@ public:
CGDisplaySetPalette(display_id, palette);
}
- virtual uint ListModes(OTTDPoint* modes, uint max_modes)
+ virtual uint ListModes(OTTD_Point* modes, uint max_modes)
{
CFArrayRef mode_list;
CFIndex num_modes;
diff --git a/src/video/cocoa/wnd_quartz.mm b/src/video/cocoa/wnd_quartz.mm
index 00a8ad9ba..a04ba909e 100644
--- a/src/video/cocoa/wnd_quartz.mm
+++ b/src/video/cocoa/wnd_quartz.mm
@@ -40,9 +40,12 @@
#include "../../stdafx.h"
#include "../../debug.h"
#include "../../variables.h"
+#include "../../core/geometry_type.hpp"
#include "cocoa_v.h"
+#include "../../functions.h"
+#include "../../core/math_func.hpp"
+#include "../../gfx_func.h"
-#undef Point
#undef Rect
@@ -136,7 +139,7 @@ public:
virtual void MakeDirty(int left, int top, int width, int height);
virtual void UpdatePalette(uint first_color, uint num_colors);
- virtual uint ListModes(OTTDPoint* modes, uint max_modes);
+ virtual uint ListModes(OTTD_Point* modes, uint max_modes);
virtual bool ChangeResolution(int w, int h);
@@ -657,7 +660,7 @@ void WindowQuartzSubdriver::UpdatePalette(uint first_color, uint num_colors)
num_dirty_rects = MAX_DIRTY_RECTS;
}
-uint WindowQuartzSubdriver::ListModes(OTTDPoint* modes, uint max_modes)
+uint WindowQuartzSubdriver::ListModes(OTTD_Point* modes, uint max_modes)
{
if (max_modes == 0) return 0;
diff --git a/src/video/cocoa/wnd_quickdraw.mm b/src/video/cocoa/wnd_quickdraw.mm
index 35d4bae0d..8c1455ba6 100644
--- a/src/video/cocoa/wnd_quickdraw.mm
+++ b/src/video/cocoa/wnd_quickdraw.mm
@@ -40,9 +40,12 @@
#include "../../stdafx.h"
#include "../../debug.h"
#include "../../variables.h"
+#include "../../core/geometry_type.hpp"
#include "cocoa_v.h"
+#include "../../functions.h"
+#include "../../core/math_func.hpp"
+#include "../../gfx_func.h"
-#undef Point
#undef Rect
@@ -151,7 +154,7 @@ public:
virtual void MakeDirty(int left, int top, int width, int height);
virtual void UpdatePalette(uint first_color, uint num_colors);
- virtual uint ListModes(OTTDPoint* modes, uint max_modes);
+ virtual uint ListModes(OTTD_Point* modes, uint max_modes);
virtual bool ChangeResolution(int w, int h);
@@ -682,7 +685,7 @@ void WindowQuickdrawSubdriver::UpdatePalette(uint first_color, uint num_colors)
num_dirty_rects = MAX_DIRTY_RECTS;
}
-uint WindowQuickdrawSubdriver::ListModes(OTTDPoint* modes, uint max_modes)
+uint WindowQuickdrawSubdriver::ListModes(OTTD_Point* modes, uint max_modes)
{
if (max_modes == 0) return 0;