Put Textures.cpp Changes In ORIGINAL_CODE Block

This commit is contained in:
TheBrokenRail
2023-08-05 03:31:22 -04:00
committed by iProgramInCpp
parent 0fbe90752d
commit b985edac32

View File

@@ -8,6 +8,8 @@
#include "Textures.hpp"
#include "GameMode.hpp"
bool Textures::MIPMAP = false;
int Textures::loadTexture(const std::string& name, bool b)
@@ -69,7 +71,13 @@ int Textures::assignTexture(const std::string& name, Texture& texture)
if (texture.field_C)
internalFormat = GL_RGBA;
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, texture.m_width, texture.m_height, 0, internalFormat, GL_UNSIGNED_BYTE, texture.m_pixels);
#ifdef ORIGINAL_CODE
GLuint format = GL_RGBA;
#else
GLuint format = internalFormat;
#endif
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, texture.m_width, texture.m_height, 0, format, GL_UNSIGNED_BYTE, texture.m_pixels);
m_textures[name] = textureID;