Skip to content

Commit ae3dc92

Browse files
committed
Remove projects
1 parent 46d9d1e commit ae3dc92

File tree

13 files changed

+33
-202
lines changed

13 files changed

+33
-202
lines changed

src/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,6 @@ add_library(Strife.Engine STATIC
160160
Net/FileTransfer.hpp
161161
Net/FileTransfer.cpp
162162
Net/SyncVar.cpp
163-
Project/Project.cpp
164-
Project/Project.hpp
165163
Resource/ResourceManager.hpp Resource/SpriteResource.hpp Resource/SpriteResource.cpp Resource/ResourceManager.cpp Resource/TilemapResource.hpp Resource/TilemapResource.cpp Resource/SpriteFontResource.hpp Resource/SpriteFontResource.cpp
166164
Resource/ShaderResource.cpp Resource/ShaderResource.hpp Components/ParticleSystemComponent.hpp Components/ParticleSystemComponent.cpp Scene/Isometric.hpp Scene/Isometric.cpp Components/IsometricSpriteComponent.hpp Components/IsometricSpriteComponent.cpp Resource/FileResource.hpp Resource/FileResource.cpp ML/UtilityAI.hpp Resource/ScriptResource.hpp Resource/ScriptResource.cpp ML/GridSensor.hpp Renderer/SpriteEffect.hpp Renderer/SpriteEffect.cpp Renderer/Stage/RenderPipeline.hpp Renderer/Stage/RenderPipeline.cpp Resource/SpriteAtlasResource.hpp Resource/SpriteAtlasResource.cpp Resource/ResourceSettings.hpp Components/AnimatorComponent.hpp Components/AnimatorComponent.cpp)
167165

src/Components/AnimatorComponent.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ DEFINE_COMPONENT(AnimatorComponent)
3333

3434
bool AnimationComplete() const { return _animationComplete; }
3535

36-
3736
void PlayAnimation(StringId name, AnimationPlayMode mode);
3837

3938
void Render(Renderer* renderer) override;

src/Engine.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#pragma once
22
#include <functional>
33
#include <optional>
4-
#include <Project/Project.hpp>
5-
4+
#include <memory>
65

76
#include "Memory/BlockAllocator.hpp"
87
#include "Tools/ConsoleVar.hpp"
@@ -106,8 +105,6 @@ class Engine
106105
bool _activeGame = true;
107106
EngineConfig _config;
108107

109-
Project _project;
110-
111108
std::function<void()> _loadResources;
112109
};
113110

src/Project/Project.cpp

Lines changed: 0 additions & 107 deletions
This file was deleted.

src/Project/Project.hpp

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/Renderer/SdlManager.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,24 @@ SdlManager::SdlManager(Input* input, bool isHeadless)
100100
void SdlManager::Init()
101101
{
102102
#ifdef _WIN32
103-
HRESULT hr = SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
103+
HRESULT hr = SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);unsigned int flags = SDL_INIT_EVENTS | SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_TIMER;
104+
105+
if (SDL_Init(flags) < 0)
106+
{
107+
FatalError("Failed to initialize SDL: %s", SDL_GetError());
108+
}
104109
if (FAILED(hr))
105110
{
106111
_com_error err(hr);
107112
fwprintf(stderr, L"SetProcessDpiAwareness: %hs\n", err.ErrorMessage());
108113
}
109114
#endif
110115

111-
if (SDL_Init(SDL_INIT_EVERYTHING) < 0)
116+
unsigned int flags = SDL_INIT_EVENTS | SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_TIMER;
117+
118+
if (SDL_Init(flags) < 0)
112119
{
113-
FatalError("Failed to initialize SDL");
120+
FatalError("Failed to initialize SDL: %s", SDL_GetError());
114121
}
115122

116123
SetDefaultValuesOnFirstRun();

src/Scene/IEntityEvent.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,10 @@ bool IsContactBeginWith(const IEntityEvent& ev, TEntity*& outEntity)
184184
const ContactBeginEvent* contactBegin;
185185
return ev.Is(contactBegin) && contactBegin->other.OwningEntity()->Is<TEntity>(outEntity);
186186
}
187+
188+
template<typename TEntity>
189+
bool IsContactBeginWith(const IEntityEvent& ev)
190+
{
191+
const ContactBeginEvent* contactBegin;
192+
return ev.Is(contactBegin) && contactBegin->other.OwningEntity()->Is<TEntity>();
193+
}

src/Scene/IGame.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include "System/BinaryStreamReader.hpp"
66
#include "Tools/Console.hpp"
77
#include "Renderer/SdlManager.hpp"
8-
#include "Project/Project.hpp"
98

109
void IGame::Run()
1110
{
@@ -41,8 +40,6 @@ void IGame::Run()
4140
{
4241
_engine->GetSdlManager()->SetWindowCaption(_config.windowCaption.value().c_str());
4342
}
44-
45-
project = std::make_shared<Project>(_config.projectFilePath);
4643
}
4744

4845
// Run the game

src/Scene/IGame.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ struct GameConfig
5454
return *this;
5555
}
5656

57-
GameConfig& SetProjectFile(const std::filesystem::path& path)
58-
{
59-
projectFilePath = path;
60-
return *this;
61-
}
62-
6357
GameConfig& EnableMultiplayer()
6458
{
6559
isMultiplayer = true;
@@ -74,7 +68,6 @@ struct GameConfig
7468

7569
StringId defaultScene = "empty-map"_sid;
7670
std::string gameName;
77-
std::filesystem::path projectFilePath;
7871
std::optional<std::string> windowCaption;
7972
std::optional<std::string> userConfigFile;
8073
std::optional<std::string> devConsoleFont;
@@ -118,7 +111,6 @@ class IGame
118111
return _config;
119112
}
120113

121-
std::shared_ptr<Project> project;
122114
private:
123115
std::unique_ptr<Engine> _engine = nullptr;
124116
GameConfig _config;

src/Scene/Scene.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ void Scene::LoadMapSegment(const char* name)
200200

201201
void Scene::LoadMapSegment(const MapSegment& segment)
202202
{
203-
auto tileMap = CreateEntity<TilemapEntity>({ 0, 0 });
203+
auto tileMap = CreateEntity<TilemapEntity>(Vector2(0, 0 ));
204204
tileMap->SetMapSegment(segment);
205205

206206
}

0 commit comments

Comments
 (0)