OpenGothic
Open source reimplementation of Gothic I and II
Loading...
Searching...
No Matches
Resources Class Referencefinal

#include <resources.h>

Classes

struct  Vertex
 
struct  VertexA
 
struct  VertexFsq
 
struct  VertexL
 

Public Types

enum class  FontType : uint8_t {
  Normal , Hi , Disabled , Yellow ,
  Red
}
 
enum  { MaxFramesInFlight = 2 , ShadowLayers = 2 }
 
using VobTree = std::vector< std::shared_ptr< zenkit::VirtualObject > >
 

Public Member Functions

 Resources (Tempest::Device &device)
 
 ~Resources ()
 

Static Public Member Functions

static Tempest::Device & device ()
 
static const char * renderer ()
 
static void mountWork (const std::filesystem::path &path)
 
static void loadVdfs (const std::vector< std::u16string > &modvdfs, bool modFilter)
 
static const Tempest::Sampler & shadowSampler ()
 
static const GthFontdialogFont (const float scale)
 
static const GthFontfont (const float scale)
 
static const GthFontfont (FontType type, const float scale)
 
static const GthFontfont (std::string_view fname, FontType type, const float scale)
 
static const Tempest::Texture2d & fallbackTexture ()
 
static const Tempest::Texture2d & fallbackBlack ()
 
static auto fallbackImage () -> const Tempest::StorageImage &
 
static Tempest::Texture2d loadTextureUncached (std::string_view name, bool forceMips=false)
 
static const Tempest::Texture2d * loadTexture (std::string_view name, bool forceMips=false)
 
static const Tempest::Texture2d * loadTexture (Tempest::Color color)
 
static const Tempest::Texture2d * loadTexture (std::string_view name, int32_t v, int32_t c)
 
static Tempest::Texture2d loadTexturePm (const Tempest::Pixmap &pm)
 
static auto loadTextureAnim (std::string_view name) -> std::vector< const Tempest::Texture2d * >
 
static Material loadMaterial (const zenkit::Material &src, bool enableAlphaTest)
 
static const AttachBinderbindMesh (const ProtoMesh &anim, const Skeleton &s)
 
static const ProtoMeshloadMesh (std::string_view name)
 
static const PfxEmitterMeshloadEmiterMesh (std::string_view name)
 
static const SkeletonloadSkeleton (std::string_view name)
 
static const AnimationloadAnimation (std::string_view name)
 
static Tempest::Sound loadSoundBuffer (std::string_view name)
 
static Dx8::PatternList loadDxMusic (std::string_view name)
 
static DmSegment * loadMusicSegment (char const *name)
 
static const ProtoMeshdecalMesh (const zenkit::VisualDecal &decal)
 
static const VobTreeloadVobBundle (std::string_view name)
 
template<class V >
static Tempest::VertexBuffer< V > vbo (const V *data, size_t sz)
 
template<class I >
static Tempest::IndexBuffer< I > ibo (const I *data, size_t sz)
 
static Tempest::StorageBuffer ssbo (const void *data, size_t size)
 
static Tempest::StorageBuffer ssbo (Tempest::Uninitialized_t, size_t size)
 
template<class V , class I >
static Tempest::AccelerationStructure blas (const Tempest::VertexBuffer< V > &b, const Tempest::IndexBuffer< I > &i, size_t offset, size_t size)
 
static void resetRecycled (uint8_t fId)
 
static void recycle (Tempest::DescriptorArray &&arr)
 
static void recycle (Tempest::StorageBuffer &&ssbo)
 
static void recycle (Tempest::StorageImage &&img)
 
static void recycle (Tempest::Attachment &&img)
 
static void recycle (Tempest::ZBuffer &&img)
 
static void recycle (Tempest::AccelerationStructure &&rtas)
 
static std::vector< uint8_t > getFileData (std::string_view name)
 
static bool getFileData (std::string_view name, std::vector< uint8_t > &dat)
 
static std::unique_ptr< zenkit::Read > getFileBuffer (std::string_view name)
 
static auto openReader (std::string_view name, std::unique_ptr< zenkit::Read > &read) -> std::unique_ptr< zenkit::ReadArchive >
 
static bool hasFile (std::string_view fname)
 
static const zenkit::Vfs & vdfsIndex ()
 
static const Tempest::IndexBuffer< uint16_t > & cubeIbo ()
 

Static Public Attributes

static const size_t MAX_NUM_SKELETAL_NODES = 96
 
static const size_t MAX_MORPH_LAYERS = 4
 

Detailed Description

Definition at line 34 of file resources.h.

Member Typedef Documentation

