small fixes for windows
This commit is contained in:
@@ -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.");
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user