OpenRaider  0.1.4-dev
Open Source Tomb Raider Game Engine implementation
TextureManager.cpp
Go to the documentation of this file.
1 
9 #include "imgui/imgui.h"
10 #include "stb/stb_image.h"
11 
12 #include "global.h"
13 #include "Game.h"
14 #include "Log.h"
15 #include "RunTime.h"
16 #include "World.h"
17 #include "utils/Folder.h"
18 #include "utils/pcx.h"
19 #include "utils/pixel.h"
20 #include "utils/random.h"
21 #include "utils/strings.h"
22 #include "TextureManager.h"
23 
24 glm::vec2 TextureTile::getUV(unsigned int i) {
25  glm::vec2 uv(vertices.at(i).xPixel,
26  vertices.at(i).yPixel);
27 
35  if (vertices.at(i).xCoordinate == 1) {
36  uv.x += 0.375f;
37  }
38 
39  if (vertices.at(i).yCoordinate == 1) {
40  uv.y += 0.375f;
41  }
42 
43  return uv / 256.0f;
44 }
45 
46 // ----------------------------------------------------------------------------
47 
48 #define COLOR_PALETTE_SIZE 256
49 
50 std::vector<unsigned int> TextureManager::mTextureIdsGame;
51 std::vector<unsigned int> TextureManager::mTextureIdsSystem;
52 std::vector<TextureTile*> TextureManager::tiles;
53 std::vector<std::vector<int>> TextureManager::animations;
54 std::vector<int> TextureManager::gameUnits;
55 std::vector<int> TextureManager::systemUnits;
57 std::vector<BufferManager> TextureManager::gameBuffers;
58 std::vector<BufferManager> TextureManager::systemBuffers;
59 std::array<glm::vec4, 256> TextureManager::colorPalette;
60 std::vector<std::tuple<unsigned char*, unsigned int, unsigned int>> TextureManager::indexedTextures;
61 
63  assertEqual(mTextureIdsGame.size(), 0);
64  assertEqual(mTextureIdsSystem.size(), 0);
65 
66  while (mTextureIdsSystem.size() < 2) {
67  unsigned int id;
68  glGenTextures(1, &id);
69  mTextureIdsSystem.push_back(id);
70  }
71 
72  unsigned char* image = generateColorTexture(glm::vec4(1.0f, 1.0f, 1.0f, 1.0f), 32, 32, 32);
74  false);
75  delete [] image;
76  if (res < 0) {
77  return -1;
78  }
79 
80  return 0;
81 }
82 
85  std::vector<File> files;
86  f.findRecursiveFilesEndingWith(files, ".pcx");
87  f.findRecursiveFilesEndingWith(files, ".bmp");
88  f.findRecursiveFilesEndingWith(files, ".png");
89  f.findRecursiveFilesEndingWith(files, ".tga");
90  f.findRecursiveFilesEndingWith(files, ".jpg");
91  if (files.size() == 0) {
93  return -2;
94  }
95  } else {
96  int i = randomInteger(files.size() - 1);
97  if (loadImage(files.at(i).getPath(), TextureStorage::SYSTEM, TEXTURE_SPLASH) < 0) {
99  return -3;
100  }
101  }
102  }
103 
104  return 0;
105 }
106 
108  while (mTextureIdsSystem.size() > 0) {
109  unsigned int id = mTextureIdsSystem.at(mTextureIdsSystem.size() - 1);
110  glDeleteTextures(1, &id);
111  mTextureIdsSystem.pop_back();
112  }
113 
114  gameBuffers.clear();
115  systemBuffers.clear();
116 
117  clear();
118 }
119 
121  while (mTextureIdsGame.size() > 0) {
122  unsigned int id = mTextureIdsGame.at(mTextureIdsGame.size() - 1);
123  glDeleteTextures(1, &id);
124  mTextureIdsGame.pop_back();
125  }
126 
127  while (!tiles.empty()) {
128  delete tiles.at(tiles.size() - 1);
129  tiles.pop_back();
130  }
131 
132  animations.clear();
133 
134  gameUnits.clear();
135  systemUnits.clear();
137 
138  indexedTextures.clear();
139 }
140 
141 int TextureManager::loadBufferSlot(unsigned char* image,
142  unsigned int width, unsigned int height,
143  ColorMode mode, unsigned int bpp,
144  TextureStorage s, int slot, bool filter) {
145  assertGreaterThan(width, 0);
146  assertGreaterThan(height, 0);
147  assert((mode == ColorMode::RGB)
148  || (mode == ColorMode::BGR)
149  || (mode == ColorMode::ARGB)
150  || (mode == ColorMode::RGBA)
151  || (mode == ColorMode::BGRA));
152  assert((bpp == 8) || (bpp == 24) || (bpp == 32));
153 
154  if (slot < 0)
155  slot = getIds(s).size();
156 
157  while (getIds(s).size() <= slot) {
158  unsigned int id;
159  glGenTextures(1, &id);
160  getIds(s).push_back(id);
161  }
162 
163  unsigned int glcMode;
164  switch (mode) {
165  case ColorMode::BGR:
166  glcMode = GL_BGR;
167  break;
168 
169  case ColorMode::RGB:
170  glcMode = GL_RGB;
171  break;
172 
173  case ColorMode::ARGB:
174  if (image != nullptr)
175  argb2rgba32(image, width, height);
176  glcMode = GL_RGBA;
177  break;
178 
179  case ColorMode::BGRA:
180  glcMode = GL_BGRA;
181  break;
182 
183  case ColorMode::RGBA:
184  glcMode = GL_RGBA;
185  break;
186  }
187 
188  glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
189  bindTexture(slot, s);
190  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, glcMode, GL_UNSIGNED_BYTE, image);
191 
192  if (filter) {
193  // Trilinear filtering
194  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
195  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
196  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
197  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
198  glGenerateMipmap(GL_TEXTURE_2D);
199  } else {
200  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
201  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
202  }
203 
204  return slot;
205 }
206 
208  return getIds(s).size();
209 }
210 
211 void TextureManager::bindTextureId(unsigned int n, TextureStorage s, unsigned int unit) {
212  assertLessThan(n, getIds(s).size());
213  assertLessThan(unit, 80);
214 
215  glActiveTexture(GL_TEXTURE0 + unit);
216  glBindTexture(GL_TEXTURE_2D, getIds(s).at(n));
217 }
218 
220  assertLessThan(n, getIds(s).size());
221 
222  if ((n < getUnits(s).size()) && (getUnits(s).at(n) >= 0)) {
223  bindTextureId(n, s, getUnits(s).at(n));
224  return getUnits(s).at(n);
225  } else {
226  while (getUnits(s).size() <= n)
227  getUnits(s).push_back(-1);
228  getUnits(s).at(n) = nextFreeTextureUnit;
231  return nextFreeTextureUnit - 1;
232  }
233 }
234 
236  assertLessThan(n, getIds(s).size());
237  return getIds(s).at(n);
238 }
239 
241  tiles.push_back(t);
242 }
243 
245  return tiles.size();
246 }
247 
249  assertGreaterThanEqual(index, 0);
250  assertLessThan(index, tiles.size());
251  return *tiles.at(index);
252 }
253 
254 void TextureManager::addAnimatedTile(int index, int tile) {
255  while (index >= animations.size())
256  animations.push_back(std::vector<int>());
257 
258  animations.at(index).push_back(tile);
259 }
260 
262  return animations.size();
263 }
264 
266  assertLessThan(index, animations.size());
267  assertGreaterThan(animations.at(index).size(), 0);
268  return animations.at(index).at(0);
269 }
270 
271 int TextureManager::getNextTileAnimation(int index, int tile) {
272  assertLessThan(index, animations.size());
273  for (int i = 0; i < animations.at(index).size(); i++) {
274  if (animations.at(index).at(i) == tile) {
275  if (i < (animations.at(index).size() - 1))
276  return animations.at(index).at(i + 1);
277  else
278  return animations.at(index).at(0);
279  }
280  }
281  return -1;
282 }
283 
285  auto& v = (store == TextureStorage::GAME) ? gameBuffers : systemBuffers;
286  while (v.size() <= (tex + 1)) {
287  v.emplace_back(v.size(), store);
288  }
289  return &(v.at(tex));
290 }
291 
292 void TextureManager::setPalette(int index, glm::vec4 color) {
293  assertGreaterThanEqual(index, 0);
295  colorPalette[index] = color;
296 }
297 
298 glm::vec4 TextureManager::getPalette(int index) {
299  assertGreaterThanEqual(index, 0);
301  return colorPalette[index];
302 }
303 
304 void TextureManager::addIndexedTexture(unsigned char* image, unsigned int width,
305  unsigned int height) {
306  unsigned char* img = new unsigned char[width * height];
307  for (unsigned int i = 0; i < (width * height); i++)
308  img[i] = image[i];
309  indexedTextures.emplace_back(img, width, height);
310 }
311 
313  for (int i = 0; i < indexedTextures.size(); i++) {
314  auto tex = indexedTextures.at(i);
315  unsigned char* img = std::get<0>(tex);
316  unsigned int width = std::get<1>(tex);
317  unsigned int height = std::get<2>(tex);
318  unsigned char* image = new unsigned char[width * height * 4];
319  for (unsigned int i = 0; i < (width * height); i++) {
320  auto col = getPalette(img[i]);
321  image[i * 4] = col.x * 255;
322  image[(i * 4) + 1] = col.y * 255;
323  image[(i * 4) + 2] = col.z * 255;
324  image[(i * 4) + 3] = col.w * 255;
325  }
326  delete [] img;
327  loadBufferSlot(image, width, height, ColorMode::RGBA, 32, TextureStorage::GAME, i, true);
328  }
329 }
330 
331 int TextureManager::loadImage(std::string filename, TextureStorage s, int slot) {
332  if (stringEndsWith(filename, ".pcx")) {
333  return loadPCX(filename, s, slot);
334  } else {
335  int x, y, n;
336  unsigned char* data = stbi_load(filename.c_str(), &x, &y, &n, 0);
337  if (data) {
338  if ((n < 3) || (n > 4)) {
339  Log::get(LOG_ERROR) << "Image \"" << filename << "\" has unsupported format ("
340  << n << ")!" << Log::endl;
341  stbi_image_free(data);
342  return -2;
343  }
344  int id = loadBufferSlot(data, x, y, (n == 3) ? ColorMode::RGB : ColorMode::RGBA,
345  (n == 3) ? 24 : 32, s, slot);
346  stbi_image_free(data);
347  return id;
348  } else {
349  Log::get(LOG_ERROR) << "Can't load image \"" << filename << "\"!" << Log::endl;
350  return -1;
351  }
352  }
353 }
354 
355 int TextureManager::loadPCX(std::string filename, TextureStorage s, int slot) {
356  int error = pcxCheck(filename.c_str());
357  if (!error) {
358  unsigned char* image;
359  unsigned int w, h, bpp;
360  ColorMode c;
361 
362  error = pcxLoad(filename.c_str(), &image, &w, &h, &c, &bpp);
363  if (!error) {
364  unsigned char* image2 = scaleBuffer(image, &w, &h, bpp);
365  if (image2) {
366  delete [] image;
367  image = image2;
368  }
369  int id = loadBufferSlot(image, w, h, c, bpp, s, slot);
370  delete [] image;
371  return id;
372  }
373 
374  return -5;
375  }
376 
377  return -4;
378 }
379 
380 std::vector<unsigned int>& TextureManager::getIds(TextureStorage s) {
381  if (s == TextureStorage::GAME)
382  return mTextureIdsGame;
383  else
384  return mTextureIdsSystem;
385 }
386 
388  if (s == TextureStorage::GAME)
389  return gameUnits;
390  else
391  return systemUnits;
392 }
393 
395  if (ImGui::CollapsingHeader("Texture Viewer")) {
396  static bool game = Game::isLoaded();
397  static int index = 0;
398  ImGui::SliderInt("##texslide", &index, 0, TextureManager::numTextures(
400  ImGui::SameLine();
401  if (ImGui::Button("+##texplus", ImVec2(0, 0), true)) {
402  if (index < (numTextures(
403  game ? TextureStorage::GAME : TextureStorage::SYSTEM) - 1))
404  index++;
405  else
406  index = 0;
407  }
408  ImGui::SameLine();
409  if (ImGui::Button("-##texminus", ImVec2(0, 0), true)) {
410  if (index > 0)
411  index--;
412  else
413  index = numTextures(
414  game ? TextureStorage::GAME : TextureStorage::SYSTEM) - 1;
415  }
416 
417  if ((numTextures(TextureStorage::GAME) > 0)) {
418  ImGui::SameLine();
419  ImGui::Checkbox("Game##texgame", &game);
420  } else {
421  game = false;
422  }
423 
424  if (index >= numTextures(game ? TextureStorage::GAME : TextureStorage::SYSTEM)) {
425  index = numTextures(game ? TextureStorage::GAME : TextureStorage::SYSTEM) - 1;
426  if (index < 0) {
427  game = false;
428  index = 0;
429  }
430  }
431 
432  auto bm = getBufferManager(index, game ? TextureStorage::GAME
433  : TextureStorage::SYSTEM);
435  }
436 
437  if (ImGui::CollapsingHeader("Textile Viewer")) {
438  if (numTiles() > 0) {
439  static int index = 0;
441  ImGui::SliderInt("##tileslide", &index, 0, numTiles() - 1);
443  ImGui::SameLine();
444  if (ImGui::Button("+##tileplus", ImVec2(0, 0), true)) {
445  if (index < (numTiles() - 1))
446  index++;
447  else
448  index = 0;
449  }
450  ImGui::SameLine();
451  if (ImGui::Button("-##tileminus", ImVec2(0, 0), true)) {
452  if (index > 0)
453  index--;
454  else
455  index = numTiles() - 1;
456  }
457 
458  if (index >= numTiles())
459  index = 0;
460 
461  auto& tile = getTile(index);
462  auto bm = getBufferManager(tile.getTexture(), TextureStorage::GAME);
463  ImVec2 size(ImGui::GetColumnWidth() * 2 / 3, ImGui::GetColumnWidth() * 2 / 3);
464  auto uvA = tile.getUV(0);
465  auto uvB = tile.getUV(2);
466  ImVec2 uv1(uvA.x, uvA.y);
467  ImVec2 uv2(uvB.x, uvB.y);
468  ImGui::Image(bm, size, uv1, uv2);
469  } else {
470  ImGui::Text("No textiles are currently loaded...!");
471  }
472  }
473 
474  if (ImGui::CollapsingHeader("Animated Textile Viewer")) {
475  if (numAnimatedTiles() > 0) {
476  static int index = 0;
477  static int tile = getFirstTileAnimation(index);
478  if (ImGui::SliderInt("##animslide", &index, 0, numAnimatedTiles() - 1)) {
479  tile = getFirstTileAnimation(index);
480  }
481  ImGui::SameLine();
482  if (ImGui::Button("+##animplus", ImVec2(0, 0), true)) {
483  if (index < (numAnimatedTiles() - 1))
484  index++;
485  else
486  index = 0;
487  tile = getFirstTileAnimation(index);
488  }
489  ImGui::SameLine();
490  if (ImGui::Button("-##animminus", ImVec2(0, 0), true)) {
491  if (index > 0)
492  index--;
493  else
494  index = numAnimatedTiles() - 1;
495  tile = getFirstTileAnimation(index);
496  }
497 
498  if (index >= numAnimatedTiles()) {
499  index = 0;
500  tile = getFirstTileAnimation(index);
501  }
502 
503  int next = getNextTileAnimation(index, tile);
504  if (next == -1) {
505  index = 0;
506  tile = getFirstTileAnimation(index);
507  }
508 
509  ImGui::SameLine();
510  ImGui::Text("%d", tile);
511 
512  auto& t = getTile(tile);
513  auto bm = getBufferManager(t.getTexture(), TextureStorage::GAME);
514  ImVec2 size(ImGui::GetColumnWidth() * 2 / 3, ImGui::GetColumnWidth() * 2 / 3);
515  auto uvA = t.getUV(0);
516  auto uvB = t.getUV(2);
517  ImVec2 uv1(uvA.x, uvA.y);
518  ImVec2 uv2(uvB.x, uvB.y);
519  ImGui::Image(bm, size, uv1, uv2);
520 
521  static int fr = 0;
522  if (fr > 0) {
523  fr--;
524  } else {
525  fr = RunTime::getFPS() / 5;
526  tile = next;
527  }
528  } else {
529  ImGui::Text("No animated textures are currently loaded...!");
530  }
531  }
532 
533  if (ImGui::CollapsingHeader("Sprite Sequence Viewer")) {
534  if (getWorld().sizeSprite() <= 0) {
535  ImGui::Text("Please load a level containing sprites!");
536  } else {
537  static int index = 0;
538  static int sprite = 0;
539  if (ImGui::SliderInt("##spriteslide", &index, 0, getWorld().sizeSpriteSequence() - 1)) {
540  sprite = 0;
541  }
542  ImGui::SameLine();
543  if (ImGui::Button("+##spriteplus", ImVec2(0, 0), true)) {
544  if (index < (getWorld().sizeSpriteSequence() - 1))
545  index++;
546  else
547  index = 0;
548  sprite = 0;
549  }
550  ImGui::SameLine();
551  if (ImGui::Button("-##spriteminus", ImVec2(0, 0), true)) {
552  if (index > 0)
553  index--;
554  else
555  index = getWorld().sizeSpriteSequence() - 1;
556  sprite = 0;
557  }
558 
559  if (index >= getWorld().sizeSpriteSequence()) {
560  index = 0;
561  sprite = 0;
562  }
563 
564  if (sprite >= getWorld().getSpriteSequence(index).size()) {
565  sprite = 0;
566  }
567 
568  ImGui::SameLine();
569  ImGui::Text("Sprite %d/%d", sprite + 1, getWorld().getSpriteSequence(index).size());
570 
571  auto& s = getWorld().getSprite(getWorld().getSpriteSequence(index).getStart() + sprite);
572  auto bm = getBufferManager(s.getTexture(), TextureStorage::GAME);
573  ImVec2 size(ImGui::GetColumnWidth() * 2 / 3, ImGui::GetColumnWidth() * 2 / 3);
574  auto uv = s.getUVs();
575  ImVec2 uv1(uv.x, uv.w);
576  ImVec2 uv2(uv.z, uv.y);
577  ImGui::Image(bm, size, uv1, uv2);
578 
579  static int fr = 0;
580  if (fr > 0) {
581  fr--;
582  } else {
583  fr = RunTime::getFPS() / 10;
584  if (sprite < (getWorld().getSpriteSequence(index).size() - 1))
585  sprite++;
586  else
587  sprite = 0;
588  }
589 
590  }
591  }
592 }
593 
static std::vector< unsigned int > mTextureIdsSystem
IMGUI_API void PopItemWidth()
Definition: imgui.cpp:3256
IMGUI_API bool Checkbox(const char *label, bool *v)
Definition: imgui.cpp:5128
static int initializeSplash()
static std::vector< unsigned int > mTextureIdsGame
IMGUI_API bool CollapsingHeader(const char *label, const char *str_id=NULL, bool display_frame=true, bool default_open=false)
Definition: imgui.cpp:4332
unsigned char * scaleBuffer(unsigned char *image, unsigned int *w, unsigned int *h, unsigned int bpp)
Definition: pixel.cpp:87
String handling utilities.
static int numAnimatedTiles()
int randomInteger(int max, int min=0)
Definition: random.cpp:20
PCX image reader.
std::vector< TextureTileVertex > vertices
static std::vector< std::vector< int > > animations
static std::string getPakDir()
Definition: RunTime.h:26
static void addAnimatedTile(int index, int tile)
static void display()
static TextureTile & getTile(int index)
World Model.
#define TEXTURE_WHITE
static std::vector< TextureTile * > tiles
static void addTile(TextureTile *t)
int pcxLoad(const char *filename, unsigned char **image, unsigned int *width, unsigned int *height, ColorMode *mode, unsigned int *bpp)
Load a PCX image file into a buffer.
Definition: pcx.cpp:69
static std::vector< BufferManager > systemBuffers
static std::vector< int > gameUnits
World & getWorld()
Definition: main.cpp:32
Included everywhere.
unsigned char * generateColorTexture(glm::vec4 rgba, unsigned int width, unsigned int height, unsigned int bpp)
Definition: pixel.cpp:11
static LogLevel & get(int level)
Definition: Log.cpp:14
static std::array< glm::vec4, 256 > colorPalette
static int loadImage(std::string filename, TextureStorage s=TextureStorage::GAME, int slot=-1)
static int getFirstTileAnimation(int index)
unsigned long sizeSpriteSequence()
Definition: World.cpp:55
Definition: imgui.h:50
Global Logging Utility.
static unsigned long getFPS()
Definition: RunTime.h:41
static std::vector< unsigned int > & getIds(TextureStorage s)
Pixel buffer utilities.
bool stringEndsWith(std::string s, std::string suffix, bool casesensitive=false)
Definition: strings.cpp:32
static int numTextures(TextureStorage s=TextureStorage::GAME)
#define assert(x)
Definition: global.h:124
static void addIndexedTexture(unsigned char *image, unsigned int width, unsigned int height)
static int bindTexture(unsigned int n, TextureStorage s)
Bind texture to next free texture unit.
IMGUI_API bool Button(const char *label, const ImVec2 &size=ImVec2(0, 0), bool repeat_when_held=false)
Definition: imgui.cpp:4055
static void error(char *msg)
Definition: commander.c:19
static unsigned int getTextureID(int n, TextureStorage s)
static void prepare()
Recursive file-system walking utilities.
IMGUI_API float GetColumnWidth(int column_index=-1)
Definition: imgui.cpp:6653
static BufferManager * getBufferManager(int tex, TextureStorage store)
static unsigned int nextFreeTextureUnit
static std::vector< int > systemUnits
static int numTiles()
void findRecursiveFilesEndingWith(std::vector< File > &found, std::string end, bool casesensitive=false)
void argb2rgba32(unsigned char *image, unsigned int w, unsigned int h)
Definition: pixel.cpp:29
Sprite & getSprite(unsigned long index)
Definition: World.cpp:46
static const char endl
Definition: Log.h:35
Runtime Configuration Storage.
#define assertGreaterThanEqual(x, y)
Definition: global.h:170
#define TEXTURE_SPLASH
IMGUI_API void SameLine(int column_x=0, int spacing_w=-1)
Definition: imgui.cpp:6551
static std::vector< int > & getUnits(TextureStorage s)
#define LOG_ERROR
Definition: Log.h:19
Definition: Folder.h:28
TextureStorage
#define assertEqual(x, y)
Definition: global.h:130
#define assertGreaterThan(x, y)
Definition: global.h:162
static void shutdown()
IMGUI_API void Text(const char *fmt,...)
Definition: imgui.cpp:3802
Texture Registry.
glm::vec2 getUV(unsigned int i)
#define COLOR_PALETTE_SIZE
static void clear()
IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2 &size, const ImVec2 &uv0=ImVec2(0, 0), const ImVec2 &uv1=ImVec2(1, 1), const ImVec4 &tint_col=ImVec4(1, 1, 1, 1), const ImVec4 &border_col=ImVec4(0, 0, 0, 0))
Definition: imgui.cpp:4163
STBIDEF void stbi_image_free(void *retval_from_stbi_load)
static void setPalette(int index, glm::vec4 color)
static int loadPCX(std::string filename, TextureStorage s, int slot)
#define assertLessThan(x, y)
Definition: global.h:146
static glm::vec4 getPalette(int index)
static int getNextTileAnimation(int index, int tile)
Random number generation.
static std::vector< BufferManager > gameBuffers
static int loadBufferSlot(unsigned char *image=nullptr, unsigned int width=256, unsigned int height=256, ColorMode mode=ColorMode::RGBA, unsigned int bpp=32, TextureStorage s=TextureStorage::GAME, int slot=-1, bool filter=true)
Loads Buffer as texture.
ColorMode
STBIDEF stbi_uc * stbi_load(char const *filename, int *x, int *y, int *comp, int req_comp)
static std::vector< std::tuple< unsigned char *, unsigned int, unsigned int > > indexedTextures
IMGUI_API float GetWindowWidth()
Definition: imgui.cpp:3484
Gameplay Handler.
int pcxCheck(const char *filename)
Check if a file is a valid PCX image.
Definition: pcx.cpp:17
static int initialize()
IMGUI_API bool SliderInt(const char *label, int *v, int v_min, int v_max, const char *display_format="%.0f")
Definition: imgui.cpp:4878
IMGUI_API void PushItemWidth(float item_width)
Definition: imgui.cpp:3250
static void bindTextureId(unsigned int n, TextureStorage s, unsigned int unit)
static bool isLoaded()
Definition: Game.h:19
static std::string getDataDir()
Definition: RunTime.h:32