◆ VobTree

using Resources::VobTree = std::vector<std::shared_ptr<zenkit::VirtualObject> >

Definition at line 81 of file resources.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MaxFramesInFlight 
ShadowLayers 

Definition at line 47 of file resources.h.

◆ FontType

enum class Resources::FontType : uint8_t
strong
Enumerator
Normal 
Hi 
Disabled 
Yellow 
Red 

Definition at line 39 of file resources.h.

Constructor & Destructor Documentation

◆ Resources()

Resources::Resources ( Tempest::Device &  device)
explicit

Definition at line 54 of file resources.cpp.

◆ ~Resources()

Resources::~Resources ( )

Definition at line 182 of file resources.cpp.

Member Function Documentation

◆ bindMesh()

const AttachBinder * Resources::bindMesh ( const ProtoMesh anim,
const Skeleton s 
)
static

Definition at line 1018 of file resources.cpp.

◆ blas()

template<class V , class I >
static Tempest::AccelerationStructure Resources::blas ( const Tempest::VertexBuffer< V > &  b,
const Tempest::IndexBuffer< I > &  i,
size_t  offset,
size_t  size 
)
inlinestatic

Definition at line 130 of file resources.h.

◆ cubeIbo()

const Tempest::IndexBuffer< uint16_t > & Resources::cubeIbo ( )
static

Definition at line 314 of file resources.cpp.

◆ decalMesh()

const ProtoMesh * Resources::decalMesh ( const zenkit::VisualDecal &  decal)
static

Definition at line 927 of file resources.cpp.

◆ device()

static Tempest::Device & Resources::device ( )
inlinestatic

Definition at line 83 of file resources.h.

◆ dialogFont()

const GthFont & Resources::dialogFont ( const float  scale)
static

Definition at line 280 of file resources.cpp.

◆ fallbackBlack()

const Texture2d & Resources::fallbackBlack ( )
static

Definition at line 302 of file resources.cpp.

◆ fallbackImage()

const Tempest::StorageImage & Resources::fallbackImage ( ) -> const Tempest::StorageImage&
static

Definition at line 306 of file resources.cpp.

◆ fallbackTexture()

const Texture2d & Resources::fallbackTexture ( )
static

Definition at line 298 of file resources.cpp.

◆ font() [1/3]

const GthFont & Resources::font ( const float  scale)
static

Definition at line 284 of file resources.cpp.

◆ font() [2/3]

const GthFont & Resources::font ( Resources::FontType  type,
const float  scale 
)
static

Definition at line 288 of file resources.cpp.

◆ font() [3/3]

const GthFont & Resources::font ( std::string_view  fname,
FontType  type,
const float  scale 
)
static

Definition at line 292 of file resources.cpp.

◆ getFileBuffer()

std::unique_ptr< zenkit::Read > Resources::getFileBuffer ( std::string_view  name)
static

Definition at line 216 of file resources.cpp.

◆ getFileData() [1/2]

std::vector< uint8_t > Resources::getFileData ( std::string_view  name)
static

Definition at line 210 of file resources.cpp.

◆ getFileData() [2/2]

bool Resources::getFileData ( std::string_view  name,
std::vector< uint8_t > &  dat 
)
static

Definition at line 192 of file resources.cpp.

◆ hasFile()

bool Resources::hasFile ( std::string_view  fname)
static

Definition at line 187 of file resources.cpp.

◆ ibo()

template<class I >
static Tempest::IndexBuffer< I > Resources::ibo ( const I *  data,
size_t  sz 
)
inlinestatic

Definition at line 123 of file resources.h.

◆ loadAnimation()

const Animation * Resources::loadAnimation ( std::string_view  name)
static

Definition at line 898 of file resources.cpp.

◆ loadDxMusic()

Dx8::PatternList Resources::loadDxMusic ( std::string_view  name)
static

Definition at line 917 of file resources.cpp.

◆ loadEmiterMesh()

const PfxEmitterMesh * Resources::loadEmiterMesh ( std::string_view  name)
static

Definition at line 884 of file resources.cpp.

◆ loadMaterial()

Material Resources::loadMaterial ( const zenkit::Material &  src,
bool  enableAlphaTest 
)
static

Definition at line 873 of file resources.cpp.

◆ loadMesh()

const ProtoMesh * Resources::loadMesh ( std::string_view  name)
static

Definition at line 877 of file resources.cpp.

◆ loadMusicSegment()

DmSegment * Resources::loadMusicSegment ( char const *  name)
static

Definition at line 922 of file resources.cpp.

◆ loadSkeleton()

