This commit is contained in:
Bram Verhulst
2024-06-04 14:38:46 +02:00
parent e1165fdcb4
commit d7389411f5
9 changed files with 68 additions and 37 deletions

View File

@@ -12,29 +12,13 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="26a0623a-44d5-441c-8048-32ff1dab3479" name="Changes" comment=""> <list default="true" id="26a0623a-44d5-441c-8048-32ff1dab3479" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/.idea.Motherload/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.Motherload/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/.idea.Motherload/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.Motherload/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Engine/Collision.h" beforeDir="false" afterPath="$PROJECT_DIR$/Engine/Collision.h" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Game/Game.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Game.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Engine/SoundEffect.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Engine/SoundEffect.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Engine/SoundEffect.h" beforeDir="false" afterPath="$PROJECT_DIR$/Engine/SoundEffect.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Engine/Text.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Engine/Text.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Engine/colors.h" beforeDir="false" afterPath="$PROJECT_DIR$/Engine/colors.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Game/GameManager.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/GameManager.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Game/GameManager.h" beforeDir="false" afterPath="$PROJECT_DIR$/Game/GameManager.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Game/GridSystem/WorldTile.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/GridSystem/WorldTile.cpp" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Game/GridSystem/WorldTile.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/GridSystem/WorldTile.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Game/GridSystem/WorldTile.h" beforeDir="false" afterPath="$PROJECT_DIR$/Game/GridSystem/WorldTile.h" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Game/Gui/Screen.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Gui/Screen.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Game/Gui/GuiMeter.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Gui/GuiMeter.cpp" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Game/Gui/Screen.h" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Gui/Screen.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Game/Gui/GuiText.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Gui/GuiText.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Game/Gui/Screens/FuelScreen.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Gui/Screens/FuelScreen.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Game/Gui/Screens/FuelScreen.h" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Gui/Screens/FuelScreen.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Game/Gui/Screens/MainScreen.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Gui/Screens/MainScreen.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Game/Gui/Screens/ScreenManager.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Gui/Screens/ScreenManager.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Game/Gui/Screens/ScreenManager.h" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Gui/Screens/ScreenManager.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Game/Levels/World/Building.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Levels/World/Building.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Game/Levels/World/Building.h" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Levels/World/Building.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Game/Levels/World/WorldLevel.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Levels/World/WorldLevel.cpp" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Game/Levels/World/WorldLevel.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Levels/World/WorldLevel.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Game/Levels/World/WorldLevel.h" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Levels/World/WorldLevel.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Game/Player.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Player.cpp" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Game/Player.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Player.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Game/Player.h" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Player.h" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Game/Player.h" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Player.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Resources/gui/fuel/background.png" beforeDir="false" afterPath="$PROJECT_DIR$/Resources/gui/fuel/background.png" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -463,6 +447,8 @@
<workItem from="1716806194636" duration="82000" /> <workItem from="1716806194636" duration="82000" />
<workItem from="1716817512182" duration="4362000" /> <workItem from="1716817512182" duration="4362000" />
<workItem from="1716892028109" duration="12355000" /> <workItem from="1716892028109" duration="12355000" />
<workItem from="1717443362042" duration="1602000" />
<workItem from="1717488475405" duration="1118000" />
</task> </task>
<task id="LOCAL-00001" summary="Rework Tile detection system"> <task id="LOCAL-00001" summary="Rework Tile detection system">
<option name="closed" value="true" /> <option name="closed" value="true" />

View File

