Android Fixes
This commit is contained in:
@ -22,6 +22,8 @@
|
||||
|
||||
#include <IAEngine/EngineLibraryInterface.hpp>
|
||||
|
||||
#include <SDL3/SDL_iostream.h>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
EXTERN SDL_Window *g_windowHandle;
|
||||
@ -36,10 +38,25 @@ namespace ia::iae
|
||||
#endif
|
||||
}
|
||||
|
||||
Vector<UINT8> Engine::ReadBinaryAsset(IN CONST String &path)
|
||||
{
|
||||
SDL_IOStream* f = SDL_IOFromFile(path.c_str(), "rb");
|
||||
if(!f)
|
||||
THROW_FILE_OPEN_READ(path);
|
||||
Vector<UINT8> result;
|
||||
SDL_SeekIO(f, 0, SDL_IO_SEEK_END);
|
||||
result.resize(SDL_TellIO(f));
|
||||
SDL_SeekIO(f, 0, SDL_IO_SEEK_SET);
|
||||
SDL_ReadIO(f, result.data(), result.size());
|
||||
SDL_CloseIO(f);
|
||||
return result;
|
||||
}
|
||||
|
||||
Direction Engine::GetVectorPointingDirection(IN Vec2 v)
|
||||
{
|
||||
STATIC CONSTEXPR Direction DIRECTION_MAP[] = {Direction::RIGHT, Direction::DOWN_RIGHT, Direction::DOWN, Direction::DOWN_LEFT,
|
||||
Direction::LEFT, Direction::UP_LEFT, Direction::UP, Direction::UP_RIGHT};
|
||||
STATIC CONSTEXPR Direction DIRECTION_MAP[] = {Direction::RIGHT, Direction::DOWN_RIGHT, Direction::DOWN,
|
||||
Direction::DOWN_LEFT, Direction::LEFT, Direction::UP_LEFT,
|
||||
Direction::UP, Direction::UP_RIGHT};
|
||||
if ((abs(v.x) <= FLOAT32_EPSILON) && (abs(v.y) <= FLOAT32_EPSILON))
|
||||
return Direction::NONE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user