Moved all source files into their appropriate directories i.e. common, game and libsymmetry and began migrating build system to GENie

dev
shariq 8 years ago
parent 16b3293b41
commit a4f3021e44
  1. BIN
      build/genie
  2. 64
      build/genie.lua
  3. 2
      build/linux/makefile
  4. 0
      src/common/array.c
  5. 0
      src/common/array.h
  6. 0
      src/common/array_str.h
  7. 0
      src/common/common.h
  8. 0
      src/common/hashmap.c
  9. 0
      src/common/hashmap.h
  10. 0
      src/common/linmath.c
  11. 0
      src/common/linmath.h
  12. 0
      src/common/log.c
  13. 0
      src/common/log.h
  14. 4
      src/common/num_types.h
  15. 0
      src/common/string_utils.c
  16. 0
      src/common/string_utils.h
  17. 0
      src/common/utils.c
  18. 0
      src/common/utils.h
  19. 0
      src/common/variant.c
  20. 0
      src/common/variant.h
  21. 8
      src/game/config_vars.c
  22. 2
      src/game/config_vars.h
  23. 4
      src/game/file_io.c
  24. 2
      src/game/file_io.h
  25. 7
      src/game/main.c
  26. 6
      src/game/platform.c
  27. 2
      src/game/platform.h
  28. 6
      src/game/sound.c
  29. 2
      src/game/sound.h
  30. 0
      src/libsymmetry/bounding_volumes.c
  31. 4
      src/libsymmetry/bounding_volumes.h
  32. 6
      src/libsymmetry/camera.c
  33. 0
      src/libsymmetry/camera.h
  34. 16
      src/libsymmetry/editor.c
  35. 2
      src/libsymmetry/editor.h
  36. 10
      src/libsymmetry/entity.c
  37. 4
      src/libsymmetry/entity.h
  38. 0
      src/libsymmetry/event.h
  39. 4
      src/libsymmetry/framebuffer.c
  40. 6
      src/libsymmetry/framebuffer.h
  41. 15
      src/libsymmetry/game.c
  42. 0
      src/libsymmetry/game.h
  43. 8
      src/libsymmetry/geometry.c
  44. 4
      src/libsymmetry/geometry.h
  45. 4
      src/libsymmetry/gl_load.c
  46. 0
      src/libsymmetry/gl_load.h
  47. 0
      src/libsymmetry/glad.c
  48. 8
      src/libsymmetry/gui.c
  49. 2
      src/libsymmetry/gui.h
  50. 8
      src/libsymmetry/input.c
  51. 2
      src/libsymmetry/input.h
  52. 2
      src/libsymmetry/light.c
  53. 0
      src/libsymmetry/light.h
  54. 7
      src/libsymmetry/material.c
  55. 4
      src/libsymmetry/material.h
  56. 4
      src/libsymmetry/model.c
  57. 2
      src/libsymmetry/model.h
  58. 12
      src/libsymmetry/renderer.c
  59. 4
      src/libsymmetry/renderer.h
  60. 6
      src/libsymmetry/scene.c
  61. 2
      src/libsymmetry/scene.h
  62. 10
      src/libsymmetry/shader.c
  63. 6
      src/libsymmetry/shader.h
  64. 10
      src/libsymmetry/texture.c
  65. 4
      src/libsymmetry/texture.h
  66. 6
      src/libsymmetry/transform.c
  67. 4
      src/libsymmetry/transform.h

Binary file not shown.

