10#define IMGUI_DEFINE_MATH_OPERATORS
20using TextureHandle = ImTextureID;
21constexpr TextureHandle kInvalidTexture = (TextureHandle)0;
26 unsigned char color[4];
37 std::shared_ptr<std::vector<uint8_t>> blob;
38 uint32_t rasterOffset = 0;
39 uint32_t paletteOffset = 0;
52 uint32_t auxRasterOffset = 0;
53 uint32_t auxPaletteOffset = 0;
54 uint16_t auxWidth = 0;
55 uint16_t auxHeight = 0;
67 uint32_t renderMode1 = 0;
68 uint32_t renderMode2 = 0;
69 uint8_t cycleType = 1;
70 bool billboard =
false;
71 float anchor[3] = { 0.0f, 0.0f, 0.0f };
73 bool fullAmbient =
false;
78 uint8_t gameShade = 0;
79 std::shared_ptr<PartTexture> texture;
88 std::vector<uint32_t> words;
92 std::shared_ptr<std::vector<uint8_t>> blob;
95 std::vector<GfxBundleDList> dlists;
113 float ambient[3] = { 0.25f, 0.25f, 0.25f };
114 float color[3] = { 1.0f, 1.0f, 1.0f };
115 float position[3] = { 1.5f, 2.0f, 1.5f };
116 float intensity = 1.0f;
117 float falloff = 0.3f;
128 bool fogEnabled =
false;
129 float fogColor[3] = { 0.45f, 0.50f, 0.65f };
137 if (
const char* f = std::getenv(
"TORCH_UI_FOG")) {
140 if (sscanf(f,
"%d:%d", &s0, &e0) == 2 && e0 > s0) {
156 virtual void RunViewer(
const std::shared_ptr<ViewManager>& views) = 0;
160 virtual TextureHandle UploadRGBA8(
const uint8_t* pixels,
int width,
int height) = 0;
164 virtual void DrawPointCloud(uint64_t
id,
const std::vector<PreviewVertex>& points,
165 const ImVec2& topLeft,
const ImVec2& size,
const OrbitView& view) {}
169 virtual void DrawModel(
const std::string& resourceName,
const ImVec2& topLeft,
const ImVec2& size,
174 virtual void DrawModelParts(
const std::string& key,
const std::vector<ModelPart>& parts,
175 const ImVec2& topLeft,
const ImVec2& size,
const OrbitView& view) {}
179 virtual bool RegisterGameDList(
const std::string& name,
const GfxBundle& bundle, uint32_t entryOffset) {
185 virtual void SetPreviewBackdrop(
const std::string& key,
const uint8_t* rgba,
int width,
int height) {}
189 virtual void DrawTriangles(
const std::string& key,
const std::vector<PreviewVertex>& tris,
190 const ImVec2& topLeft,
const ImVec2& size,
const OrbitView& view) {}
193 virtual bool PlaySamples(
const int16_t* frames,
size_t frameCount,
int sampleRate,
int channels) {
return false; }
194 virtual void StopAudio() {}
196 virtual float AudioProgress() {
return -1.0f; }
197 virtual void SeekAudio(
float progress) {}
198 virtual void SetAudioVolume(
float volume) {}
199 virtual float GetAudioVolume() {
return 1.0f; }
201 virtual void SetAudioSpeed(
float speed) {}
202 virtual float GetAudioSpeed() {
return 1.0f; }
210inline BaseBackend* GetBackend() {
211 return ActiveBackend();
215 ActiveBackend() = backend;
Definition BaseBackend.h:150
Definition BaseBackend.h:86
Definition BaseBackend.h:91
Definition BaseBackend.h:62
Definition BaseBackend.h:100
Definition BaseBackend.h:36
Definition BaseBackend.h:127
Definition BaseBackend.h:111
Definition BaseBackend.h:24