Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c85b3a4
Finishing Assignment 1
Gavin-Lechner Feb 18, 2022
05e698d
Merge branch 'sbarrettCC:main' into main
Gavin-Lechner Mar 28, 2022
5fc21f5
Merge branch 'assignment2' of https://github.com/sbarrettCC/SocketDemo
Gavin-Lechner Mar 29, 2022
96e091b
add game to socket project
EvanTheBean Mar 30, 2022
07cebbe
try to do stuff
EvanTheBean Mar 30, 2022
919f6bd
Fix linker errors
Gavin-Lechner Mar 30, 2022
deaf3d1
add more necassary files
EvanTheBean Mar 30, 2022
17ec94c
Change git ignore
Gavin-Lechner Mar 30, 2022
e2f6a1a
sorta kinda fix some issues
EvanTheBean Mar 30, 2022
6f37c46
handle keyboard events
EvanTheBean Mar 30, 2022
8d81f0b
Changing name
Gavin-Lechner Mar 30, 2022
3b9d547
linker errors
Gavin-Lechner Mar 30, 2022
ea1910f
start fixing event system
EvanTheBean Mar 30, 2022
bc2a76a
Merge branch 'main' of https://github.com/Gavin-Lechner/SocketDemo
EvanTheBean Mar 30, 2022
21e49fd
GAME DONE!!!!!
EvanTheBean Mar 31, 2022
a517151
fix linker shit :)
EvanTheBean Mar 31, 2022
31aa71e
If something becomes catastrophically wrong, its this commit
Gavin-Lechner Mar 31, 2022
0538acb
set up game to run on server time maybe
EvanTheBean Mar 31, 2022
6cc70de
change asset path to work
EvanTheBean Mar 31, 2022
7a68a70
add unit functions
EvanTheBean Mar 31, 2022
79fad92
add get all unit functions
EvanTheBean Mar 31, 2022
03f8573
add another get all unit function
EvanTheBean Mar 31, 2022
c9ba280
save unitmanager.h
EvanTheBean Mar 31, 2022
dbb1550
Add game.cpp functions to send out worldStates
Gavin-Lechner Mar 31, 2022
e56bd77
add state changed events
EvanTheBean Mar 31, 2022
c5343d3
Merge branch 'main' of https://github.com/Gavin-Lechner/SocketDemo
EvanTheBean Mar 31, 2022
a8c4340
finish
EvanTheBean Mar 31, 2022
1057a37
initial state for assignment 3
sabarrett Apr 1, 2022
b9d08d9
Working on potential fix to frame one crash
Gavin-Lechner Apr 5, 2022
7754399
IT WORKSSSS
EvanTheBean Apr 10, 2022
fd14b4a
now it really works
EvanTheBean Apr 10, 2022
feb119b
Merge branch 'assignment3' of https://github.com/sbarrettCC/SocketDem…
Gavin-Lechner Apr 10, 2022
7db54af
Add Pseudo code for network acknowledgement
Gavin-Lechner Apr 10, 2022
4bf3d89
add package acknowledgement
EvanTheBean Apr 12, 2022
7f2e8c5
fix acknowledgment for real real
EvanTheBean Apr 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
*.user
*.pdb

