Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fancy2209
SRB2
Commits
48b35204
Commit
48b35204
authored
5 years ago
by
Lactozilla
Browse files
Options
Downloads
Patches
Plain Diff
Stop using NextTexAvail
parent
8350a8c5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/hardware/r_opengl/r_opengl.c
+15
-30
15 additions, 30 deletions
src/hardware/r_opengl/r_opengl.c
with
15 additions
and
30 deletions
src/hardware/r_opengl/r_opengl.c
+
15
−
30
View file @
48b35204
...
...
@@ -63,7 +63,6 @@ static float NEAR_CLIPPING_PLANE = NZCLIP_PLANE;
// **************************************************************************
static
GLuint
NextTexAvail
=
FIRST_TEX_AVAIL
;
static
GLuint
tex_downloaded
=
0
;
static
GLfloat
fov
=
90
.
0
f
;
#if 0
...
...
@@ -72,8 +71,8 @@ static FRGBAFloat const_pal_col;
#endif
static
FBITFIELD
CurrentPolyFlags
;
static
FTextureInfo
*
gr_cachetail
=
NULL
;
static
FTextureInfo
*
gr_cachehead
=
NULL
;
static
FTextureInfo
*
gr_cachetail
=
NULL
;
static
FTextureInfo
*
gr_cachehead
=
NULL
;
RGBA_t
myPaletteData
[
256
];
GLint
screen_width
=
0
;
// used by Draw2DLine()
...
...
@@ -243,6 +242,7 @@ FUNCPRINTF void DBG_Printf(const char *lpFmt, ...)
/* 1.1 functions */
/* texture objects */
//GL_EXT_texture_object
#define pglGenTextures glGenTextures
#define pglDeleteTextures glDeleteTextures
#define pglBindTexture glBindTexture
/* texture mapping */
//GL_EXT_copy_texture
...
...
@@ -359,6 +359,8 @@ static PFNglFogfv pglFogfv;
/* 1.1 functions */
/* texture objects */
//GL_EXT_texture_object
typedef
void
(
APIENTRY
*
PFNglGenTextures
)
(
GLsizei
n
,
const
GLuint
*
textures
);
static
PFNglGenTextures
pglGenTextures
;
typedef
void
(
APIENTRY
*
PFNglDeleteTextures
)
(
GLsizei
n
,
const
GLuint
*
textures
);
static
PFNglDeleteTextures
pglDeleteTextures
;
typedef
void
(
APIENTRY
*
PFNglBindTexture
)
(
GLenum
target
,
GLuint
texture
);
...
...
@@ -487,6 +489,7 @@ boolean SetupGLfunc(void)
GETOPENGLFUNC
(
pglFogf
,
glFogf
)
GETOPENGLFUNC
(
pglFogfv
,
glFogfv
)
GETOPENGLFUNC
(
pglGenTextures
,
glGenTextures
)
GETOPENGLFUNC
(
pglDeleteTextures
,
glDeleteTextures
)
GETOPENGLFUNC
(
pglBindTexture
,
glBindTexture
)
...
...
@@ -723,33 +726,12 @@ void Flush(void)
while
(
gr_cachehead
)
{
// this is not necessary at all, because you have loaded them normally,
// and so they already are in your list!
#if 0
//Hurdler: 25/04/2000: now support colormap in hardware mode
FTextureInfo *tmp = gr_cachehead->nextskin;
// The memory should be freed in the main code
while (tmp)
{
pglDeleteTextures(1, &tmp->downloaded);
tmp->downloaded = 0;
tmp = tmp->nextcolormap;
}
#endif
pglDeleteTextures
(
1
,
(
GLuint
*
)
&
gr_cachehead
->
downloaded
);
if
(
gr_cachehead
->
downloaded
)
pglDeleteTextures
(
1
,
(
GLuint
*
)
&
gr_cachehead
->
downloaded
);
gr_cachehead
->
downloaded
=
0
;
gr_cachehead
=
gr_cachehead
->
nextmipmap
;
}
gr_cachetail
=
gr_cachehead
=
NULL
;
//Hurdler: well, gr_cachehead is already NULL
NextTexAvail
=
FIRST_TEX_AVAIL
;
#if 0
if (screentexture != FIRST_TEX_AVAIL)
{
pglDeleteTextures(1, &screentexture);
screentexture = FIRST_TEX_AVAIL;
}
#endif
tex_downloaded
=
0
;
}
...
...
@@ -1128,8 +1110,10 @@ EXPORT void HWRAPI(SetTexture) (FTextureInfo *pTexInfo)
static
RGBA_t
tex
[
2048
*
2048
];
const
GLvoid
*
ptex
=
tex
;
INT32
w
,
h
;
GLuint
texnum
=
0
;
//DBG_Printf ("DownloadMipmap %d %x\n",NextTexAvail,pTexInfo->grInfo.data);
pglGenTextures
(
1
,
&
texnum
);
//DBG_Printf ("DownloadMipmap %d %x\n",(INT32)texnum,pTexInfo->grInfo.data);
w
=
pTexInfo
->
width
;
h
=
pTexInfo
->
height
;
...
...
@@ -1217,9 +1201,10 @@ EXPORT void HWRAPI(SetTexture) (FTextureInfo *pTexInfo)
else
DBG_Printf
(
"SetTexture(bad format) %ld
\n
"
,
pTexInfo
->
grInfo
.
format
);
pTexInfo
->
downloaded
=
NextTexAvail
++
;
tex_downloaded
=
pTexInfo
->
downloaded
;
pglBindTexture
(
GL_TEXTURE_2D
,
pTexInfo
->
downloaded
);
// the texture number was already generated by pglGenTextures
pglBindTexture
(
GL_TEXTURE_2D
,
texnum
);
pTexInfo
->
downloaded
=
texnum
;
tex_downloaded
=
texnum
;
// disable texture filtering on any texture that has holes so there's no dumb borders or blending issues
if
(
pTexInfo
->
flags
&
TF_TRANSPARENT
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment