Add Visual Studio project and fix some bugs

main
Cameron Murphy Reikes 2 years ago
parent 5af0639504
commit db273d9b2d

2
.gitignore vendored

@ -1,5 +1,7 @@
ipsettings.h
.vs/
x64/
*.exe
*.obj
*.pdb

@ -0,0 +1,21 @@
{
"configurations": [
{
"inheritEnvironments": [
"msvc_x86"
],
"name": "x86-Debug",
"includePath": [
"${env.INCLUDE}",
"${workspaceRoot}\\**"
],
"defines": [
"WIN32",
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"intelliSenseMode": "windows-msvc-x86"
}
]
}

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32901.215
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Flight", "Flight.vcxproj", "{5A0EDC10-F875-4CD0-AF1D-CC7E13336AF6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5A0EDC10-F875-4CD0-AF1D-CC7E13336AF6}.Debug|x64.ActiveCfg = Debug|x64
{5A0EDC10-F875-4CD0-AF1D-CC7E13336AF6}.Debug|x64.Build.0 = Debug|x64
{5A0EDC10-F875-4CD0-AF1D-CC7E13336AF6}.Debug|x86.ActiveCfg = Debug|Win32
{5A0EDC10-F875-4CD0-AF1D-CC7E13336AF6}.Debug|x86.Build.0 = Debug|Win32
{5A0EDC10-F875-4CD0-AF1D-CC7E13336AF6}.Release|x64.ActiveCfg = Release|x64
{5A0EDC10-F875-4CD0-AF1D-CC7E13336AF6}.Release|x64.Build.0 = Release|x64
{5A0EDC10-F875-4CD0-AF1D-CC7E13336AF6}.Release|x86.ActiveCfg = Release|Win32
{5A0EDC10-F875-4CD0-AF1D-CC7E13336AF6}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {31496860-491F-46FA-9219-598559F5A1E7}
EndGlobalSection
EndGlobal

@ -0,0 +1,195 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{5a0edc10-f875-4cd0-af1d-cc7e13336af6}</ProjectGuid>
<RootNamespace>Flight</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<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</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>$(CoreLibraryDependencies);%(AdditionalDependencies);Ws2_32.lib;winmm.lib</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="debugdraw.c" />
<ClCompile Include="gamestate.c" />
<ClCompile Include="main.c" />
<ClCompile Include="server.c" />
<ClCompile Include="sokol_impl.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\chipmunk.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpArbiter.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpArray.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpBBTree.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpBody.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpCollision.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpConstraint.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpDampedRotarySpring.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpDampedSpring.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpGearJoint.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpGrooveJoint.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpHashSet.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpHastySpace.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpMarch.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpPinJoint.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpPivotJoint.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpPolyline.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpPolyShape.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpRatchetJoint.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpRobust.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpRotaryLimitJoint.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpShape.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpSimpleMotor.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpSlideJoint.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpSpace.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpSpaceComponent.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpSpaceDebug.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpSpaceHash.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpSpaceQuery.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpSpaceStep.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpSpatialIndex.c" />
<ClCompile Include="thirdparty\Chipmunk2D\src\cpSweep1D.c" />
<ClCompile Include="thirdparty\enet\callbacks.c" />
<ClCompile Include="thirdparty\enet\compress.c" />
<ClCompile Include="thirdparty\enet\host.c" />
<ClCompile Include="thirdparty\enet\list.c" />
<ClCompile Include="thirdparty\enet\packet.c" />
<ClCompile Include="thirdparty\enet\peer.c" />
<ClCompile Include="thirdparty\enet\protocol.c" />
<ClCompile Include="thirdparty\enet\win32.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="ipsettings.h" />
<ClInclude Include="thirdparty\sokol_app.h" />
<ClInclude Include="thirdparty\sokol_gfx.h" />
<ClInclude Include="thirdparty\sokol_glue.h" />
<ClInclude Include="thirdparty\sokol_gp.h" />
<ClInclude Include="thirdparty\sokol_time.h" />
<ClInclude Include="thirdparty\stb_image.h" />
<ClInclude Include="triangle.gen.h" />
<ClInclude Include="types.h" />
</ItemGroup>
<ItemGroup>
<None Include="thirdparty\enet\enet_dll.cbp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

@ -0,0 +1,188 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\debugdraw.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\gamestate.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\main.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\server.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\sokol_impl.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\chipmunk.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpArbiter.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpArray.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpBBTree.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpBody.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpCollision.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpConstraint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpDampedRotarySpring.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpDampedSpring.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpGearJoint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpGrooveJoint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpHashSet.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpHastySpace.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpMarch.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpPinJoint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpPivotJoint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpPolyline.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpPolyShape.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpRatchetJoint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpRobust.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpRotaryLimitJoint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpShape.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpSimpleMotor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpSlideJoint.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpSpace.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpSpaceComponent.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpSpaceDebug.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpSpaceHash.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpSpaceQuery.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpSpaceStep.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpSpatialIndex.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\Chipmunk2D\src\cpSweep1D.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\enet\callbacks.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\enet\compress.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\enet\host.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\enet\list.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\enet\packet.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\enet\peer.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\enet\protocol.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\thirdparty\enet\win32.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\ipsettings.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\triangle.gen.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\thirdparty\sokol_app.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\thirdparty\sokol_gfx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\thirdparty\sokol_glue.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\thirdparty\sokol_gp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\thirdparty\sokol_time.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\thirdparty\stb_image.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\thirdparty\enet\enet_dll.cbp">
<Filter>Source Files</Filter>
</None>
</ItemGroup>
</Project>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ShowAllFiles>true</ShowAllFiles>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerCommandArguments>--serve</LocalDebuggerCommandArguments>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>

@ -14,7 +14,7 @@ pushd thirdparty\Chipmunk2D\src
popd
@REM /DENET_DEBUG=1^
cl /MP /Zi /Fd"flight.pdb" /Fe"flight"^
cl /MP /Zi /FS /Fd"flight.pdb" /Fe"flight"^
/I"thirdparty" /I"thirdparty\enet\include" /I"thirdparty\Chipmunk2D\include\chipmunk" /I"thirdparty\Chipmunk2D\include"^
main.c gamestate.c server.c debugdraw.c^
thirdparty\enet\callbacks.c thirdparty\enet\compress.c thirdparty\enet\host.c thirdparty\enet\list.c thirdparty\enet\packet.c thirdparty\enet\peer.c thirdparty\enet\protocol.c thirdparty\enet\win32.c Ws2_32.lib winmm.lib^

@ -121,6 +121,7 @@ void box_remove_from_boxes(GameState *gs, Entity *box)
box->prev_box = (EntityID){0};
}
void on_entity_child_shape(cpBody* body, cpShape* shape, void* data);
void entity_destroy(GameState *gs, Entity *e)
{
assert(e->exists);
@ -135,15 +136,18 @@ void entity_destroy(GameState *gs, Entity *e)
box_remove_from_boxes(gs, e);
}
if (e->body != NULL)
{
cpSpaceRemoveBody(gs->space, e->body);
cpBodyFree(e->body);
}
if (e->shape != NULL)
{
cpSpaceRemoveShape(gs->space, e->shape);
cpShapeFree(e->shape);
e->shape = NULL;
}
if (e->body != NULL)
{
cpBodyEachShape(e->body, on_entity_child_shape, (void*)gs);
cpSpaceRemoveBody(gs->space, e->body);
cpBodyFree(e->body);
e->body = NULL;
}
e->body = NULL;
e->shape = NULL;
@ -158,6 +162,11 @@ void entity_destroy(GameState *gs, Entity *e)
gs->free_list = get_id(gs, e);
}
void on_entity_child_shape(cpBody* body, cpShape* shape, void* data)
{
entity_destroy((GameState*)data, cp_shape_entity(shape));
}
Entity *new_entity(struct GameState *gs)
{
Entity *to_return = NULL;
@ -1081,7 +1090,7 @@ void process(struct GameState *gs, float dt)
{
Entity *new_grid = new_entity(gs);
grid_create(gs, new_grid);
p->spice_taken_away += 0.2f;
p->spice_taken_away += 0.1f;
entity_set_pos(new_grid, world_build);
Entity *new_box = new_entity(gs);
@ -1096,6 +1105,7 @@ void process(struct GameState *gs, float dt)
box_create(gs, new_box, target_grid, grid_world_to_local(target_grid, world_build));
new_box->box_type = player->input.build_type;
new_box->compass_rotation = player->input.build_rotation;
p->spice_taken_away += 0.1f;
}
}
#endif

@ -699,8 +699,8 @@ static void frame(void)
void cleanup(void)
{
free(gs.entities);
destroy(&gs);
free(gs.entities);
sgp_shutdown();
sg_shutdown();
enet_deinitialize();

2
thirdparty/enet vendored

@ -1 +1 @@
Subproject commit b06d15457909d54cd4fc0ba58c3b257d7e913f7f
Subproject commit eabda75009b6cb662185b041948bd54ccddb01ad
Loading…
Cancel
Save