Compare commits

...

1 Commits

Author SHA256 Message Date
55dce5776a small fixes for windows 2026-02-09 15:25:01 +01:00
3 changed files with 21 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
#include "Debug.hpp"
#include "Color.hpp"
#include "ErrorTextureData.hpp"
#include <filesystem>
TSE::Texture::Texture(const string &path)
{
@@ -10,9 +11,20 @@ TSE::Texture::Texture(const string &path)
imagePtr = nullptr;
Size = Vector2(0,0);
fif = FreeImage_GetFileType(path.c_str(), 0);
string name = std::filesystem::absolute(path).string();
if(!std::filesystem::exists(name))
{
string msg = string("File dose not exist: ") + std::filesystem::absolute(path).string();
TSE_ERROR(msg);
Bpp = 24;
makeError(*this);
return;
}
fif = FreeImage_GetFileType(name.c_str(), 0);
if(fif == FREE_IMAGE_FORMAT::FIF_UNKNOWN)
fif = FreeImage_GetFIFFromFilename(path.c_str());
fif = FreeImage_GetFIFFromFilename(name.c_str());
if(fif == FREE_IMAGE_FORMAT::FIF_UNKNOWN)
{
TSE_ERROR("Failed to load image. Unsupported Format.");

View File

@@ -1,5 +1,6 @@
#include "TileSet.hpp"
#include "Debug.hpp"
#include "Types.hpp"
#define PADDING 0.0f
@@ -45,7 +46,7 @@ int TSE::TileSet::GetSpriteIdAt(int x, int y)
return y * resx + x;
}
uint TSE::TileSet::GetTextueID()
TSE::uint TSE::TileSet::GetTextueID()
{
return tex->GetTextureId();
}

View File

@@ -6,6 +6,9 @@
#include "IInputManager.hpp"
#include "elements/AudioEngine.hpp"
#define FREEIMAGE_LIB
#include "FI/FreeImage.h"
TSE::IWindow* TSE::IWindow::lastWindow = nullptr;
bool TSE::IWindow::BaseInit() const
@@ -14,6 +17,7 @@ bool TSE::IWindow::BaseInit() const
Debug::Init();
Debug::Log("TSE:" + TSE_VERSION_STRING);
AudioEngine::Init();
FreeImage_Initialise(true);
return true;
}
@@ -29,6 +33,7 @@ TSE::Vector2 TSE::IWindow::GetSize() const
TSE::IWindow::~IWindow()
{
FreeImage_DeInitialise();
AudioEngine::Destroy();
IInputManager::instance()->Delete();
Time::Destroy();