Skip to content

Commit d1abd37

Browse files
committed
cleanup unused params in texture
1 parent 963fa83 commit d1abd37

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/engine/render/texture.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ static int formatsize(GLenum format)
309309
}
310310
}
311311

312-
static void resizetexture(int w, int h, bool mipmap, bool canreduce, GLenum target, int compress, int &tw, int &th)
312+
static void resizetexture(int w, int h, bool mipmap, GLenum target, int compress, int &tw, int &th)
313313
{
314314
int hwlimit = target==GL_TEXTURE_CUBE_MAP ? hwcubetexsize : hwtexsize,
315315
sizelimit = mipmap && maxtexsize ? std::min(maxtexsize, hwlimit) : hwlimit;
@@ -503,7 +503,7 @@ const GLint *swizzlemask(GLenum format)
503503
return nullptr;
504504
}
505505

506-
static void setuptexparameters(int tnum, const void *pixels, int clamp, int filter, GLenum format, GLenum target, bool swizzle)
506+
static void setuptexparameters(int tnum, int clamp, int filter, GLenum format, GLenum target, bool swizzle)
507507
{
508508
glBindTexture(target, tnum);
509509
glTexParameteri(target, GL_TEXTURE_WRAP_S, clamp&1 ? GL_CLAMP_TO_EDGE : (clamp&0x100 ? GL_MIRRORED_REPEAT : GL_REPEAT));
@@ -708,7 +708,7 @@ void createtexture(int tnum, int w, int h, const void *pixels, int clamp, int fi
708708
type = textype(component, format);
709709
if(tnum)
710710
{
711-
setuptexparameters(tnum, pixels, clamp, filter, format, target, swizzle);
711+
setuptexparameters(tnum, clamp, filter, format, target, swizzle);
712712
}
713713
if(!pw)
714714
{
@@ -723,7 +723,7 @@ void createtexture(int tnum, int w, int h, const void *pixels, int clamp, int fi
723723
bool mipmap = filter > 1;
724724
if(resize && pixels)
725725
{
726-
resizetexture(w, h, mipmap, false, target, 0, tw, th);
726+
resizetexture(w, h, mipmap, false, target, tw, th);
727727
}
728728
uploadtexture(subtarget, component, tw, th, format, type, pixels, pw, ph, pitch, mipmap);
729729
}
@@ -733,7 +733,7 @@ static void createcompressedtexture(int tnum, int w, int h, const uchar *data, i
733733
GLenum target = textarget(subtarget);
734734
if(tnum)
735735
{
736-
setuptexparameters(tnum, data, clamp, filter, format, target, swizzle);
736+
setuptexparameters(tnum, clamp, filter, format, target, swizzle);
737737
}
738738
uploadcompressedtexture(target, subtarget, format, w, h, data, align, blocksize, levels, filter > 1);
739739
}
@@ -743,7 +743,7 @@ void create3dtexture(int tnum, int w, int h, int d, const void *pixels, int clam
743743
GLenum format = GL_FALSE, type = textype(component, format);
744744
if(tnum)
745745
{
746-
setuptexparameters(tnum, pixels, clamp, filter, format, target, swizzle);
746+
setuptexparameters(tnum, clamp, filter, format, target, swizzle);
747747
}
748748
glTexImage3D(target, 0, component, w, h, d, 0, format, type, pixels);
749749
}
@@ -752,7 +752,7 @@ std::unordered_map<std::string, Texture> textures;
752752

753753
Texture *notexture = nullptr; // used as default, ensured to be loaded
754754

755-
GLenum texformat(int bpp, bool swizzle)
755+
GLenum texformat(int bpp)
756756
{
757757
switch(bpp)
758758
{
@@ -848,7 +848,7 @@ static Texture *newtexture(Texture *t, const char *rname, ImageData &s, int clam
848848

849849
bool swizzle = !(clamp&0x10000);
850850
GLenum format;
851-
format = texformat(s.bpp, swizzle);
851+
format = texformat(s.bpp);
852852
t->bpp = s.bpp;
853853
if(alphaformat(format))
854854
{
@@ -880,7 +880,7 @@ static Texture *newtexture(Texture *t, const char *rname, ImageData &s, int clam
880880
}
881881
else
882882
{
883-
resizetexture(t->w, t->h, mipit, canreduce, GL_TEXTURE_2D, compress, t->w, t->h);
883+
resizetexture(t->w, t->h, mipit, GL_TEXTURE_2D, compress, t->w, t->h);
884884
createtexture(t->id, t->w, t->h, s.data, clamp, filter, format, GL_TEXTURE_2D, t->xs, t->ys, s.pitch, false, format, swizzle);
885885
}
886886
return t;

src/engine/render/texture.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ extern bool settexture(const char *name, int clamp = 0);
2121
//for imagedata manipulation
2222
extern void scaletexture(const uchar * RESTRICT src, uint sw, uint sh, uint bpp, uint pitch, uchar * RESTRICT dst, uint dw, uint dh);
2323
extern void reorienttexture(const uchar * RESTRICT src, int sw, int sh, int bpp, int stride, uchar * RESTRICT dst, bool flipx, bool flipy, bool swapxy);
24-
extern GLenum texformat(int bpp, bool swizzle = false);
24+
extern GLenum texformat(int bpp);
2525

2626
struct Slot;
2727
struct VSlot;

0 commit comments

Comments
 (0)