const Skeleton * Resources::loadSkeleton ( std::string_view  name)
static

Definition at line 891 of file resources.cpp.

◆ loadSoundBuffer()

Tempest::Sound Resources::loadSoundBuffer ( std::string_view  name)
static

Definition at line 912 of file resources.cpp.

◆ loadTexture() [1/3]

const Texture2d * Resources::loadTexture ( std::string_view  name,
bool  forceMips = false 
)
static

Definition at line 785 of file resources.cpp.

◆ loadTexture() [2/3]

const Texture2d * Resources::loadTexture ( std::string_view  name,
int32_t  v,
int32_t  c 
)
static

Definition at line 809 of file resources.cpp.

◆ loadTexture() [3/3]

const Texture2d * Resources::loadTexture ( Tempest::Color  color)
static

Definition at line 790 of file resources.cpp.

◆ loadTextureAnim()

std::vector< const Texture2d * > Resources::loadTextureAnim ( std::string_view  name) -> std::vector<const Tempest::Texture2d*>
static

Definition at line 831 of file resources.cpp.

◆ loadTexturePm()

Texture2d Resources::loadTexturePm ( const Tempest::Pixmap &  pm)
static

Definition at line 864 of file resources.cpp.

◆ loadTextureUncached()

Texture2d Resources::loadTextureUncached ( std::string_view  name,
bool  forceMips = false 
)
static

Definition at line 781 of file resources.cpp.

◆ loadVdfs()

void Resources::loadVdfs ( const std::vector< std::u16string > &  modvdfs,
bool  modFilter 
)
static

Definition at line 129 of file resources.cpp.

◆ loadVobBundle()

const Resources::VobTree * Resources::loadVobBundle ( std::string_view  name)
static

Definition at line 932 of file resources.cpp.

◆ mountWork()

void Resources::mountWork ( const std::filesystem::path &  path)
static

Definition at line 124 of file resources.cpp.

◆ openReader()

std::unique_ptr< zenkit::ReadArchive > Resources::openReader ( std::string_view  name,
std::unique_ptr< zenkit::Read > &  read 
) -> std::unique_ptr<zenkit::ReadArchive>
static

Definition at line 223 of file resources.cpp.

◆ recycle() [1/6]

void Resources::recycle ( Tempest::AccelerationStructure &&  rtas)
static

Definition at line 983 of file resources.cpp.

◆ recycle() [2/6]

void Resources::recycle ( Tempest::Attachment &&  img)
static

Definition at line 969 of file resources.cpp.

◆ recycle() [3/6]

void Resources::recycle ( Tempest::DescriptorArray &&  arr)
static

Definition at line 948 of file resources.cpp.

◆ recycle() [4/6]

void Resources::recycle ( Tempest::StorageBuffer &&  ssbo)
static

Definition at line 955 of file resources.cpp.

◆ recycle() [5/6]

void Resources::recycle ( Tempest::StorageImage &&  img)
static

Definition at line 962 of file resources.cpp.

◆ recycle() [6/6]

void Resources::recycle ( Tempest::ZBuffer &&  img)
static

Definition at line 976 of file resources.cpp.

◆ renderer()

const char * Resources::renderer ( )
static

Definition at line 237 of file resources.cpp.

◆ resetRecycled()

void Resources::resetRecycled ( uint8_t  fId)
static

Definition at line 937 of file resources.cpp.

◆ shadowSampler()

const Sampler & Resources::shadowSampler ( )
static

Definition at line 249 of file resources.cpp.

◆ ssbo() [1/2]

static Tempest::StorageBuffer Resources::ssbo ( const void *  data,
size_t  size 
)
inlinestatic

Definition at line 125 of file resources.h.

◆ ssbo() [2/2]

static Tempest::StorageBuffer Resources::ssbo ( Tempest::Uninitialized_t  ,
size_t  size 
)
inlinestatic

Definition at line 126 of file resources.h.

◆ vbo()

template<class V >
static Tempest::VertexBuffer< V > Resources::vbo ( const V *  data,
size_t  sz 
)
inlinestatic

Definition at line 120 of file resources.h.

◆ vdfsIndex()

const zenkit::Vfs & Resources::vdfsIndex ( )
static

Definition at line 310 of file resources.cpp.

Member Data Documentation

◆ MAX_MORPH_LAYERS

const size_t Resources::MAX_MORPH_LAYERS = 4
static

Definition at line 53 of file resources.h.

◆ MAX_NUM_SKELETAL_NODES

const size_t Resources::MAX_NUM_SKELETAL_NODES = 96
static

Definition at line 52 of file resources.h.


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