Even more conversion, lots of superfluous macro removal
This commit is contained in:
+9
-7
@@ -22,6 +22,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
//gl_texmgr.c -- fitzquake's texture manager. manages opengl texture images
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "quakedef.hpp"
|
||||
|
||||
static const int gl_solid_format = 3;
|
||||
@@ -68,7 +70,7 @@ static glmode_t glmodes[] = {
|
||||
{GL_LINEAR, GL_LINEAR_MIPMAP_NEAREST, "GL_LINEAR_MIPMAP_NEAREST"},
|
||||
{GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, "GL_LINEAR_MIPMAP_LINEAR"},
|
||||
};
|
||||
#define NUM_GLMODES (int)Q_COUNTOF(glmodes)
|
||||
#define NUM_GLMODES (int)std::size(glmodes)
|
||||
static int glmode_idx = NUM_GLMODES - 1; /* trilinear */
|
||||
|
||||
/*
|
||||
@@ -117,7 +119,7 @@ static void TexMgr_TextureMode_f(convar *var) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_GLMODES; i++) {
|
||||
if (!Q_strcmp(glmodes[i].name, gl_texturemode.string)) {
|
||||
if (!std::strcmp(glmodes[i].name, gl_texturemode.string)) {
|
||||
if (glmode_idx != i) {
|
||||
glmode_idx = i;
|
||||
for (glt = active_gltextures; glt; glt = glt->next)
|
||||
@@ -306,7 +308,7 @@ gltexture_t *TexMgr_NewTexture(void) {
|
||||
static void GL_DeleteTexture(gltexture_t *texture);
|
||||
|
||||
//ericw -- workaround for preventing TexMgr_FreeTexture during TexMgr_ReloadImages
|
||||
static qboolean in_reload_images;
|
||||
static bool in_reload_images;
|
||||
|
||||
/*
|
||||
================
|
||||
@@ -688,7 +690,7 @@ static unsigned *TexMgr_MipMapH(unsigned *data, int width, int height) {
|
||||
TexMgr_ResampleTexture -- bilinear resample
|
||||
================
|
||||
*/
|
||||
static unsigned *TexMgr_ResampleTexture(unsigned *in, int inwidth, int inheight, qboolean alpha) {
|
||||
static unsigned *TexMgr_ResampleTexture(unsigned *in, int inwidth, int inheight, bool alpha) {
|
||||
byte *nwpx, *nepx, *swpx, *sepx, *dest;
|
||||
unsigned xfrac, yfrac, x, y, modx, mody, imodx, imody, injump, outjump;
|
||||
unsigned *out;
|
||||
@@ -1047,7 +1049,7 @@ TexMgr_LoadImage8 -- handles 8bit source data, then passes it to LoadImage32
|
||||
*/
|
||||
static void TexMgr_LoadImage8(gltexture_t *glt, byte *data) {
|
||||
extern convar gl_fullbrights;
|
||||
qboolean padw = false, padh = false;
|
||||
bool padw = false, padh = false;
|
||||
byte padbyte;
|
||||
unsigned int *usepal;
|
||||
int i;
|
||||
@@ -1129,7 +1131,7 @@ TexMgr_LoadLightmap -- handles lightmap data
|
||||
================
|
||||
*/
|
||||
static void TexMgr_LoadLightmap(gltexture_t *glt, byte *data) {
|
||||
const qboolean wide10bits = !!r_lightmapwide.value;
|
||||
const bool wide10bits = !!r_lightmapwide.value;
|
||||
const GLenum type = wide10bits ? GL_UNSIGNED_INT_10_10_10_2 : GL_UNSIGNED_BYTE;
|
||||
const GLint internalfmt = wide10bits ? GL_RGB10_A2 : lightmap_bytes;
|
||||
|
||||
@@ -1381,7 +1383,7 @@ void TexMgr_ReloadNobrightImages(void) {
|
||||
static GLuint currenttexture[3] = {GL_UNUSED_TEXTURE, GL_UNUSED_TEXTURE, GL_UNUSED_TEXTURE};
|
||||
// to avoid unnecessary texture sets
|
||||
static GLenum currenttarget = GL_TEXTURE0_ARB;
|
||||
qboolean mtexenabled = false;
|
||||
bool mtexenabled = false;
|
||||
|
||||
/*
|
||||
================
|
||||
|
||||
Reference in New Issue
Block a user