[Add] Qtcreator project support for the IDE users of the world.

This commit is contained in:
Allanis 2013-10-04 16:34:34 +01:00
parent ae7af81e75
commit 652d9352ad
8 changed files with 214 additions and 29 deletions

5
.gitignore vendored
View File

@ -39,3 +39,8 @@ docs/doxygen/docs/*
win32/Lephisto/* win32/Lephisto/*
win32/Pack/* win32/Pack/*
win32/Makefile win32/Makefile
# Qt crap.
qt/*.user
qt/Makefile

180
qt/qt.pro Normal file
View File

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

View File

@ -1,5 +1,5 @@
#pragma once #pragma once
#include <SDL.h> #include <SDL/SDL.h>
/* Input types. */ /* Input types. */
typedef enum { typedef enum {

View File

@ -4,7 +4,7 @@
* @brief Handles joystick initialization. * @brief Handles joystick initialization.
*/ */
#include <SDL.h> #include <SDL/SDL.h>
#include <string.h> #include <string.h>
#include "lephisto.h" #include "lephisto.h"
#include "log.h" #include "log.h"
@ -64,7 +64,7 @@ int joystick_use(int indjoystick) {
/** /**
* @fn int joystick_init(void) * @fn int joystick_init(void)
* *
* @brief Initializes the joystick subsystem. * @brief Initializes the joystick subsystem.
* @return 0 on success. * @return 0 on success.
*/ */

View File

@ -9,7 +9,7 @@
* @brief Control the overall game flow: data loading/unloading and game loop. * @brief Control the overall game flow: data loading/unloading and game loop.
*/ */
#include <SDL.h> #include <SDL/SDL.h>
#include <string.h> #include <string.h>
#include "lephisto.h" #include "lephisto.h"
@ -85,11 +85,11 @@ static void update_routine(double dt);
static void render_all(void); static void render_all(void);
/** /**
* @fn int main(int argc, char** argv) * @fn int main(int argc, char** argv)
* *
* @brief The entry point of Lephisto. * @brief The entry point of Lephisto.
* *
* @param[in] argc Number of arguments. * @param[in] argc Number of arguments.
* @param[in] argv Array of argc arguments. * @param[in] argv Array of argc arguments.
* @return EXIT_SUCCESS on success. * @return EXIT_SUCCESS on success.
@ -423,7 +423,7 @@ static void update_routine(double dt) {
* *
* Blitting order. (layers) * Blitting order. (layers)
* *
* - BG * - BG
* -- Stars and planets. * -- Stars and planets.
* -- Background player stuff (planet targetting) * -- Background player stuff (planet targetting)
* -- Background particles. * -- Background particles.
@ -432,7 +432,7 @@ static void update_routine(double dt) {
* -- NPC ships. * -- NPC ships.
* -- Front layer weapons. * -- Front layer weapons.
* -- Normal layer particles (above ships). * -- Normal layer particles (above ships).
* - FG * - FG
* -- Player. * -- Player.
* -- Foreground particles. * -- Foreground particles.
* -- Text and GUI. * -- Text and GUI.

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include <stdint.h> #include <stdint.h>
#include <SDL.h> #include <SDL/SDL.h>
#include <SDL_opengl.h> #include <SDL/SDL_opengl.h>
#include "colour.h" #include "colour.h"
#include "physics.h" #include "physics.h"
@ -74,21 +74,21 @@ void gl_freeTexture(glTexture* texture);
/* Rendering. */ /* Rendering. */
/* Blits a sprite, relative pos. */ /* Blits a sprite, relative pos. */
void gl_blitSprite(const glTexture* sprite, const double bx, const double by, 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. */ /* Blit a sprite, absolute position. */
void gl_blitStaticSprite(const glTexture* sprite, void gl_blitStaticSprite(const glTexture* sprite,
const double bx, const double by, 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 texture scaled, absolure pos. */ /* Blit a texture scaled, absolure pos. */
void gl_blitScale(const glTexture* texture, void gl_blitScale(const glTexture* texture,
const double bx, const double by, const double bx, const double by,
const double bw, const double bh, const glColour* c); const double bw, const double bh, const glColour* c);
/* Blit the entire image, absolute pos. */ /* Blit the entire image, absolute pos. */
void gl_blitStatic(const glTexture* texture, const double bx, const double by, void gl_blitStatic(const glTexture* texture, const double bx, const double by,
const glColour* c); const glColour* c);
/* Bind the camera to a vector. */ /* Bind the camera to a vector. */
void gl_bindCamera(const Vec2* pos); void gl_bindCamera(const Vec2* pos);
@ -96,8 +96,8 @@ void gl_bindCamera(const Vec2* pos);
/* Circle drawing. */ /* Circle drawing. */
void gl_drawCircle(const double x, const double y, const double r); void gl_drawCircle(const double x, const double y, const double r);
void gl_drawCircleInRect(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 rc, const double ry, const double rw,
const double rh); const double rh);
/* Initialize/cleanup. */ /* Initialize/cleanup. */
int gl_init(void); int gl_init(void);

View File

@ -1,5 +1,5 @@
#pragma once #pragma once
#include <SDL.h> #include <SDL/SDL.h>
#include "opengl.h" #include "opengl.h"
#include "font.h" #include "font.h"
@ -70,9 +70,9 @@ int window_exists(const char* wdwname);
unsigned int window_get(const char* wdwname); unsigned int window_get(const char* wdwname);
char* window_getInput(const unsigned int wid, char* name); char* window_getInput(const unsigned int wid, char* name);
void window_posWidget(const unsigned int wid, 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, void window_moveWidget(const unsigned int wid,
char* name, int x, int y); char* name, int x, int y);
/* Specific. */ /* Specific. */
char* toolkit_getList(const unsigned int wid, char* name); char* toolkit_getList(const unsigned int wid, char* name);
int toolkit_getListPos(const unsigned int wid, char* name); int toolkit_getListPos(const unsigned int wid, char* name);

View File

@ -44,35 +44,35 @@
/* Encompassing element. */ /* Encompassing element. */
#define xmlw_startElem(w, str) \ #define xmlw_startElem(w, str) \
if(xmlTextWriterStartElement(w, (xmlChar*)str) < 0) { \ 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) \ #define xmlw_endElem(w) \
if(xmlTextWriterEndElement(w) < 0) { \ if(xmlTextWriterEndElement(w) < 0) { \
ERR("xmlw: Unable to create end element"); return -1; } ERR("xmlw: Unable to create end element"); return -1; }
/* Other stuff. */ /* Other stuff. */
#define xmlw_elem(w, n, str, args...) \ #define xmlw_elem(w, n, str, args...) \
if(xmlTextWriterWriteFormatElement(w, (xmlChar*)n, str, ## args) < 0) { \ 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) \ #define xmlw_raw(w,b,l) \
if(xmlTextWriterWriteRawLen(w, (xmlChar*)b, l) < 0) { \ 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...) \ #define xmlw_attr(w, str, val...) \
if(xmlTextWriterWriteFormatAttribute(w, (xmlChar*)str, ## val) < 0) { \ 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...) \ #define xmlw_str(w, str, val...) \
if(xmlTextWriterWriteFormatString(w, str, ## val) < 0) { \ 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. */ /* Document level. */
#define xmlw_start(w) \ #define xmlw_start(w) \
if(xmlTextWriterStartDocument(writer, NULL, "UTF-8", NULL) < 0) { \ 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) \ #define xmlw_done(w) \
if(xmlTextWriterEndDocument(w) < 0) { \ if(xmlTextWriterEndDocument(w) < 0) { \
ERR("xmlw: Unable to end document"); return -1; } ERR("xmlw: Unable to end document"); return -1; }