Skip to content

Commit

Permalink
Fix for VS 2015 that hopefully doesn't break 2010
Browse files Browse the repository at this point in the history
  • Loading branch information
BSVino committed May 8, 2016
1 parent 7523d2e commit bf8ddd6
Show file tree
Hide file tree
Showing 242 changed files with 63,384 additions and 31 deletions.
36 changes: 27 additions & 9 deletions MFGD.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.;.\common;.\include;.\math</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_MBCS;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS;_USE_MATH_DEFINES</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.;.\common;.\include;.\math;.\glfw-2.7.9\lib\win32;.\glfw-2.7.9\lib</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_MBCS;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS;_USE_MATH_DEFINES;_GLFW_NO_DLOAD_GDI32;_GLFW_NO_DLOAD_WINMM</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>opengl32.lib;gdi32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand All @@ -56,14 +56,14 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_MBCS;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS;_USE_MATH_DEFINES</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.;.\common;.\include;.\math</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_MBCS;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS;_USE_MATH_DEFINES;_GLFW_NO_DLOAD_GDI32;_GLFW_NO_DLOAD_WINMM</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.;.\common;.\include;.\math;.\glfw-2.7.9\lib\win32;.\glfw-2.7.9\lib</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>opengl32.lib;gdi32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand All @@ -75,6 +75,27 @@
<ClCompile Include="game\game.cpp" />
<ClCompile Include="game\handle.cpp" />
<ClCompile Include="game\main.cpp" />
<ClCompile Include="glfw-2.7.9\lib\enable.c" />
<ClCompile Include="glfw-2.7.9\lib\fullscreen.c" />
<ClCompile Include="glfw-2.7.9\lib\glext.c" />
<ClCompile Include="glfw-2.7.9\lib\image.c" />
<ClCompile Include="glfw-2.7.9\lib\init.c" />
<ClCompile Include="glfw-2.7.9\lib\input.c" />
<ClCompile Include="glfw-2.7.9\lib\joystick.c" />
<ClCompile Include="glfw-2.7.9\lib\stream.c" />
<ClCompile Include="glfw-2.7.9\lib\tga.c" />
<ClCompile Include="glfw-2.7.9\lib\thread.c" />
<ClCompile Include="glfw-2.7.9\lib\time.c" />
<ClCompile Include="glfw-2.7.9\lib\win32\win32_dllmain.c" />
<ClCompile Include="glfw-2.7.9\lib\win32\win32_enable.c" />
<ClCompile Include="glfw-2.7.9\lib\win32\win32_fullscreen.c" />
<ClCompile Include="glfw-2.7.9\lib\win32\win32_glext.c" />
<ClCompile Include="glfw-2.7.9\lib\win32\win32_init.c" />
<ClCompile Include="glfw-2.7.9\lib\win32\win32_joystick.c" />
<ClCompile Include="glfw-2.7.9\lib\win32\win32_thread.c" />
<ClCompile Include="glfw-2.7.9\lib\win32\win32_time.c" />
<ClCompile Include="glfw-2.7.9\lib\win32\win32_window.c" />
<ClCompile Include="glfw-2.7.9\lib\window.c" />
<ClCompile Include="math\collision.cpp" />
<ClCompile Include="math\color.cpp" />
<ClCompile Include="math\euler.cpp" />
Expand All @@ -91,9 +112,6 @@
<ClCompile Include="renderer\shaders.cpp" />
<ClCompile Include="renderer\stanfordbunny.cpp" />
</ItemGroup>
<ItemGroup>
<Library Include="lib\libglfw.lib" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="game\character.h" />
<ClInclude Include="game\game.h" />
Expand Down
71 changes: 66 additions & 5 deletions MFGD.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
<Filter Include="Source Files\common">
<UniqueIdentifier>{82401f27-cafa-4e62-9911-1483e2fbd0d7}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\glfw">
<UniqueIdentifier>{b0e9908d-8c6e-48b8-afa7-dee47e860e28}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="game\main.cpp">
Expand Down Expand Up @@ -102,11 +105,69 @@
<ClCompile Include="common\mtrand.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Library Include="lib\libglfw.lib">
<Filter>Libraries</Filter>
</Library>
<ClCompile Include="glfw-2.7.9\lib\enable.c">
<Filter>Source Files\glfw</Filter>
</ClCompile>
<ClCompile Include="glfw-2.7.9\lib\fullscreen.c">
<Filter>Source Files\glfw</Filter>
</ClCompile>
<ClCompile Include="glfw-2.7.9\lib\glext.c">
<Filter>Source Files\glfw</Filter>
</ClCompile>
<ClCompile Include="glfw-2.7.9\lib\image.c">
<Filter>Source Files\glfw</Filter>
</ClCompile>
<ClCompile Include="glfw-2.7.9\lib\init.c">
<Filter>Source Files\glfw</Filter>
</ClCompile>
<ClCompile Include="glfw-2.7.9\lib\input.c">
<Filter>Source Files\glfw</Filter>
</ClCompile>
<ClCompile Include="glfw-2.7.9\lib\joystick.c">
<Filter>Source Files\glfw</Filter>
</ClCompile>
<ClCompile Include="glfw-2.7.9\lib\stream.c">
<Filter>Source Files\glfw</Filter>
</ClCompile>
<ClCompile Include="glfw-2.7.9\lib\tga.c">
<Filter>Source Files\glfw</Filter>
</ClCompile>
<ClCompile Include="glfw-2.7.9\lib\thread.c">
<Filter>Source Files\glfw</Filter>
</ClCompile>
<ClCompile Include="glfw-2.7.9\lib\time.c">
<Filter>Source Files\glfw</Filter>
</ClCompile>
<ClCompile Include="glfw-2.7.9\lib\window.c">
<Filter>Source Files\glfw</Filter>
</ClCompile>
<ClCompile Include="glfw-2.7.9\lib\win32\win32_time.c">
<Filter>Source Files\glfw</Filter>
</ClCompile>
<ClCompile Include="glfw-2.7.9\lib\win32\win32_window.c">
<Filter>Source Files\glfw</Filter>
</ClCompile>
<ClCompile Include="glfw-2.7.9\lib\win32\win32_dllmain.c">
<Filter>Source Files\glfw</Filter>
</ClCompile>
<ClCompile Include="glfw-2.7.9\lib\win32\win32_enable.c">
<Filter>Source Files\glfw</Filter>
</ClCompile>
<ClCompile Include="glfw-2.7.9\lib\win32\win32_fullscreen.c">
<Filter>Source Files\glfw</Filter>
</ClCompile>
<ClCompile Include="glfw-2.7.9\lib\win32\win32_glext.c">
<Filter>Source Files\glfw</Filter>
</ClCompile>
<ClCompile Include="glfw-2.7.9\lib\win32\win32_init.c">
<Filter>Source Files\glfw</Filter>
</ClCompile>
<ClCompile Include="glfw-2.7.9\lib\win32\win32_joystick.c">
<Filter>Source Files\glfw</Filter>
</ClCompile>
<ClCompile Include="glfw-2.7.9\lib\win32\win32_thread.c">
<Filter>Source Files\glfw</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="game\game.h">
Expand Down
22 changes: 12 additions & 10 deletions game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,14 @@ void CGame::Load()
m_projectile_position[0] = m_projectile_initial_position;
m_projectile_velocity[0] = m_projectile_initial_velocity;

