Oficina Framework  1.3
Games Framework
OficinaFramework::IOSystem Class Reference

Provides methods for loading compressed data. More...

#include <IOSystem.hpp>

Classes

class  ScriptStream
 Reads a script as a byte stream. More...
 
class  ScriptTools
 A class for opening and loading Gongly Script data. Works since Gongly Script v1.0. More...
 

Static Public Member Functions

static void init (const char *currentpath)
 Initializes the path. More...
 
static void dispose ()
 Closes the path. More...
 
static bool AddToSearchPath (std::string file)
 Adds a compressed file to the beginning of the search path. More...
 
static byteLoad (std::string asset_path, qword_s &size)
 Loads a raw file, from path. More...
 
static SDL_Surface * LoadTexture (std::string asset_path)
 Loads a texture, PNG format, from path. More...
 
static bool IsBigEndian ()
 Check whether the current system is big endian. More...
 
static ScriptStreamLoadScriptByteStream (std::string script_path)
 Loads an entire entity script from path, as a binary stream. If you're not using IOSystem::ScriptTools, remember to unload it. More...
 
static void SwapEndianness16 (word &val)
 Swaps endianness of 16-bit variable. More...
 
static void SwapEndianness16 (word_s &val)
 
static void SwapEndianness32 (dword &val)
 Swaps endianness of 32-bit variable. More...
 
static void SwapEndianness32 (int &val)
 
static void SwapEndianness64 (qword &val)
 Swaps endianness of 64-bit variable. More...
 
static void SwapEndianness64 (qword_s &val)
 
static void SwapEndiannessF (float &val)
 Swaps endianness of float variable. More...
 
static void SwapEndiannessD (double &val)
 Swaps endianness of double variable. More...
 
static bool IsInitialized ()
 Gets if the IOSystem is initialized. More...
 

Detailed Description

Provides methods for loading compressed data.

Member Function Documentation

◆ AddToSearchPath()

static bool OficinaFramework::IOSystem::AddToSearchPath ( std::string  file)
static

Adds a compressed file to the beginning of the search path.

Returns
Whether it could be added or not.

◆ dispose()

static void OficinaFramework::IOSystem::dispose ( )
static

Closes the path.

◆ init()

static void OficinaFramework::IOSystem::init ( const char *  currentpath)
static

Initializes the path.

Parameters
currentpathCurrent running path - argv's [0] position.

◆ IsBigEndian()

static bool OficinaFramework::IOSystem::IsBigEndian ( )
static

Check whether the current system is big endian.

Returns
Whether the system is big endian or not.

◆ IsInitialized()

static bool OficinaFramework::IOSystem::IsInitialized ( )
static

Gets if the IOSystem is initialized.

Returns
Whether it is initialized or not.

◆ Load()

static byte* OficinaFramework::IOSystem::Load ( std::string  asset_path,
qword_s size 
)
static

Loads a raw file, from path.

Returns
A pointer to the loaded file, or NULL if it can't be loaded.
Parameters
asset_pathPath to the asset on the actual Path.
sizeSize of structure to be loaded.

◆ LoadScriptByteStream()

static ScriptStream* OficinaFramework::IOSystem::LoadScriptByteStream ( std::string  script_path)
static

Loads an entire entity script from path, as a binary stream. If you're not using IOSystem::ScriptTools, remember to unload it.

Parameters
script_pathPath to the script on the actual Path.

◆ LoadTexture()

static SDL_Surface* OficinaFramework::IOSystem::LoadTexture ( std::string  asset_path)
static

Loads a texture, PNG format, from path.

Returns
A pointer to the loaded SDL_Surface, or NULL if it can't be loaded.
Parameters
asset_pathPath to the asset on the actual Path.

◆ SwapEndianness16() [1/2]

static void OficinaFramework::IOSystem::SwapEndianness16 ( word val)
static

Swaps endianness of 16-bit variable.

Parameters
valValue to be swapped.

◆ SwapEndianness16() [2/2]

static void OficinaFramework::IOSystem::SwapEndianness16 ( word_s val)
static

◆ SwapEndianness32() [1/2]

static void OficinaFramework::IOSystem::SwapEndianness32 ( dword val)
static

Swaps endianness of 32-bit variable.

Parameters
valValue to be swapped.

◆ SwapEndianness32() [2/2]

static void OficinaFramework::IOSystem::SwapEndianness32 ( int &  val)
static

◆ SwapEndianness64() [1/2]

static void OficinaFramework::IOSystem::SwapEndianness64 ( qword val)
static

Swaps endianness of 64-bit variable.

Parameters
valValue to be swapped.

◆ SwapEndianness64() [2/2]

static void OficinaFramework::IOSystem::SwapEndianness64 ( qword_s val)
static

◆ SwapEndiannessD()

static void OficinaFramework::IOSystem::SwapEndiannessD ( double &  val)
static

Swaps endianness of double variable.

Parameters
valValue to be swapped.

◆ SwapEndiannessF()

static void OficinaFramework::IOSystem::SwapEndiannessF ( float &  val)
static

Swaps endianness of float variable.

Parameters
valValue to be swapped.

The documentation for this class was generated from the following file: