Mercurial > hg > openttd
changeset 8127:7bdaba97d085 draft
(svn r11688) -Fix [FS#1581]: Compilation was broken on OS X again.
author | egladil <egladil@openttd.org> |
---|---|
date | Sun, 23 Dec 2007 18:08:39 +0000 |
parents | 357c22303fd6 |
children | c4f75b4136a0 |
files | src/core/geometry_type.hpp src/os/macosx/osx_stdafx.h src/video/cocoa/cocoa_v.h src/video/cocoa/cocoa_v.mm src/video/cocoa/event.mm src/video/cocoa/fullscreen.mm src/video/cocoa/wnd_quartz.mm src/video/cocoa/wnd_quickdraw.mm |
diffstat | 8 files changed, 30 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- 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;
--- 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
--- a/src/video/cocoa/cocoa_v.h +++ b/src/video/cocoa/cocoa_v.h @@ -40,7 +40,7 @@ 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;
--- a/src/video/cocoa/cocoa_v.mm +++ b/src/video/cocoa/cocoa_v.mm @@ -57,12 +57,11 @@ #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 QZ_UpdateVideoModes() { uint i, count; - OTTDPoint modes[32]; + OTTD_Point modes[32]; assert(_cocoa_subdriver != NULL);
--- 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 {
--- a/src/video/cocoa/fullscreen.mm +++ b/src/video/cocoa/fullscreen.mm @@ -42,9 +42,10 @@ #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 @@ 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;
--- 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 @@ 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 @@ 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;
--- 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 @@ 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 @@ 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;