summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-02-15 04:31:31 (GMT)
committer jacob1 <jfu614@gmail.com>2013-02-15 04:31:31 (GMT)
commit01cd146ee910fb9e62859583842c9842b539565b (patch)
treed87346317f1a7c7110ffa993b0680a0d393d1198 /src
parent5807602cc1ec326f3ca33f3130d35b22082378ec (diff)
downloadpowder-01cd146ee910fb9e62859583842c9842b539565b.zip
powder-01cd146ee910fb9e62859583842c9842b539565b.tar.gz
fix mac compiling, fix renderer, fix other minor compiling issues
Diffstat (limited to 'src')
-rw-r--r--src/Misc.cpp1
-rw-r--r--src/PowderToy.h1
-rw-r--r--src/PowderToyRenderer.cpp1
-rw-r--r--src/PowderToySDL.cpp8
-rw-r--r--src/cat/LuaScriptInterface.cpp4
-rw-r--r--src/client/Client.cpp2
-rw-r--r--src/graphics/Renderer.cpp4
7 files changed, 17 insertions, 4 deletions
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 <mach-o/dyld.h>
-#include <ApplicationServices/ApplicationServices.h>
#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<char> & 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 <unistd.h>
#endif
+#ifdef MACOSX
+#include <ApplicationServices/ApplicationServices.h>
+#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 <unistd.h>
#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;