coastline 0.0.4
Loading...
Searching...
No Matches
enginetextures.h
Go to the documentation of this file.
1#pragma once
2
8
9#include <cstdint>
10#include <vector>
11
13#include "common/vehicleview.h"
14
15namespace coastline {
16
19 int width = 0;
20 int height = 0;
22 unsigned version = 0;
23};
24
27public:
33 EngineTextures(const EngineTextures &) = delete;
36
39
42 return m_backend;
43 }
44
46 return m_reflections;
47 }
48
50 unsigned Create(const unsigned char *image,
51 const unsigned char *palette,
52 int width,
53 int height,
54 int lineBytes);
56 void Load(unsigned entry, const unsigned char *colors);
58 const EngineTexture *Find(unsigned entry) const;
60 void Clear();
61
62private:
64 SdlRenderBackendState m_backend{};
65 SdlVehicleReflections m_reflections{};
66};
67
80 const unsigned char *image, const unsigned char *palette, int width, int height, int lineBytes);
81
94int DecodeEngineTexture(void *destination,
95 const unsigned char *image,
96 const unsigned char *palette,
97 int width,
98 int height,
99 int lineBytes);
100
108void LoadEngineTexture(unsigned entry, const unsigned char *colors);
109
115const EngineTexture *FindEngineTexture(unsigned entry);
116
119
120} // namespace coastline
EngineTextures(const EngineTextures &)=delete
Copying is disabled because texture hooks address the active collection.
SdlRenderBackendState & Backend()
Definition enginetextures.h:41
~EngineTextures()
Unregister the collection and release its decoded texels.
static EngineTextures * Active()
void Load(unsigned entry, const unsigned char *colors)
Load the decoded colours of an image into a texture, as a command 0xdd of a display list loads them.
EngineTextures & operator=(const EngineTextures &)=delete
Assignment is disabled because the active collection has a stable address.
unsigned Create(const unsigned char *image, const unsigned char *palette, int width, int height, int lineBytes)
Create a texture from an 8-bit colour-indexed image of the console, as the hook g_pfnCreateTextureFro...
void Clear()
Discard decoded textures when the race engine shuts its texture subsystem down.
const EngineTexture * Find(unsigned entry) const
SdlVehicleReflections & Reflections()
Definition enginetextures.h:45
EngineTextures()
Register an empty texture collection for the sole active race engine.
Definition assetimport.h:11
const EngineTexture * FindEngineTexture(unsigned entry)
unsigned CreateEngineTexture(const unsigned char *image, const unsigned char *palette, int width, int height, int lineBytes)
Create a texture from an 8-bit colour-indexed image of the console, as the hook g_pfnCreateTextureFro...
void ClearEngineTextures()
Drop every texture, as the renderer of the PC release shuts its textures down.
void LoadEngineTexture(unsigned entry, const unsigned char *colors)
Load the decoded colours of an image into a texture, as a command 0xdd of a display list loads them.
int DecodeEngineTexture(void *destination, const unsigned char *image, const unsigned char *palette, int width, int height, int lineBytes)
Decode an 8-bit colour-indexed image of the console to its colours, each a big-endian RGBA5551 half,...
The entries of g_pTextureEntries of the textures of precipitation.
Definition renderbackend.h:242
Sky images and reflection descriptors for one SDL texture collection.
Definition vehicleview.h:74
A texture of the race engine, as 8-bit RGBA texels.
Definition enginetextures.h:18
unsigned version
Definition enginetextures.h:22
int height
Definition enginetextures.h:20
int width
Definition enginetextures.h:19
std::vector< std::uint8_t > rgba
Definition enginetextures.h:21