Debug/
packages/
Game/DeanLib/Debug
Game/Debug
Game/GraphicsLib/Debug
RoboCat/Debug
Binary file added Debug/allegro-5.2.dll
Binary file not shown.
Binary file added Debug/allegro_acodec-5.2.dll
Binary file not shown.
Binary file added Debug/allegro_audio-5.2.dll
Binary file not shown.
Binary file added Debug/allegro_color-5.2.dll
Binary file not shown.
Binary file added Debug/allegro_dialog-5.2.dll
Binary file not shown.
Binary file added Debug/allegro_font-5.2.dll
Binary file not shown.
Binary file added Debug/allegro_image-5.2.dll
Binary file not shown.
Binary file added Debug/allegro_memfile-5.2.dll
Binary file not shown.
Binary file added Debug/allegro_physfs-5.2.dll
Binary file not shown.
Binary file added Debug/allegro_primitives-5.2.dll
Binary file not shown.
Binary file added Debug/allegro_ttf-5.2.dll
Binary file not shown.
Binary file added Debug/allegro_video-5.2.dll
Binary file not shown.
64 changes: 64 additions & 0 deletions Game/.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29411.108
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GraphicsLib", "GraphicsLib\GraphicsLib.vcxproj", "{4B9AB2DA-44CB-4F3D-866F-FA7F345BD810}"
ProjectSection(ProjectDependencies) = postProject
{DB900E08-5331-46D6-B450-6775A2C7C856} = {DB900E08-5331-46D6-B450-6775A2C7C856}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "assignment2", "assignment2.vcxproj", "{EC58DA42-88DA-4B82-BFC4-AE6D5219F837}"
ProjectSection(ProjectDependencies) = postProject
{DB900E08-5331-46D6-B450-6775A2C7C856} = {DB900E08-5331-46D6-B450-6775A2C7C856}
{4B9AB2DA-44CB-4F3D-866F-FA7F345BD810} = {4B9AB2DA-44CB-4F3D-866F-FA7F345BD810}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DeanLib", "..\..\..\..\common\DeanLib\DeanLib.vcxproj", "{DB900E08-5331-46D6-B450-6775A2C7C856}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4B9AB2DA-44CB-4F3D-866F-FA7F345BD810}.Debug|ARM.ActiveCfg = Debug|Win32
{4B9AB2DA-44CB-4F3D-866F-FA7F345BD810}.Debug|x64.ActiveCfg = Debug|x64
{4B9AB2DA-44CB-4F3D-866F-FA7F345BD810}.Debug|x64.Build.0 = Debug|x64
{4B9AB2DA-44CB-4F3D-866F-FA7F345BD810}.Debug|x86.ActiveCfg = Debug|Win32
{4B9AB2DA-44CB-4F3D-866F-FA7F345BD810}.Debug|x86.Build.0 = Debug|Win32
{4B9AB2DA-44CB-4F3D-866F-FA7F345BD810}.Release|ARM.ActiveCfg = Release|Win32
{4B9AB2DA-44CB-4F3D-866F-FA7F345BD810}.Release|x64.ActiveCfg = Release|x64
{4B9AB2DA-44CB-4F3D-866F-FA7F345BD810}.Release|x64.Build.0 = Release|x64
{4B9AB2DA-44CB-4F3D-866F-FA7F345BD810}.Release|x86.ActiveCfg = Release|Win32
{4B9AB2DA-44CB-4F3D-866F-FA7F345BD810}.Release|x86.Build.0 = Release|Win32
{EC58DA42-88DA-4B82-BFC4-AE6D5219F837}.Debug|ARM.ActiveCfg = Debug|Win32
{EC58DA42-88DA-4B82-BFC4-AE6D5219F837}.Debug|x64.ActiveCfg = Debug|x64
{EC58DA42-88DA-4B82-BFC4-AE6D5219F837}.Debug|x64.Build.0 = Debug|x64
{EC58DA42-88DA-4B82-BFC4-AE6D5219F837}.Debug|x86.ActiveCfg = Debug|Win32
{EC58DA42-88DA-4B82-BFC4-AE6D5219F837}.Debug|x86.Build.0 = Debug|Win32
{EC58DA42-88DA-4B82-BFC4-AE6D5219F837}.Release|ARM.ActiveCfg = Release|Win32
{EC58DA42-88DA-4B82-BFC4-AE6D5219F837}.Release|x64.ActiveCfg = Release|x64
{EC58DA42-88DA-4B82-BFC4-AE6D5219F837}.Release|x64.Build.0 = Release|x64
{EC58DA42-88DA-4B82-BFC4-AE6D5219F837}.Release|x86.ActiveCfg = Release|Win32
{EC58DA42-88DA-4B82-BFC4-AE6D5219F837}.Release|x86.Build.0 = Release|Win32
{DB900E08-5331-46D6-B450-6775A2C7C856}.Debug|ARM.ActiveCfg = Debug|Win32
{DB900E08-5331-46D6-B450-6775A2C7C856}.Debug|x64.ActiveCfg = Debug|Win32
{DB900E08-5331-46D6-B450-6775A2C7C856}.Debug|x86.ActiveCfg = Debug|Win32
{DB900E08-5331-46D6-B450-6775A2C7C856}.Debug|x86.Build.0 = Debug|Win32
{DB900E08-5331-46D6-B450-6775A2C7C856}.Release|ARM.ActiveCfg = Release|Win32
{DB900E08-5331-46D6-B450-6775A2C7C856}.Release|x64.ActiveCfg = Release|Win32
{DB900E08-5331-46D6-B450-6775A2C7C856}.Release|x86.ActiveCfg = Release|Win32
{DB900E08-5331-46D6-B450-6775A2C7C856}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2392FBF6-47CE-4D54-8F5B-DB78E5C9942D}
EndGlobalSection
EndGlobal
7 changes: 7 additions & 0 deletions Game/DeanLib/CircularQueue.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "CircularQueue.h"






88 changes: 88 additions & 0 deletions Game/DeanLib/DataRepository.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#include "DataRepository.h"
#include <cstring>

DataEntry::DataEntry( int val )
:mType(INT_VAL)
{
mData.intVal = val;
}

DataEntry::DataEntry( float val )
:mType(FLOAT_VAL)
{
mData.floatVal = val;
}

DataEntry::DataEntry( double val )
:mType(DOUBLE_VAL)
{
mData.doubleVal = val;
}

DataEntry::DataEntry( const std::string& val )
:mType(STRING_VAL)
{
assert( val.size() + 1 < MAX_STRING_VAL_SIZE );
strcpy_s( mData.stringVal, val.c_str() );
}

