Blamite Game Engine - blam!  00296.01.12.21.0102.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;
49  int64_t data_size;
50 };
51 
52 namespace Blam
53 {
62  namespace EngineResources
63  {
76 
84 
93  BLAM BlamResource GetResource(std::string file_path);
94 
107  BLAM BlamResource* GetResourcePointer(std::string file_path);
108 
120  BLAM bool SaveResource(std::string file_path);
121  }
122 }
Blam
Namespace surrounding all major engine components.
Definition: blam_api.h:18
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
BlamResource::file_path
std::string file_path
The path to the file this resource was originally loaded from.
Definition: engine_resources.h:45
BLAM
#define BLAM
Definition: engine_resources.h:7
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
BlamResourceType
BlamResourceType
Enum defining all valid types of engine resources.
Definition: engine_resources.h:17
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