#if DO_SEAWEED
for (int k = 0; k < sizeof(g_seaweed) / sizeof(g_seaweed[0]); k++)
{
g_seaweed[k].m_positions[0][0] = g_seaweed[k].m_positions[1][0] = vec3(g_seaweed_positions[k].x, 0, g_seaweed_positions[k].y);
for (int n = 1; n < SEAWEED_LINKS; n++)
g_seaweed[k].m_positions[0][n] = g_seaweed[k].m_positions[1][n] = g_seaweed[k].m_positions[0][n - 1] + vec3(0, g_seaweed_link_length, 0);
}
#endif

memcpy(g_spline.m_points, g_spline_points, sizeof(g_spline_points));
g_spline.InitializeSpline();
Expand Down Expand Up @@ -625,7 +627,7 @@ void CGame::Draw()
Matrix4x4 m;
m.SetTranslation(g_spline_points[k]);
c.LoadTransform(m);
c.RenderBox(Vector(-0.1, -0.1, -0.1), Vector(0.1, 0.1, 0.1));
c.RenderBox(Vector(-0.1f, -0.1f, -0.1f), Vector(0.1f, 0.1f, 0.1f));
}

c.ResetTransformations();
Expand All @@ -648,21 +650,21 @@ void CGame::Draw()
c.EndRender();

Matrix4x4 m;
m.SetTranslation(g_spline.SplineAtTime(fmod(Application()->GetTime()/2, SPLINE_POINTS-1)));
m.SetTranslation(g_spline.SplineAtTime(fmod(Application()->GetTime()/2, (float)SPLINE_POINTS-1)));
c.LoadTransform(m);
c.RenderBox(Vector(-0.1, -0.1, -0.1), Vector(0.1, 0.1, 0.1));
c.RenderBox(Vector(-0.1f, -0.1f, -0.1f), Vector(0.1f, 0.1f, 0.1f));