DataEntry::DataEntry( UINT val )
:mType(UINT_VAL)
{
mData.uintVal = val;
}

void DataRepository::addEntry( const DataKey& key, int val )
{
DataEntry entry( val );
mMap[key] = entry;
}

void DataRepository::addEntry( const DataKey& key, float val )
{
DataEntry entry( val );
mMap[key] = entry;
}

void DataRepository::addEntry( const DataKey& key, double val )
{
DataEntry entry( val );
mMap[key] = entry;
}

void DataRepository::addEntry( const DataKey& key, const std::string& val )
{
DataEntry entry( val );
mMap[key] = entry;
}

void DataRepository::addEntry( const DataKey& key, UINT val )
{
DataEntry entry( val );
mMap[key] = entry;
}

const DataEntry& DataRepository::getEntry( const DataKey& key )
{
static DataEntry nullEntry(0);

auto iter = mMap.find( key );
if( iter != mMap.end() )
{
return iter->second;
}
else
{
return nullEntry;
}
}

bool DataRepository::hasEntry(const DataKey& key)
{
auto iter = mMap.find(key);
if (iter != mMap.end())
return true;
else
return false;
}

25 changes: 25 additions & 0 deletions Game/DeanLib/DeanLib.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29102.190
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DeanLib", "DeanLib.vcxproj", "{DB900E08-5331-46D6-B450-6775A2C7C856}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DB900E08-5331-46D6-B450-6775A2C7C856}.Debug|Win32.ActiveCfg = Debug|Win32
{DB900E08-5331-46D6-B450-6775A2C7C856}.Debug|Win32.Build.0 = Debug|Win32
{DB900E08-5331-46D6-B450-6775A2C7C856}.Release|Win32.ActiveCfg = Release|Win32
{DB900E08-5331-46D6-B450-6775A2C7C856}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {03C61B9A-23B1-4AE3-B273-100743DFB149}
EndGlobalSection
EndGlobal
111 changes: 111 additions & 0 deletions Game/DeanLib/DeanLib.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" 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>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{DB900E08-5331-46D6-B450-6775A2C7C856}</ProjectGuid>
<RootNamespace>DeanLib</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</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>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(ProjectDir)lib\</OutDir>
<TargetName>$(ProjectName)$(Configuration)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(ProjectDir)lib\</OutDir>
<TargetName>$(ProjectName)$(Configuration)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="DataRepository.cpp" />
<ClCompile Include="DeanLibUtilities.cpp" />
<ClCompile Include="DeanMath.cpp" />
<ClCompile Include="MemoryPool.cpp" />
<ClCompile Include="MemoryTracker.cpp" />
<ClCompile Include="PerformanceTracker.cpp" />
<ClCompile Include="RayCaster.cpp" />
<ClCompile Include="Timer.cpp" />
<ClCompile Include="Trackable.cpp" />
<ClCompile Include="Vector2D.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\ConditionalCallback.h" />
<ClInclude Include="include\DeanMath.h" />
<ClInclude Include="include\RayCaster.h" />
<ClInclude Include="include\TimedCallback.h" />
<ClInclude Include="include\CircularQueue.h" />
<ClInclude Include="include\DataRepository.h" />
<ClInclude Include="include\DeanLibDefines.h" />
<ClInclude Include="include\DeanLibUtilities.h" />
<ClInclude Include="include\MemoryPool.h" />
<ClInclude Include="include\MemoryTracker.h" />
<ClInclude Include="include\MultiDimensionalArray.h" />
<ClInclude Include="include\PerformanceTracker.h" />
<ClInclude Include="include\Timer.h" />
<ClInclude Include="include\Trackable.h" />
<ClInclude Include="include\Vector2D.h" />
</ItemGroup>
<ItemGroup>
<None Include="DeanLib.sln" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
42 changes: 42 additions & 0 deletions Game/DeanLib/DeanLibUtilities.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#include "DeanLibUtilities.h"

using namespace std;

string peekString(ifstream& stream)
{
if (!stream.good() || stream.eof())
{
return "";
}

int charCnt = 0;
auto currPos = stream.cur;

string theString;
while (!stream.eof())
{
char c;
stream >> c;
if (c != ' ')
{
charCnt++;
theString += c;
}
}

if (charCnt > 0)
{
stream.seekg(currPos + charCnt);
return theString;
}
else
{
return "";
}
}

int peekInt(std::ifstream& stream)
{
return 0;
}

21 changes: 21 additions & 0 deletions Game/DeanLib/DeanMath.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include "DeanMath.h"
#include "Vector2D.h"

double calcDotProduct(const Vector2D& vector1, const Vector2D& vector2)
{
return vector1.dotProduct(vector2);
}

double mapToRangeMinusPiToPi(double val)
{
while (val < -PI)
{
val += DOUBLE_PI;
}

while (val > PI)
{
val -= DOUBLE_PI;
}
return val;
}
Binary file added Game/DeanLib/Desktop.ini
Binary file not shown.
Loading