Elaztek Developer Hub
Blamite Game Engine - blam!  00398.09.22.23.2015.blamite
The core library for the Blamite Game Engine.
engine_resources.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 
6 #ifndef BLAM
7 #define BLAM
8 #endif
9 
18 {
22 
29 
37 };
38 
43 {
45  std::string file_path;
46  std::string id;
47 
48  void* data_address;
50 };
51 
52 namespace Blam
53 {
64  namespace EngineResources
65  {
78 
86 
95  BLAM BlamResource GetResource(std::string file_path);
96 
109  BLAM BlamResource* GetResourcePointer(std::string file_path);
110 
122  BLAM bool SaveResource(std::string file_path);
123  }
124 }
Blam
Namespace surrounding all major engine components.
Definition: blam_api.h:28
Blam::EngineResources::GetResource
BLAM BlamResource GetResource(std::string file_path)
Retrieves a resource.
Definition: engine_resources.cpp:88
Blam::EngineResources::LoadEngineResources
BLAM bool LoadEngineResources()
Loads all required engine resources.
Definition: engine_resources.cpp:77
BlamResource::data_address
void * data_address
The address pointing to the start of the resource data.
Definition: engine_resources.h:48
BlamResource::type
BlamResourceType type
The type of the resource. Used to avoid resource mishandling.
Definition: engine_resources.h:44
BlamResource
Structure containing data for an engine resource.
Definition: engine_resources.h:42
Blam::EngineResources::GetResourcePointer
BLAM BlamResource * GetResourcePointer(std::string file_path)
Retrieves a pointer to a resource.
Definition: engine_resources.cpp:94
Invalid
@ Invalid
Indicates that the resource is invalid.
Definition: engine_resources.h:36
Blam::EngineResources::ReleaseEngineResources
BLAM void ReleaseEngineResources()
Releases all engine resources.
Definition: engine_resources.cpp:83
BlamResource::data_size
int64_t data_size
The total size of the resource data.
Definition: engine_resources.h:49
ReleaseResource
void ReleaseResource(std::string file_path)
Releases a resource.
Definition: engine_resources.cpp:67
engine_resources.h
BlamResource::file_path
std::string file_path
The path to the file this resource was originally loaded from.
Definition: engine_resources.h:45
int64_t
long long int64_t
Definition: stdint.h:14
BLAM
#define BLAM
Definition: engine_resources.h:7
LoadNewResource
bool LoadNewResource(std::string file_path, BlamResourceType type, std::string id)
Loads a new resource into the engine, with an optional ID.
Definition: engine_resources.cpp:19
Blam::EngineResources::SaveResource
BLAM bool SaveResource(std::string file_path)
Saves a resource back to the disk.
Definition: engine_resources.cpp:99
ConfigResource
@ ConfigResource
Indicates that the resource refers to a configuration file.
Definition: engine_resources.h:20
engine_resources
std::vector< BlamResource > engine_resources
Definition: engine_resources.cpp:6
BlamResourceType
BlamResourceType
Enum defining all valid types of engine resources.
Definition: engine_resources.h:17
config.h
PngResource
@ PngResource
Indicates that the resource refers to a PNG image.
Definition: engine_resources.h:21
XmlResource
@ XmlResource
Indicates that the resource refers to an XML file.
Definition: engine_resources.h:19
BlamResource::id
std::string id
An optional identifier used to retrieve the resource later.
Definition: engine_resources.h:46
RawResource
@ RawResource
Indicates that the resource refers to a binary file.
Definition: engine_resources.h:28