Commit build settings to repo, consolodate

main
Cameron Murphy Reikes 2 years ago
parent 17cebee22e
commit 8475393c33

1
.gitignore vendored

@ -9,7 +9,6 @@ debug_world.bin
flight*.zip
flight_server
flight.zip
ipsettings.h
releases/
.vs/
x64/

@ -140,7 +140,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions);DEBUG_RENDERING;SERVER_ADDRESS="127.0.0.1"</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(ProjectDir)\thirdparty\enet\include;$(ProjectDir)\thirdparty\Chipmunk2D\include\chipmunk;$(ProjectDir)\thirdparty;$(ProjectDir)\thirdparty\Chipmunk2D\include;$(ProjectDir)\thirdparty\minilzo;$(ProjectDir)\thirdparty\opus\include</AdditionalIncludeDirectories>
<TreatWarningAsError>true</TreatWarningAsError>
@ -156,7 +156,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions);DEBUG_RENDERING;</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>C:\Users\Cameron\Documents\flight\thirdparty\enet\include;C:\Users\Cameron\Documents\flight\thirdparty\Chipmunk2D\include\chipmunk;C:\Users\Cameron\Documents\flight\thirdparty;C:\Users\Cameron\Documents\flight\thirdparty\Chipmunk2D\include;C:\Users\Cameron\Documents\flight\thirdparty\minilzo</AdditionalIncludeDirectories>
<TreatWarningAsError>true</TreatWarningAsError>
@ -173,7 +173,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;RELEASE;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(ProjectDir)\thirdparty\enet\include;$(ProjectDir)\thirdparty\Chipmunk2D\include\chipmunk;$(ProjectDir)\thirdparty;$(ProjectDir)\thirdparty\Chipmunk2D\include;$(ProjectDir)\thirdparty\minilzo;$(ProjectDir)\thirdparty\opus\include</AdditionalIncludeDirectories>
</ClCompile>
@ -236,6 +236,7 @@
<ClCompile Include="thirdparty\minilzo\minilzo.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="buildsettings.h" />
<ClInclude Include="goodpixel.gen.h" />
<ClInclude Include="hueshift.gen.h" />
<ClInclude Include="ipsettings.h" />

@ -200,6 +200,9 @@
<ClInclude Include="goodpixel.gen.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="buildsettings.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="thirdparty\enet\enet_dll.cbp" />

@ -1,3 +1,3 @@
call shadergen.bat
set compileopts=/Fe"flight_debug" /Zi /FS /Fd"flight.pdb" /DSERVER_ADDRESS="\"127.0.0.1\"" /DDEBUG_RENDERING
set compileopts=/Fe"flight_debug" /Zi /FS /Fd"flight.pdb" /DDEBUG_RENDERING /DDEBUG
call build_msvc.bat

@ -6,4 +6,4 @@ cmake ..
cmake --build .
cd -
gcc -o flight_server -Wall -O2 -Ithirdparty -Ithirdparty/opus/include -Ithirdparty/enet/include -Ithirdparty/minilzo -Ithirdparty/Chipmunk2D/include -Ithirdparty/Chipmunk2D/include/chipmunk server_main.c server.c debugdraw.c gamestate.c sokol_impl.c thirdparty/minilzo/minilzo.c thirdparty/enet/*.c thirdparty/Chipmunk2D/src/*.c -lm -lpthread -ldl thirdparty/opus/build/libopus.a
gcc -o flight_server -Wall -O2 -DRELEASE -Ithirdparty -Ithirdparty/opus/include -Ithirdparty/enet/include -Ithirdparty/minilzo -Ithirdparty/Chipmunk2D/include -Ithirdparty/Chipmunk2D/include/chipmunk server_main.c server.c debugdraw.c gamestate.c sokol_impl.c thirdparty/minilzo/minilzo.c thirdparty/enet/*.c thirdparty/Chipmunk2D/src/*.c -lm -lpthread -ldl thirdparty/opus/build/libopus.a

@ -1,3 +1,3 @@
call shadergen.bat
set compileopts=/Fe"flight_release" /O2
set compileopts=/Fe"flight_release" /O2 /DRELEASE
call build_msvc.bat

@ -0,0 +1,29 @@
#pragma once
#ifdef SERVER_ADDRESS
#error Don't define server address from the build system, use the build settings header
#endif
#ifdef DEBUG
#define SERVER_ADDRESS "127.0.0.1"
#define PROFILING
#define DEBUG_RENDERING
#define DEBUG_WORLD
#define UNLOCK_ALL
#define INFINITE_RESOURCES
#define NO_GRAVITY
#else
#ifdef RELEASE
#define SERVER_ADDRESS "207.246.80.160"
#else
#error Define either DEBUG or RELEASE
#endif
#endif

@ -1,8 +1,10 @@
#include "types.h"
#include "buildsettings.h"
#ifdef DEBUG_RENDERING
#include "sokol_gfx.h"
#include "sokol_gp.h"
#endif
#include "types.h"
#define MAX_COMMANDS 64
@ -36,8 +38,6 @@ static THREADLOCAL int command_i = 0;
void dbg_drawall()
{
// return;
#ifdef DEBUG_RENDERING
sgp_set_color(0.4f, 0.8f, 0.2f, 0.8f);
for (int i = 0; i < command_i; i++)

@ -6,7 +6,7 @@
#define PROFILING_IMPL
#include "profiling.h"
#include "ipsettings.h" // debug/developer settings
#include "buildsettings.h" // debug/developer settings
#include <stdio.h> // assert logging
#include <string.h> // memset
@ -1804,7 +1804,6 @@ cpVect thruster_force(Entity *box)
uint64_t tick(GameState *gs)
{
// return (uint64_t)floor(gs->time / ((double)TIMESTEP));
return gs->tick;
}

@ -33,7 +33,7 @@
#define MINIAUDIO_IMPLEMENTATION
#include "miniaudio.h"
#include "ipsettings.h"
#include "buildsettings.h"
#include "profiling.h"
// shaders

@ -132,7 +132,7 @@ void server(void *info_raw)
ENetAddress address;
ENetHost *enet_host;
int sethost = enet_address_set_host_ip(&address, LOCAL_SERVER_ADDRESS);
int sethost = enet_address_set_host_ip(&address, "0.0.0.0");
if (sethost != 0)
{
Log("Fishy return value from set host: %d\n", sethost);

@ -1,6 +1,6 @@
#pragma once
#include "ipsettings.h"
#include "buildsettings.h"
#define MAX_BOX_TYPES 64
#define ZOOM_MIN 0.25f
@ -96,9 +96,6 @@
#define ARRLEN(x) (sizeof(x) / sizeof((x)[0]))
// must make this header and set the target address, just #define SERVER_ADDRESS "127.0.0.1"
#include "ipsettings.h" // don't leak IP!
#include "miniaudio.h" // @Robust BAD. using miniaudio mutex construct for server thread synchronization. AWFUL!
#include "cpVect.h" // offers vector functions and types for the structs

Loading…
Cancel
Save