diff --git a/.gitignore b/.gitignore index 1e4b2a2..3aeb5b3 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,8 @@ docs/doxygen/docs/* win32/Lephisto/* win32/Pack/* win32/Makefile + +# Qt crap. +qt/*.user +qt/Makefile + diff --git a/qt/qt.pro b/qt/qt.pro new file mode 100644 index 0000000..778c373 --- /dev/null +++ b/qt/qt.pro @@ -0,0 +1,180 @@ +TEMPLATE = app +TARGET = Lephisto +DEPENDPATH += . \ + .. \ + ../src \ + ../lib/lua \ + ../utils/mkspr \ + ../utils/pack \ + +# ../win32/ext/include/AL \ +# ../win32/ext/include/SDL + +INCLUDEPATH += . \ + ../lib/lua \ + ../src \ + /usr/include/libxml2 \ + #../win32/ext/include/SDL \ + /usr/include/freetype2 + +MY_DEFINES = $$VERSION = -DVMAJOR=$(VMAJOR) -DVMINOR=$(VMINOR) -DVREV=$(VREV) + +# Input +HEADERS += ../src/ai.h \ + ../src/base64.h \ + ../src/board.h \ + ../src/collision.h \ + ../src/colour.h \ + ../src/conf.h \ + ../src/economy.h \ + ../src/faction.h \ + ../src/font.h \ + ../src/hook.h \ + ../src/input.h \ + ../src/joystick.h \ + ../src/land.h \ + ../src/lephisto.h \ + ../src/lfile.h \ + ../src/llua.h \ + ../src/llua_space.h \ + ../src/lluadef.h \ + ../src/log.h \ + ../src/ltime.h \ + ../src/map.h \ + ../src/md5.h \ + ../src/menu.h \ + ../src/misn_lua.h \ + ../src/mission.h \ + ../src/music.h \ + ../src/nebulae.h \ + ../src/opengl.h \ + ../src/outfit.h \ + ../src/pack.h \ + ../src/pause.h \ + ../src/perlin.h \ + ../src/physics.h \ + ../src/pilot.h \ + ../src/plasmaf.h \ + ../src/player.h \ + ../src/rng.h \ + ../src/save.h \ + ../src/ship.h \ + ../src/sound.h \ + ../src/space.h \ + ../src/spfx.h \ + ../src/toolkit.h \ + ../src/weapon.h \ + ../src/xml.h \ + ../lib/lua/lapi.h \ + ../lib/lua/lauxlib.h \ + ../lib/lua/lcode.h \ + ../lib/lua/ldebug.h \ + ../lib/lua/ldo.h \ + ../lib/lua/lfunc.h \ + ../lib/lua/lgc.h \ + ../lib/lua/llex.h \ + ../lib/lua/llimits.h \ + ../lib/lua/lmem.h \ + ../lib/lua/lobject.h \ + ../lib/lua/lopcodes.h \ + ../lib/lua/lparser.h \ + ../lib/lua/lstate.h \ + ../lib/lua/lstring.h \ + ../lib/lua/ltable.h \ + ../lib/lua/ltm.h \ + ../lib/lua/lua.h \ + ../lib/lua/luaconf.h \ + ../lib/lua/lualib.h \ + ../lib/lua/lundump.h \ + ../lib/lua/lvm.h \ + ../lib/lua/lzio.h \ + ../utils/pack/md5.h \ + +SOURCES += ../src/ai.c \ + ../src/base64.c \ + ../src/board.c \ + ../src/collision.c \ + ../src/colour.c \ + ../src/conf.c \ + ../src/economy.c \ + ../src/faction.c \ + ../src/font.c \ + ../src/hook.c \ + ../src/input.c \ + ../src/joystick.c \ + ../src/land.c \ + ../src/lephisto.c \ + ../src/lfile.c \ + ../src/llua.c \ + ../src/llua_space.c \ + ../src/ltime.c \ + ../src/map.c \ + ../src/md5.c \ + ../src/menu.c \ + ../src/misn_lua.c \ + ../src/mission.c \ + ../src/music.c \ + ../src/nebulae.c \ + ../src/opengl.c \ + ../src/outfit.c \ + ../src/pack.c \ + ../src/pause.c \ + ../src/perlin.c \ + ../src/physics.c \ + ../src/pilot.c \ + ../src/plasmaf.c \ + ../src/player.c \ + ../src/rng.c \ + ../src/save.c \ + ../src/ship.c \ + ../src/sound.c \ + ../src/space.c \ + ../src/spfx.c \ + ../src/toolkit.c \ + ../src/weapon.c \ + ../lib/lua/lapi.c \ + ../lib/lua/lauxlib.c \ + ../lib/lua/lbaselib.c \ + ../lib/lua/lcode.c \ + ../lib/lua/ldblib.c \ + ../lib/lua/ldebug.c \ + ../lib/lua/ldo.c \ + ../lib/lua/ldump.c \ + ../lib/lua/lfunc.c \ + ../lib/lua/lgc.c \ + ../lib/lua/linit.c \ + ../lib/lua/liolib.c \ + ../lib/lua/llex.c \ + ../lib/lua/lmathlib.c \ + ../lib/lua/lmem.c \ + ../lib/lua/loadlib.c \ + ../lib/lua/lobject.c \ + ../lib/lua/lopcodes.c \ + ../lib/lua/loslib.c \ + ../lib/lua/lparser.c \ + ../lib/lua/lstate.c \ + ../lib/lua/lstring.c \ + ../lib/lua/lstrlib.c \ + ../lib/lua/ltable.c \ + ../lib/lua/ltablib.c \ + ../lib/lua/ltm.c \ + ../lib/lua/lua.c \ + ../lib/lua/luac.c \ + ../lib/lua/lundump.c \ + ../lib/lua/lvm.c \ + ../lib/lua/lzio.c \ + ../utils/mkspr/main.c \ + ../utils/pack/main.c \ + ../utils/pack/md5.c + +linux { + LIBS += \ + -lSDL \ + -lSDL_config \ + -lSDL_mixer \ + -lSDL_image \ + -lGL \ + -L/usr/local/lib -lxml2 \ + -L/usr/local/lib -freetype \ + -lpng +} diff --git a/src/input.h b/src/input.h index 4ecd11f..4652083 100644 --- a/src/input.h +++ b/src/input.h @@ -1,5 +1,5 @@ #pragma once -#include +#include /* Input types. */ typedef enum { diff --git a/src/joystick.c b/src/joystick.c index 8e0f612..dc15414 100644 --- a/src/joystick.c +++ b/src/joystick.c @@ -4,7 +4,7 @@ * @brief Handles joystick initialization. */ -#include +#include #include #include "lephisto.h" #include "log.h" @@ -64,7 +64,7 @@ int joystick_use(int indjoystick) { /** * @fn int joystick_init(void) - * + * * @brief Initializes the joystick subsystem. * @return 0 on success. */ diff --git a/src/lephisto.c b/src/lephisto.c index 7d7bc0d..bd907be 100644 --- a/src/lephisto.c +++ b/src/lephisto.c @@ -9,7 +9,7 @@ * @brief Control the overall game flow: data loading/unloading and game loop. */ -#include +#include #include #include "lephisto.h" @@ -85,11 +85,11 @@ static void update_routine(double dt); static void render_all(void); -/** +/** * @fn int main(int argc, char** argv) * * @brief The entry point of Lephisto. - * + * * @param[in] argc Number of arguments. * @param[in] argv Array of argc arguments. * @return EXIT_SUCCESS on success. @@ -423,7 +423,7 @@ static void update_routine(double dt) { * * Blitting order. (layers) * - * - BG + * - BG * -- Stars and planets. * -- Background player stuff (planet targetting) * -- Background particles. @@ -432,7 +432,7 @@ static void update_routine(double dt) { * -- NPC ships. * -- Front layer weapons. * -- Normal layer particles (above ships). - * - FG + * - FG * -- Player. * -- Foreground particles. * -- Text and GUI. diff --git a/src/opengl.h b/src/opengl.h index 03a7f37..2ba01f2 100644 --- a/src/opengl.h +++ b/src/opengl.h @@ -1,7 +1,7 @@ #pragma once #include -#include -#include +#include +#include #include "colour.h" #include "physics.h" @@ -74,21 +74,21 @@ void gl_freeTexture(glTexture* texture); /* Rendering. */ /* Blits a sprite, relative pos. */ void gl_blitSprite(const glTexture* sprite, const double bx, const double by, - const int sx, const int sy, const glColour* c); + const int sx, const int sy, const glColour* c); /* Blit a sprite, absolute position. */ void gl_blitStaticSprite(const glTexture* sprite, - const double bx, const double by, - const int sx, const int sy, const glColour* c); + const double bx, const double by, + const int sx, const int sy, const glColour* c); /* Blit a texture scaled, absolure pos. */ void gl_blitScale(const glTexture* texture, - const double bx, const double by, - const double bw, const double bh, const glColour* c); + const double bx, const double by, + const double bw, const double bh, const glColour* c); /* Blit the entire image, absolute pos. */ void gl_blitStatic(const glTexture* texture, const double bx, const double by, - const glColour* c); + const glColour* c); /* Bind the camera to a vector. */ void gl_bindCamera(const Vec2* pos); @@ -96,8 +96,8 @@ void gl_bindCamera(const Vec2* pos); /* Circle drawing. */ void gl_drawCircle(const double x, const double y, const double r); void gl_drawCircleInRect(const double x, const double y, const double r, - const double rc, const double ry, const double rw, - const double rh); + const double rc, const double ry, const double rw, + const double rh); /* Initialize/cleanup. */ int gl_init(void); diff --git a/src/toolkit.h b/src/toolkit.h index 077186e..2957b41 100644 --- a/src/toolkit.h +++ b/src/toolkit.h @@ -1,5 +1,5 @@ #pragma once -#include +#include #include "opengl.h" #include "font.h" @@ -70,9 +70,9 @@ int window_exists(const char* wdwname); unsigned int window_get(const char* wdwname); char* window_getInput(const unsigned int wid, char* name); void window_posWidget(const unsigned int wid, - char* name, int* x, int* y); + char* name, int* x, int* y); void window_moveWidget(const unsigned int wid, - char* name, int x, int y); + char* name, int x, int y); /* Specific. */ char* toolkit_getList(const unsigned int wid, char* name); int toolkit_getListPos(const unsigned int wid, char* name); diff --git a/src/xml.h b/src/xml.h index 10b02c4..7771dc2 100644 --- a/src/xml.h +++ b/src/xml.h @@ -44,35 +44,35 @@ /* Encompassing element. */ #define xmlw_startElem(w, str) \ if(xmlTextWriterStartElement(w, (xmlChar*)str) < 0) { \ - ERR("xmlw: Unable to create start element"); return -1; } + ERR("xmlw: Unable to create start element"); return -1; } #define xmlw_endElem(w) \ if(xmlTextWriterEndElement(w) < 0) { \ - ERR("xmlw: Unable to create end element"); return -1; } + ERR("xmlw: Unable to create end element"); return -1; } /* Other stuff. */ #define xmlw_elem(w, n, str, args...) \ if(xmlTextWriterWriteFormatElement(w, (xmlChar*)n, str, ## args) < 0) { \ - ERR("xmlw: Unable to write format element"); return -1; } + ERR("xmlw: Unable to write format element"); return -1; } #define xmlw_raw(w,b,l) \ if(xmlTextWriterWriteRawLen(w, (xmlChar*)b, l) < 0) { \ - ERR("xmlw: unable to write raw element"); return -1; } + ERR("xmlw: unable to write raw element"); return -1; } #define xmlw_attr(w, str, val...) \ if(xmlTextWriterWriteFormatAttribute(w, (xmlChar*)str, ## val) < 0) { \ - ERR("xmlw: Unable to write element attribute"); return -1; } + ERR("xmlw: Unable to write element attribute"); return -1; } #define xmlw_str(w, str, val...) \ if(xmlTextWriterWriteFormatString(w, str, ## val) < 0) { \ - ERR("xmlw: Unable to write element data"); return -1; } + ERR("xmlw: Unable to write element data"); return -1; } /* Document level. */ #define xmlw_start(w) \ if(xmlTextWriterStartDocument(writer, NULL, "UTF-8", NULL) < 0) { \ - ERR("xmlw: Unable to start document"); return -1; } + ERR("xmlw: Unable to start document"); return -1; } #define xmlw_done(w) \ if(xmlTextWriterEndDocument(w) < 0) { \ - ERR("xmlw: Unable to end document"); return -1; } + ERR("xmlw: Unable to end document"); return -1; }