@ -0,0 +1,64 @@
-- A solution contains projects, and defines the available configurations
solution "Symmetry"
configurations { "Debug", "Release" }
location(_ACTION)
defines {"USE_GLAD"}
includedirs {"../include/"}
buildoptions {"-Wall", "-std=c99"}
if os.is("linux") then
postbuildcommands {"ln -fs /mnt/Dev/Projects/symmetry/assets debug"}
postbuildcommands {"ln -fs /mnt/Dev/Projects/symmetry/assets release"}
end
configuration "Debug"
if not _ACTION == nil then
os.mkdir(_ACTION .. "/debug")
targetdir (_ACTION .. "/debug")
end
configuration "Release"
if not _ACTION == nil then
os.mkdir(_ACTION .. "/release")
targetdir (_ACTION .. "/release")
end
-------------------------
-- Game
-------------------------
project "Game"
kind "WindowedApp"
targetname "Symmetry"
language "C"
files { "../src/common/**.c", "../src/game/**.c" }
defines {"GAME"}
configuration "linux"
buildoptions {"`pkg-config --cflags-only-other sdl2 openal`"}
linkoptions {"`pkg-config --libs sdl2 openal`"}
links {"m"}
configuration "Debug"
defines { "DEBUG" }
flags { "Symbols" }
configuration "Release"
defines { "NDEBUG" }
flags { "OptimizeSpeed"}
-------------------------
-- libSymmetry
-------------------------
project "Library"
kind "SharedLib"
targetname "Symmetry"
language "C"
defines {"GAME_LIB"}
files { "../src/common/**.c", "../src/libsymmetry/**.c" }
configuration "Debug"
defines {"GL_DEBUG_CONTEXT", "AL_DEBUG"}
flags {"Symbols"}
configuration "Release"
defines { "NDEBUG" }
flags { "OptimizeSpeed"}

