From 01cd146ee910fb9e62859583842c9842b539565b Mon Sep 17 00:00:00 2001 From: jacob1 Date: Thu, 14 Feb 2013 23:31:31 -0500 Subject: fix mac compiling, fix renderer, fix other minor compiling issues diff --git a/src/Misc.cpp b/src/Misc.cpp index 8c18871..3128691 100644 --- a/src/Misc.cpp +++ b/src/Misc.cpp @@ -17,7 +17,6 @@ #endif #ifdef MACOSX #include -#include #endif std::string URLEscape(std::string source) diff --git a/src/PowderToy.h b/src/PowderToy.h index 9141dbb..3b6170c 100644 --- a/src/PowderToy.h +++ b/src/PowderToy.h @@ -3,3 +3,4 @@ void EngineProcess(); void ClipboardPush(char * text); char * ClipboardPull(); +int GetModifiers(); diff --git a/src/PowderToyRenderer.cpp b/src/PowderToyRenderer.cpp index 9dbf010..b5b7fa1 100644 --- a/src/PowderToyRenderer.cpp +++ b/src/PowderToyRenderer.cpp @@ -20,6 +20,7 @@ void EngineProcess() {} void ClipboardPush(char * text) {} char * ClipboardPull() {} +int GetModifiers() { return 0; } void readFile(std::string filename, std::vector & storage) { diff --git a/src/PowderToySDL.cpp b/src/PowderToySDL.cpp index 4b50a24..48a77b2 100644 --- a/src/PowderToySDL.cpp +++ b/src/PowderToySDL.cpp @@ -20,6 +20,9 @@ #ifndef WIN #include #endif +#ifdef MACOSX +#include +#endif #include "Format.h" #include "Style.h" @@ -540,6 +543,11 @@ void EngineProcess() #endif } +int GetModifiers() +{ + return SDL_GetModState(); +} + int main(int argc, char * argv[]) { currentWidth = XRES+BARSIZE; diff --git a/src/cat/LuaScriptInterface.cpp b/src/cat/LuaScriptInterface.cpp index b4ce48a..a3fe00b 100644 --- a/src/cat/LuaScriptInterface.cpp +++ b/src/cat/LuaScriptInterface.cpp @@ -25,6 +25,7 @@ #include "game/Tool.h" #include "LuaScriptHelper.h" #include "client/HTTP.h" +#include "PowderToy.h" //#include "virtualmachine/VirtualMachine.h" #include "pim/Parser.h" @@ -43,7 +44,6 @@ #ifndef WIN #include #endif -#include "SDL.h" extern "C" { @@ -1888,7 +1888,7 @@ bool LuaScriptInterface::OnMouseWheel(int x, int y, int d) bool LuaScriptInterface::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt) { - return luacon_keyevent(key, SDL_GetModState(), LUACON_KDOWN); + return luacon_keyevent(key, GetModifiers(), LUACON_KDOWN); } bool LuaScriptInterface::OnKeyRelease(int key, Uint16 character, bool shift, bool ctrl, bool alt) diff --git a/src/client/Client.cpp b/src/client/Client.cpp index 75e01eb..8a82515 100644 --- a/src/client/Client.cpp +++ b/src/client/Client.cpp @@ -659,6 +659,7 @@ void Client::Tick() this->messageOfTheDay = messageOfTheDay.Value(); notifyMessageOfTheDay(); +#ifndef IGNORE_UPDATES //Check for updates json::Object versions = objDocument["Updates"]; @@ -701,7 +702,6 @@ void Client::Tick() } #endif -#ifndef IGNORE_UPDATES if(updateAvailable) { notifyUpdateAvailable(); diff --git a/src/graphics/Renderer.cpp b/src/graphics/Renderer.cpp index 86c0c58..486a0d4 100644 --- a/src/graphics/Renderer.cpp +++ b/src/graphics/Renderer.cpp @@ -1218,11 +1218,15 @@ void Renderer::render_parts() { if (elements[t].Graphics) { +#ifndef RENDERER if (lua_gr_func[t]) { luacon_graphicsReplacement(this, &(sim->parts[i]), nx, ny, &pixel_mode, &cola, &colr, &colg, &colb, &firea, &firer, &fireg, &fireb, i); } else if ((*(elements[t].Graphics))(this, &(sim->parts[i]), nx, ny, &pixel_mode, &cola, &colr, &colg, &colb, &firea, &firer, &fireg, &fireb)) //That's a lot of args, a struct might be better +#else + if ((*(elements[t].Graphics))(this, &(sim->parts[i]), nx, ny, &pixel_mode, &cola, &colr, &colg, &colb, &firea, &firer, &fireg, &fireb)) //That's a lot of args, a struct might be better +#endif { graphicscache[t].isready = 1; graphicscache[t].pixel_mode = pixel_mode; -- cgit v0.9.2-21-gd62e