small fixes for windows

This commit is contained in:
2026-02-09 15:25:01 +01:00
parent 330d4b26dc
commit 55dce5776a
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();
}