fix mac compiling, fix renderer, fix other minor compiling issues

This commit is contained in:
jacob1 2013-02-14 23:31:31 -05:00
parent 5807602cc1
commit 01cd146ee9
7 changed files with 17 additions and 4 deletions

View File

@ -17,7 +17,6 @@
#endif
#ifdef MACOSX
#include <mach-o/dyld.h>
#include <ApplicationServices/ApplicationServices.h>
#endif
std::string URLEscape(std::string source)

View File

@ -3,3 +3,4 @@
void EngineProcess();
void ClipboardPush(char * text);
char * ClipboardPull();
int GetModifiers();

View File

@ -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)
{

View File

@ -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;

View File

@ -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)

View File

@ -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();

View File

@ -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;