Updated build script to auto generate version from manually specified major and minor version along with revision number from git. Added link to itch.io page in README

dev
Shariq Shah 6 years ago
parent 086faead05
commit c2d534ceeb
  1. 2
      .github/workflows/default.yml
  2. 4
      README.md
  3. 39
      build/genie.lua
  4. 2
      src/common/log.c
  5. 10
      src/common/version.h
  6. 2
      src/game/game.c
  7. 2
      todo.txt

@ -23,7 +23,7 @@ jobs:
curl -L -o butler.zip https://broth.itch.ovh/butler/windows-amd64/LATEST/archive/default
7z e butler.zip
dir
.\butler.exe push bin bluerriq/symmetry:windows-prealpha
.\butler.exe push bin bluerriq/symmetry:windows-prealpha --userversion-file bin/version.txt

@ -2,6 +2,8 @@
![alt-text](screenshots/project_symmetry.jpg "Project Symmetry")
<iframe src="https://itch.io/embed/141852?linkback=true&amp;dark=true" align="center" width="552" height="167" frameborder="0"><a href="https://bluerriq.itch.io/symmetry">Symmetry by bluerriq</a></iframe>
## About
A simple first person shooter that may or may not have anything to do with the concept of symmetry.
@ -17,6 +19,8 @@ libraries:
| [Nuklear](https://github.com/vurtun/nuklear) | In-game and editor UI |
| [GLAD](https://github.com/dav1dde/glad-web) | OpenGL Extension Loading |
For more information visit the development blog at my website: [Link]("http://shariqshah.com/tags/project-symmetry/")
## Building
The game uses the [GENie](https://github.com/bkaradzic/GENie) build system. The game can be build by llowing steps:

@ -55,6 +55,36 @@ solution "Symmetry"
end
}
newaction {
trigger = "generate_version_file",
description = "Generate version.h from git revision number",
execute = function()
local major_version = 0
local minor_version = 1
local revision_number = os.outputof("git rev-list --count HEAD")
local branch = os.outputof("git rev-parse --abbrev-ref HEAD")
revision_number = revision_number:gsub("%s+", "")
branch = branch:gsub("%s+", "")
print("Writing Version Number.....")
io.output("../../src/common/version.h")
io.write("#ifndef SYMMETRY_VERSION_FILE\n")
io.write("#define SYMMETRY_VERSION_FILE\n\n")
io.write("/* Auto generated version file. DO NOT MODIFY */\n")
io.write("#define SYMMETRY_VERSION_MAJOR " .. major_version .. "\n")
io.write("#define SYMMETRY_VERSION_MINOR " .. minor_version .. "\n")
io.write("#define SYMMETRY_VERSION_REVISION " .. revision_number .. "\n")
io.write("#define SYMMETRY_VERSION_BRANCH \"" .. branch .. "\"\n")
io.write("\n#endif")
io.close()
io.output("version.txt")
io.write(major_version .. "." .. minor_version .. "." .. revision_number .. "-" .. branch)
io.close()
end
}
-------------------------
-- Game
-------------------------
@ -65,7 +95,12 @@ solution "Symmetry"
files { "../src/common/**.c", "../src/common/**.h", "../src/system/**.c", "../src/system/**.h", "../src/game/**.h", "../src/game/**.c"}
includedirs {"../include/common"}
defines {"USE_GLAD"}
prebuildcommands
{
_PREMAKE_COMMAND .. ' generate_version_file'
}
configuration "linux"
includedirs {"../include/linux/sdl2/", "../include/common/soloud/", "../include/linux/"}
libdirs {"../lib/linux/sdl2/", "../lib/linux/soloud/", "../lib/linux/ode/"}
@ -99,6 +134,7 @@ solution "Symmetry"
'install_name_tool -change "/usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib" "@rpath/libSDL2-2.0.0.dylib" release/Symmetry',
'install_name_tool -change "/Users/shariqshah/Dev/ode/build_cmake/libode.0.16.0.dylib" "@rpath/libode.0.16.0.dylib" release/Symmetry',
'install_name_tool -change "/usr/local/lib/libsoloud.dylib" "@rpath/libsoloud.dylib" release/Symmetry',
'cp version.txt release/'
}
configuration {"windows", "vs2019"}
@ -125,6 +161,7 @@ solution "Symmetry"
"copy release\\SDL2.dll ..\\..\\bin\\ /Y",
"copy release\\soloud_x64.dll ..\\..\\bin\\ /Y",
"copy release\\ode_double.dll ..\\..\\bin\\ /Y",
"copy version.txt ..\\..\\bin\\ /Y",
"rmdir release\\assets",
"mklink /D release\\assets ..\\..\\..\\assets"
}

@ -4,6 +4,7 @@
#include <time.h>
#include "log.h"
#include "version.h"
#ifdef __linux__
#define COLOURED_STDOUT
@ -54,6 +55,7 @@ void log_init(const char* log_file_name, const char* user_directory)
time_t current_time;
time(&current_time);
fprintf(log_file, "Log Initialized at %s\n", ctime(&current_time));
fprintf(log_file, "Version: %d.%d.%d-%s\n\n", SYMMETRY_VERSION_MAJOR, SYMMETRY_VERSION_MINOR, SYMMETRY_VERSION_REVISION, SYMMETRY_VERSION_BRANCH);
fflush(log_file);
}
// Disable stdout buffering

@ -0,0 +1,10 @@
#ifndef SYMMETRY_VERSION_FILE
#define SYMMETRY_VERSION_FILE
/* Auto generated version file. DO NOT MODIFY */
#define SYMMETRY_VERSION_MAJOR 0
#define SYMMETRY_VERSION_MINOR 1
#define SYMMETRY_VERSION_REVISION 298
#define SYMMETRY_VERSION_BRANCH "dev"
#endif

@ -358,7 +358,7 @@ void game_debug(float dt)
if(input_is_key_pressed(KEY_PAGEUP))
{
struct Entity* model = scene_find(game_state->scene, "Suzanne_Test_Parent");
//vec3 y_axis = {0, 0, 1};
vec3 y_axis = {0, 0, 1};
//transform_rotate(mod_tran, &y_axis, 25.f * dt, TS_LOCAL);
vec3 amount = {0, 0, -5 * dt};
transform_translate(model, &amount, TS_LOCAL);

@ -1,4 +1,6 @@
Todo:
- Figure out the revision number and branching situation
- Add links to Itch.io builds of the game in readme and on the blog. Add link to blog in the readme as well
- Save/Load base bounding boxes for entity types other than static mesh
- Determine whether we should enable or disble picking when a tool is active within an editor
? Only show bounding box for hovered entity instead of wireframe mesh

Loading…
Cancel
Save