m.SetTranslation(g_spline.SplineAtTime(fmod((Application()->GetTime()+0.1f)/2, SPLINE_POINTS-1)));
m.SetTranslation(g_spline.SplineAtTime(fmod((Application()->GetTime()+0.1f)/2, (float)SPLINE_POINTS-1)));
c.LoadTransform(m);
c.RenderBox(Vector(-0.1, -0.1, -0.1), Vector(0.1, 0.1, 0.1));
c.RenderBox(Vector(-0.1f, -0.1f, -0.1f), Vector(0.1f, 0.1f, 0.1f));

m.SetTranslation(g_spline.SplineAtTime(fmod((Application()->GetTime()+0.2f)/2, SPLINE_POINTS-1)));
m.SetTranslation(g_spline.SplineAtTime(fmod((Application()->GetTime()+0.2f)/2, (float)SPLINE_POINTS-1)));
c.LoadTransform(m);
c.RenderBox(Vector(-0.1, -0.1, -0.1), Vector(0.1, 0.1, 0.1));
c.RenderBox(Vector(-0.1f, -0.1f, -0.1f), Vector(0.1f, 0.1f, 0.1f));

m.SetTranslation(g_spline.SplineAtTime(fmod((Application()->GetTime()+0.3f)/2, SPLINE_POINTS-1)));
m.SetTranslation(g_spline.SplineAtTime(fmod((Application()->GetTime()+0.3f)/2, (float)SPLINE_POINTS-1)));
c.LoadTransform(m);
c.RenderBox(Vector(-0.1, -0.1, -0.1), Vector(0.1, 0.1, 0.1));
c.RenderBox(Vector(-0.1f, -0.1f, -0.1f), Vector(0.1f, 0.1f, 0.1f));
}

pRenderer->FinishRendering(&r);
Expand Down Expand Up @@ -1228,7 +1230,7 @@ void CGame::GraphDraw()

if (show_path)
{
float lerp = fmod(GetTime(), 1);
float lerp = fmod(GetTime(), 1.0f);
Vector position = path_start * (1-lerp) + path_end * lerp;
c.RenderBox(position - Vector(0.2f, 0.2f, 0.2f), position + Vector(0.2f, 0.2f, 0.2f));
}
Expand Down
12 changes: 9 additions & 3 deletions game/seaweed.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ struct Seaweed
vec3 m_positions[2][SEAWEED_LINKS];
};

//#define NUM_SEAWEEDS 29
#define NUM_SEAWEEDS 0
#define DO_SEAWEED 0
#define NUM_SEAWEEDS 29
Seaweed g_seaweed[NUM_SEAWEEDS];
float g_seaweed_link_length = 3.5f;
float g_mass_per_link = 1.0f;
Expand Down Expand Up @@ -179,6 +179,9 @@ void SimulateSeaweed()
{
g_seaweed_simulation_time += SEAWEED_FRAMERATE;

if (!DO_SEAWEED)
return;

if (!g_wave_vectors_cube[0].x)
{
g_wave_vectors_cube[0] = g_wave_vectors[0] * g_wave_vectors[0] * g_wave_vectors[0] * g_wave_magnitudes[0];
Expand Down Expand Up @@ -250,6 +253,9 @@ void SimulateSeaweed()

void RenderSeaweed()
{
if (!DO_SEAWEED)
return;

CRenderingContext c(Game()->GetRenderer(), true);

Vector camera = Game()->m_hPlayer->GetGlobalView();
Expand Down Expand Up @@ -279,7 +285,7 @@ void RenderSeaweed()
Matrix4x4 m;
m.SetTranslation(g_seaweed[k].m_positions[g_seaweed_current_list][n] + offset_vector);
c.LoadTransform(m);
c.RenderBox(Vector(-0.1, -0.1, -0.1), Vector(0.1, 0.1, 0.1));
c.RenderBox(Vector(-0.1f, -0.1f, -0.1f), Vector(0.1f, 0.1f, 0.1f));
}
}

Expand Down
Binary file added glfw-2.7.9/.readme.html.swp
Binary file not shown.
Binary file added glfw-2.7.9/.swp
Binary file not shown.
22 changes: 22 additions & 0 deletions glfw-2.7.9/COPYING.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright (c) 2002-2006 Marcus Geelnard
Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would
be appreciated but is not required.

2. Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.

3. This notice may not be removed or altered from any source
distribution.

Loading

0 comments on commit bf8ddd6

Please sign in to comment.