@ -9,7 +9,7 @@ CFLAGS_GAME = $(CFLAGS) -DGAME $(shell pkg-config --cflags-only-other sdl2 o
CFLAGS_GAME_LIB = $(CFLAGS) -DGAME_LIB
CFLAGS_DEBUG = -g -DGL_DEBUG_CONTEXT -DAL_DEBUG
CFLAGS_RELEASE = -O3 -ffast-math
LFLAGS = $(shell pkg-config --libs sdl2 openal) -lm -ldl
LFLAGS = $(shell pkg-config --libs sdl2 openal) -lm
ITCH_BUTLER = ~/.config/itch/bin/butler
SRCS_GAME = main.c platform.c log.c array.c utils.c config_vars.c file_io.c glad.c hashmap.c sound.c string_utils.c variant.c linmath.c

@ -1,5 +1,5 @@
#ifndef num_types_H
#define num_types_H
#ifndef NUM_TYPES_H
#define NUM_TYPES_H
#include <stdint.h>
#include <stdbool.h>

@ -1,9 +1,9 @@
#include "config_vars.h"
#include "string_utils.h"
#include "variant.h"
#include "hashmap.h"
#include "../common/string_utils.h"
#include "../common/variant.h"
#include "../common/hashmap.h"
#include "file_io.h"
#include "log.h"
#include "../common/log.h"
#include "platform.h"
#include <stdlib.h>

@ -1,7 +1,7 @@
#ifndef CONFIG_VARS_H
#define CONFIG_VARS_H
#include "num_types.h"
#include "../common/num_types.h"
struct Hashmap;

@ -2,8 +2,8 @@
#include <stdlib.h>
#include "file_io.h"
#include "log.h"
#include "string_utils.h"
#include "../common/log.h"
#include "../common/string_utils.h"
static char* install_directory = NULL;
static char* user_directory = NULL;

@ -1,7 +1,7 @@
#ifndef FILE_IO_H
#define FILE_IO_H
#include "common.h"
#include "../common/common.h"
void io_file_init(const char* install_dir, const char* user_dir);
char* io_file_read(const int directory_type, const char* path, const char* mode, long* file_size);

@ -1,14 +1,13 @@
#include <stdio.h>
#include <stdlib.h>
#include "log.h"
#include "../common/log.h"
#include "sound.h"
#include "platform.h"
#include "gl_load.h"
#include "file_io.h"
#include "config_vars.h"
#include "hashmap.h"
#include "common.h"
#include "../common/hashmap.h"
#include "../common/common.h"
static struct Window* window = NULL;
static struct Platform_Api platform_api;

@ -1,8 +1,8 @@
#include "platform.h"
#include "log.h"
#include "../common/log.h"
#include "config_vars.h"
#include "hashmap.h"
#include "string_utils.h"
#include "../common/hashmap.h"
#include "../common/string_utils.h"
#include <SDL2/SDL.h>
#include <string.h>

@ -1,7 +1,7 @@
#ifndef PLATFORM_H
#define PLATFORM_H
#include "common.h"
#include "../common/common.h"
enum Video_Drivers_Linux
{

@ -1,7 +1,7 @@
#include "sound.h"
#include "log.h"
#include "array.h"
#include "string_utils.h"
#include "../common/log.h"
#include "../common/array.h"
#include "../common/string_utils.h"
#include "file_io.h"
#include <assert.h>

@ -1,7 +1,7 @@
#ifndef SOUND_H
#define SOUND_H
#include "num_types.h"
#include "../common/num_types.h"
#ifdef AL_DEBUG
#define al_check(expr) {expr; sound_error_check(__FILE__, __LINE__, #expr);}

@ -1,8 +1,8 @@
#ifndef BOUNDING_VOLUMES_H
#define BOUNDING_VOLUMES_H
#include "linmath.h"
#include "num_types.h"
#include "../common/linmath.h"
#include "../common/num_types.h"
struct Entity;

@ -2,13 +2,13 @@
#include "entity.h"
#include "transform.h"
#include "entity.h"
#include "array.h"
#include "../common/array.h"
#include "framebuffer.h"
#include "texture.h"
#include "bounding_volumes.h"
#include "utils.h"
#include "log.h"
#include "../common/utils.h"
#include "../common/log.h"
#include "gl_load.h"
#include <assert.h>

@ -1,24 +1,24 @@
#include "editor.h"
#include "renderer.h"
#include "gl_load.h"
#include "log.h"
#include "../common/log.h"
#include "camera.h"
#include "model.h"
#include "texture.h"
#include "framebuffer.h"
#include "array.h"
#include "../common/array.h"
#include "shader.h"
#include "num_types.h"
#include "../common/num_types.h"
#include "light.h"
#include "entity.h"
#include "transform.h"
#include "game.h"
#include "gui.h"
#include "array.h"
#include "variant.h"
#include "num_types.h"
#include "string_utils.h"
#include "common.h"
#include "../common/array.h"
#include "../common/variant.h"
#include "../common/num_types.h"
#include "../common/string_utils.h"
#include "../common/common.h"
#include <stdio.h>
#include <stdlib.h>

@ -1,7 +1,7 @@
#ifndef EDITOR_H
#define EDITOR_H
#include "linmath.h"
#include "../common/linmath.h"
void editor_init(void);
void editor_update(float dt);

@ -1,15 +1,15 @@
#include "entity.h"
#include "array.h"
#include "log.h"
#include "string_utils.h"
#include "../common/array.h"
#include "../common/log.h"
#include "../common/string_utils.h"
#include "transform.h"
#include "camera.h"
#include "light.h"
#include "model.h"
#include "material.h"
#include "geometry.h"
#include "variant.h"
#include "common.h"
#include "../common/variant.h"
#include "../common/common.h"
#include <stdlib.h>
#include <string.h>

@ -1,8 +1,8 @@
#ifndef ENTITY_H
#define ENTITY_H
#include "linmath.h"
#include "num_types.h"
#include "../common/linmath.h"
#include "../common/num_types.h"
#define MAX_ENTITY_NAME_LEN 128
#define MAX_SOUND_SOURCE_BUFFERS 5

@ -1,7 +1,7 @@
#include "framebuffer.h"
#include "array.h"
#include "../common/array.h"
#include "renderer.h"
#include "log.h"
#include "../common/log.h"
#include "texture.h"
#include "gl_load.h"

@ -1,7 +1,7 @@
#ifndef framebuffer_H
#define framebuffer_H
#ifndef FRAMEBUFFER_H
#define FRAMEBUFFER_H
#include "num_types.h"
#include "../common/num_types.h"
enum Framebuffer_Attachment
{

@ -7,16 +7,16 @@
#include "game.h"
#include "input.h"
#include "renderer.h"
#include "log.h"
#include "../common/log.h"
#include "shader.h"
#include "entity.h"
#include "geometry.h"
#include "array.h"
#include "../common/array.h"
#include "transform.h"
#include "camera.h"
#include "model.h"
#include "scene.h"
#include "utils.h"
#include "../common/utils.h"
#include "texture.h"
#include "material.h"
#include "framebuffer.h"
@ -24,10 +24,9 @@
#include "gl_load.h"
#include "gui.h"
#include "editor.h"
#include "config_vars.h"
#include "hashmap.h"
#include "variant.h"
#include "common.h"
#include "../common/hashmap.h"
#include "../common/variant.h"
#include "../common/common.h"
#define UNUSED(a) (void)a
#define MIN(a,b) ((a) < (b) ? (a) : (b))
@ -1592,10 +1591,10 @@ void game_cleanup(void)
scene_cleanup();
entity_cleanup();
material_cleanup();
geom_cleanup();
light_cleanup();
input_cleanup();
renderer_cleanup();
geom_cleanup();
framebuffer_cleanup();
texture_cleanup();
shader_cleanup();

@ -1,10 +1,10 @@
#include "geometry.h"
#include "array.h"
#include "string_utils.h"
#include "log.h"
#include "../common/array.h"
#include "../common/string_utils.h"
#include "../common/log.h"
#include "renderer.h"
#include "transform.h"
#include "common.h"
#include "../common/common.h"
#include "gl_load.h"
#include <stdlib.h>

@ -1,8 +1,8 @@
#ifndef GEOMETRY_H
#define GEOMETRY_H
#include "num_types.h"
#include "linmath.h"
#include "../common/num_types.h"
#include "../common/linmath.h"
#include "bounding_volumes.h"
struct Entity;

@ -1,6 +1,6 @@
#include "gl_load.h"
#include "log.h"
#include "common.h"
#include "../common/log.h"
#include "../common/common.h"
#ifndef USE_GLAD

@ -1,14 +1,14 @@
#define NK_IMPLEMENTATION
#include "gui.h"
#include "linmath.h"
#include "log.h"
#include "../common/linmath.h"
#include "../common/log.h"
#include "shader.h"
#include "texture.h"
#include "game.h"
#include "input.h"
#include "renderer.h"
#include "string_utils.h"
#include "common.h"
#include "../common/string_utils.h"
#include "../common/common.h"
#include <string.h>
#include <stdlib.h>

@ -12,7 +12,7 @@
#include <nuklear.h>
#include "gl_load.h"
#include "num_types.h"
#include "../common/num_types.h"
struct Gui_State
{

@ -2,11 +2,11 @@
#include <stdlib.h>
#include <string.h>
#include "input.h"
#include "array.h"
#include "log.h"
#include "../common/array.h"
#include "../common/log.h"
#include "gui.h"
#include "string_utils.h"
#include "common.h"
#include "../common/string_utils.h"
#include "../common/common.h"
struct Input_Map
{

@ -2,7 +2,7 @@
#define INPUT_H
#include <stdlib.h>
#include "num_types.h"
#include "../common/num_types.h"
#include <SDL2/SDL_keycode.h>
#include <SDL2/SDL_mouse.h>
#include <SDL2/SDL_events.h>

@ -1,5 +1,5 @@
#include "light.h"
#include "array.h"
#include "../common/array.h"
#include "entity.h"
#include <assert.h>

@ -1,9 +1,9 @@
#include "material.h"
#include "array.h"
#include "../common/array.h"
#include "shader.h"
#include "entity.h"
#include "string_utils.h"
#include "log.h"
#include "../common/string_utils.h"
#include "../common/log.h"
#include "model.h"
#include "texture.h"
#include "light.h"
@ -183,6 +183,7 @@ void material_cleanup(void)
for(int i = 0; i < array_len(material_list); i++)
material_remove(i);
array_free(empty_indices);
array_free(material_list);
}
bool material_register_model(struct Entity* entity, const char* material_name)

@ -1,8 +1,8 @@
#ifndef MATERIAL_H
#define MATERIAL_H
#include "linmath.h"
#include "num_types.h"
#include "../common/linmath.h"
#include "../common/num_types.h"
struct Entity;

@ -1,6 +1,6 @@
#include "model.h"
#include "array.h"
#include "log.h"
#include "../common/array.h"
#include "../common/log.h"
#include "entity.h"
#include "texture.h"
#include "material.h"

@ -1,7 +1,7 @@
#ifndef MODEL_H
#define MODEL_H
#include "linmath.h"
#include "../common/linmath.h"
struct Entity;

@ -1,25 +1,25 @@
#include "renderer.h"
#include "gl_load.h"
#include "log.h"
#include "../common/log.h"
#include "camera.h"
#include "model.h"
#include "texture.h"
#include "framebuffer.h"
#include "array.h"
#include "../common/array.h"
#include "shader.h"
#include "num_types.h"
#include "../common/num_types.h"
#include "light.h"
#include "entity.h"
#include "transform.h"
#include "game.h"
#include "gui.h"
#include "hashmap.h"
#include "../common/hashmap.h"
#include "geometry.h"
#include "material.h"
#include "editor.h"
#include "variant.h"
#include "common.h"
#include "../common/variant.h"
#include "../common/common.h"
#include <string.h>
#include <stdio.h>

@ -1,8 +1,8 @@
#ifndef RENDERER_H
#define RENDERER_H
#include "linmath.h"
#include "num_types.h"
#include "../common/linmath.h"
#include "../common/num_types.h"
enum Fog_Mode
{

@ -1,9 +1,9 @@
#include "scene.h"
#include "array.h"
#include "../common/array.h"
#include "entity.h"
#include "log.h"
#include "../common/log.h"
#include "transform.h"
#include "common.h"
#include "../common/common.h"
#include <assert.h>
#include <string.h>

@ -1,7 +1,7 @@
#ifndef SCENE_H
#define SCENE_H
#include "num_types.h"
#include "../common/num_types.h"
struct Entity;

@ -1,12 +1,12 @@
#include "shader.h"
#include "array.h"
#include "num_types.h"
#include "string_utils.h"
#include "log.h"
#include "../common/array.h"
#include "../common/num_types.h"
#include "../common/string_utils.h"
#include "../common/log.h"
#include "renderer.h"
#include "texture.h"
#include "gl_load.h"
#include "common.h"
#include "../common/common.h"
#include <stdio.h>
#include <stdlib.h>

@ -1,7 +1,7 @@
#ifndef shader_H
#define shader_H
#ifndef SHADER_H
#define SHADER_H
#include "linmath.h"
#include "../common/linmath.h"
enum Uniform_Type
{

@ -1,11 +1,11 @@
#include "texture.h"
#include "array.h"
#include "string_utils.h"
#include "log.h"
#include "num_types.h"
#include "../common/array.h"
#include "../common/string_utils.h"
#include "../common/log.h"
#include "../common/num_types.h"
#include "renderer.h"
#include "gl_load.h"
#include "common.h"
#include "../common/common.h"
#include <assert.h>
#include <string.h>

@ -1,5 +1,5 @@
#ifndef texture_H
#define texture_H
#ifndef TEXTURE_H
#define TEXTURE_H
enum Texture_Unit
{

@ -1,8 +1,8 @@
#include "transform.h"
#include "log.h"
#include "array.h"
#include "../common/log.h"
#include "../common/array.h"
#include "entity.h"
#include "utils.h"
#include "../common/utils.h"
#include <assert.h>
void transform_create(struct Entity* entity, int parent_entity)

@ -1,8 +1,8 @@
#ifndef TRANSFORM_H
#define TRANSFORM_H
#include "linmath.h"
#include "num_types.h"
#include "../common/linmath.h"
#include "../common/num_types.h"
enum Transform_Space { TS_LOCAL, TS_PARENT, TS_WORLD};
Loading…
Cancel
Save