@@ -14,7 +14,7 @@
Rectf Game::VIEWPORT {}; Rectf Game::VIEWPORT {};
Game::Game(const Window& window) Game::Game(const Window& window)
: BaseGame { window }, m_Camera(Camera()), m_WorldLevel(WorldLevel(&m_Camera, GetViewPort())), : BaseGame { window }, m_Camera(Camera()), m_WorldLevel(&m_Camera, GetViewPort()),
m_MainMenuLevel(MainMenuLevel(&m_Camera)), m_pCurrentLevel(&m_WorldLevel) { m_MainMenuLevel(MainMenuLevel(&m_Camera)), m_pCurrentLevel(&m_WorldLevel) {
Initialize(); Initialize();
Game::VIEWPORT = GetViewPort(); //TODO: See if this can be removed Game::VIEWPORT = GetViewPort(); //TODO: See if this can be removed

View File

@@ -110,15 +110,15 @@ void WorldTile::Draw() {
// return; // return;
// } // }
// else { // else {
this->DrawSide(TileDirection::TopLeft); this->DrawSide(TileDirection::TopLeft);
this->DrawSide(TileDirection::TopRight); this->DrawSide(TileDirection::TopRight);
this->DrawSide(TileDirection::BottomLeft); this->DrawSide(TileDirection::BottomLeft);
this->DrawSide(TileDirection::BottomRight); this->DrawSide(TileDirection::BottomRight);
this->DrawSide(TileDirection::TopMiddle); this->DrawSide(TileDirection::TopMiddle);
this->DrawSide(TileDirection::BottomMiddle); this->DrawSide(TileDirection::BottomMiddle);
this->DrawSide(TileDirection::MiddleLeft); this->DrawSide(TileDirection::MiddleLeft);
this->DrawSide(TileDirection::MiddleRight); this->DrawSide(TileDirection::MiddleRight);
// } // }
break; break;
} }

View File

@@ -2,9 +2,10 @@
#include "Screen.h" #include "Screen.h"
Screen::Screen(const std::string& filePath, Vector2f pos, Vector2f size, TextureManager* manager): m_Position(pos), m_Size(size) { Screen::Screen(const std::string& filePath, Vector2f pos, Vector2f size, TextureManager* manager): m_Position(pos), m_Size(size) {
if(!filePath.empty()) { if (!filePath.empty()) {
m_Background = manager->GetTexture(filePath); m_Background = manager->GetTexture(filePath);
} else { }
else {
m_Background = nullptr; m_Background = nullptr;
} }
} }
@@ -13,13 +14,16 @@ Screen::~Screen() {
delete b; delete b;
} }
} }
void Screen::AddElement(GuiElement* element) {
m_Elements.push_back(element);
}
void Screen::Update(float elapsedSecs) { void Screen::Update(float elapsedSecs) {
for (GuiElement* b : m_Elements) { for (GuiElement* b : m_Elements) {
b->Update(elapsedSecs); b->Update(elapsedSecs);
} }
} }
void Screen::Draw() const { void Screen::Draw() const {
if(m_Background != nullptr) { //Incase there is no background if (m_Background != nullptr) { //Incase there is no background
Rectf dest = Rectf(m_Position, m_Size); Rectf dest = Rectf(m_Position, m_Size);
Rectf src = Rectf(0, 0, m_Background->GetWidth(), m_Background->GetHeight()); Rectf src = Rectf(0, 0, m_Background->GetWidth(), m_Background->GetHeight());
m_Background->Draw(dest, src, false); m_Background->Draw(dest, src, false);

View File

@@ -14,7 +14,7 @@ public:
virtual ~Screen(); virtual ~Screen();
void AddElement(GuiElement* element) { m_Elements.push_back(element); } void AddElement(GuiElement* element);
virtual void Update(float elapsedSecs); virtual void Update(float elapsedSecs);
virtual void Draw() const; virtual void Draw() const;

View File

@@ -18,7 +18,7 @@
class GroundTileType; class GroundTileType;
WorldLevel::WorldLevel(Camera* camera, Rectf viewport): Level(camera), WorldLevel::WorldLevel(Camera* camera, Rectf viewport): Level(camera),
m_GridManager(WorldGridManager()), m_GridManager(WorldGridManager()),
m_Player(Player { Vector2f { 0, 100 }, TextureManager::GetInstance() }), m_Player(Vector2f { 0, 100 }, TextureManager::GetInstance()),
m_MousePos { 0, 0 }, m_MousePos { 0, 0 },
m_Viewport(viewport), m_Viewport(viewport),
m_ScreenManager(ScreenManager::GetInstance()) { m_ScreenManager(ScreenManager::GetInstance()) {

View File

@@ -45,9 +45,6 @@ Player::Player(const Vector2f& Position, TextureManager* manager) : m_Position(P
m_currentAnimation = m_walkAnimation; m_currentAnimation = m_walkAnimation;
} }
Player::Player(Player&& other) {
}
Player::~Player() { Player::~Player() {
delete m_walkAnimation; delete m_walkAnimation;

View File

@@ -35,7 +35,7 @@ class Player
public: public:
explicit Player(const Vector2f& Position, TextureManager* pTextureManager); explicit Player(const Vector2f& Position, TextureManager* pTextureManager);
Player( const Player& other ) = default; Player( const Player& other ) = default;
Player(Player&& other); Player(Player&& other) = delete;
Player& operator=(const Player& other) = delete; Player& operator=(const Player& other) = delete;
Player& operator=(Player&& other) = delete; Player& operator=(Player&& other) = delete;

44
Prog2Engine.sln Normal file
View File

@@ -0,0 +1,44 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33205.214
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Engine", "Engine\Engine.vcxproj", "{5ADAB721-CB6C-4EF5-89EB-20EC51A13CFC}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Game", "Game\Game.vcxproj", "{0F40114E-3E0C-4195-B425-91FD5EF586AD}"
ProjectSection(ProjectDependencies) = postProject
{5ADAB721-CB6C-4EF5-89EB-20EC51A13CFC} = {5ADAB721-CB6C-4EF5-89EB-20EC51A13CFC}
EndProjectSection
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
{5ADAB721-CB6C-4EF5-89EB-20EC51A13CFC}.Debug|x64.ActiveCfg = Debug|x64
{5ADAB721-CB6C-4EF5-89EB-20EC51A13CFC}.Debug|x64.Build.0 = Debug|x64
{5ADAB721-CB6C-4EF5-89EB-20EC51A13CFC}.Debug|x86.ActiveCfg = Debug|Win32
{5ADAB721-CB6C-4EF5-89EB-20EC51A13CFC}.Debug|x86.Build.0 = Debug|Win32
{5ADAB721-CB6C-4EF5-89EB-20EC51A13CFC}.Release|x64.ActiveCfg = Release|x64
{5ADAB721-CB6C-4EF5-89EB-20EC51A13CFC}.Release|x64.Build.0 = Release|x64
{5ADAB721-CB6C-4EF5-89EB-20EC51A13CFC}.Release|x86.ActiveCfg = Release|Win32
{5ADAB721-CB6C-4EF5-89EB-20EC51A13CFC}.Release|x86.Build.0 = Release|Win32
{0F40114E-3E0C-4195-B425-91FD5EF586AD}.Debug|x64.ActiveCfg = Debug|x64
{0F40114E-3E0C-4195-B425-91FD5EF586AD}.Debug|x64.Build.0 = Debug|x64
{0F40114E-3E0C-4195-B425-91FD5EF586AD}.Debug|x86.ActiveCfg = Debug|Win32
{0F40114E-3E0C-4195-B425-91FD5EF586AD}.Debug|x86.Build.0 = Debug|Win32
{0F40114E-3E0C-4195-B425-91FD5EF586AD}.Release|x64.ActiveCfg = Release|x64
{0F40114E-3E0C-4195-B425-91FD5EF586AD}.Release|x64.Build.0 = Release|x64
{0F40114E-3E0C-4195-B425-91FD5EF586AD}.Release|x86.ActiveCfg = Release|Win32
{0F40114E-3E0C-4195-B425-91FD5EF586AD}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {27FA23C0-0475-411E-8608-8E2AD2B00C26}
EndGlobalSection
EndGlobal