Skip to content

Commit

Permalink
sln file "missing project" fix
Browse files Browse the repository at this point in the history
  • Loading branch information
durkisneer1 committed Nov 14, 2023
1 parent 994e06d commit 30c8e71
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 27 deletions.
13 changes: 0 additions & 13 deletions DurkGame.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ VisualStudioVersion = 17.7.34221.43
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DurkGame", "DurkGame\DurkGame.vcxproj", "{C8039DE4-2274-4BAB-868B-A6151876B0F0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NewGame", "..\NewGame\NewGame\NewGame.vcxproj", "{C10D201C-0003-4857-94C7-E55EC0ABBB52}"
ProjectSection(ProjectDependencies) = postProject
{C8039DE4-2274-4BAB-868B-A6151876B0F0} = {C8039DE4-2274-4BAB-868B-A6151876B0F0}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand All @@ -26,14 +21,6 @@ Global
{C8039DE4-2274-4BAB-868B-A6151876B0F0}.Release|x64.Build.0 = Release|x64
{C8039DE4-2274-4BAB-868B-A6151876B0F0}.Release|x86.ActiveCfg = Release|Win32
{C8039DE4-2274-4BAB-868B-A6151876B0F0}.Release|x86.Build.0 = Release|Win32
{C10D201C-0003-4857-94C7-E55EC0ABBB52}.Debug|x64.ActiveCfg = Debug|x64
{C10D201C-0003-4857-94C7-E55EC0ABBB52}.Debug|x64.Build.0 = Debug|x64
{C10D201C-0003-4857-94C7-E55EC0ABBB52}.Debug|x86.ActiveCfg = Debug|Win32
{C10D201C-0003-4857-94C7-E55EC0ABBB52}.Debug|x86.Build.0 = Debug|Win32
{C10D201C-0003-4857-94C7-E55EC0ABBB52}.Release|x64.ActiveCfg = Release|x64
{C10D201C-0003-4857-94C7-E55EC0ABBB52}.Release|x64.Build.0 = Release|x64
{C10D201C-0003-4857-94C7-E55EC0ABBB52}.Release|x86.ActiveCfg = Release|Win32
{C10D201C-0003-4857-94C7-E55EC0ABBB52}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
6 changes: 3 additions & 3 deletions DurkGame/Clock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ namespace dk {
Clock() = default;
~Clock() = default;

float tick(int frameRate = 0);
float tick(Uint32 frameRate = 0);

private:
Uint32 startTicks = 0;
Uint32 endTicks = 0;
Uint32 startTick = 0;
Uint32 endTick = 0;
};
}
}
1 change: 1 addition & 0 deletions DurkGame/DurkGame.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>
Expand Down
24 changes: 13 additions & 11 deletions DurkGame/clock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@

namespace dk {
namespace time {
float Clock::tick(int frameRate) {
endTicks = SDL_GetTicks() - startTicks;
if (frameRate > 0) {
int frameDelay = 1000 / frameRate;
if (endTicks < frameDelay) {
Uint32 neutralTicks = frameDelay - endTicks;
SDL_Delay(neutralTicks);
endTicks = neutralTicks;
}
float Clock::tick(Uint32 frameRate) {
if (frameRate <= 0) return 0.0f;

endTick = SDL_GetTicks() - startTick;
Uint32 frameTime = 1000 / frameRate;

if (endTick < frameTime) {
Uint32 neutralTicks = frameTime - endTick;
SDL_Delay(neutralTicks);
endTick = neutralTicks;
}
startTicks = SDL_GetTicks();
return (float)endTicks;

startTick = SDL_GetTicks();
return (float)endTick;
}
}
}

0 comments on commit 30c8e71

Please sign in to comment.