Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sryder
SRB2
Commits
6c3111d8
Commit
6c3111d8
authored
5 years ago
by
Lactozilla
Browse files
Options
Downloads
Patches
Plain Diff
Stop crashing with models because someone keeps freeing those tags
parent
3bebfb27
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/hardware/hw_md2.c
+5
-5
5 additions, 5 deletions
src/hardware/hw_md2.c
src/z_zone.h
+1
-0
1 addition, 0 deletions
src/z_zone.h
with
6 additions
and
5 deletions
src/hardware/hw_md2.c
+
5
−
5
View file @
6c3111d8
...
...
@@ -239,7 +239,7 @@ static GrTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_
{
png_uint_32
i
,
pitch
=
png_get_rowbytes
(
png_ptr
,
png_info_ptr
);
png_bytep
PNG_image
=
Z_Malloc
(
pitch
*
height
,
PU_HWR
CACH
E
,
&
grpatch
->
mipmap
->
grInfo
.
data
);
png_bytep
PNG_image
=
Z_Malloc
(
pitch
*
height
,
PU_HWR
MODELTEXTUR
E
,
&
grpatch
->
mipmap
->
grInfo
.
data
);
png_bytepp
row_pointers
=
png_malloc
(
png_ptr
,
height
*
sizeof
(
png_bytep
));
for
(
i
=
0
;
i
<
height
;
i
++
)
row_pointers
[
i
]
=
PNG_image
+
i
*
pitch
;
...
...
@@ -313,7 +313,7 @@ static GrTextureFormat_t PCX_Load(const char *filename, int *w, int *h,
pw
=
*
w
=
header
.
xmax
-
header
.
xmin
+
1
;
ph
=
*
h
=
header
.
ymax
-
header
.
ymin
+
1
;
image
=
Z_Malloc
(
pw
*
ph
*
4
,
PU_HWR
CACH
E
,
&
grpatch
->
mipmap
->
grInfo
.
data
);
image
=
Z_Malloc
(
pw
*
ph
*
4
,
PU_HWR
MODELTEXTUR
E
,
&
grpatch
->
mipmap
->
grInfo
.
data
);
if
(
fread
(
palette
,
sizeof
(
UINT8
),
PALSIZE
,
file
)
!=
PALSIZE
)
{
...
...
@@ -661,7 +661,7 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
Z_Free
(
grmip
->
grInfo
.
data
);
grmip
->
grInfo
.
data
=
NULL
;
cur
=
Z_Malloc
(
size
*
4
,
PU_HWR
CACH
E
,
&
grmip
->
grInfo
.
data
);
cur
=
Z_Malloc
(
size
*
4
,
PU_HWR
MODELTEXTUR
E
,
&
grmip
->
grInfo
.
data
);
memset
(
cur
,
0x00
,
size
*
4
);
image
=
gpatch
->
mipmap
->
grInfo
.
data
;
...
...
@@ -794,7 +794,7 @@ static void HWR_GetBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, INT
if
(
grmip
->
downloaded
&&
grmip
->
grInfo
.
data
)
{
HWD
.
pfnSetTexture
(
grmip
);
// found the colormap, set it to the correct texture
Z_ChangeTag
(
grmip
->
grInfo
.
data
,
PU_HWR
CACHE_UNLOCKED
);
Z_ChangeTag
(
grmip
->
grInfo
.
data
,
PU_HWR
MODELTEXTURE
);
return
;
}
}
...
...
@@ -816,7 +816,7 @@ static void HWR_GetBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, INT
HWR_CreateBlendedTexture
(
gpatch
,
blendgpatch
,
newmip
,
skinnum
,
color
);
HWD
.
pfnSetTexture
(
newmip
);
Z_ChangeTag
(
newmip
->
grInfo
.
data
,
PU_HWR
CACHE_UNLOCKED
);
Z_ChangeTag
(
newmip
->
grInfo
.
data
,
PU_HWR
MODELTEXTURE
);
}
#define NORMALFOG 0x00000000
...
...
This diff is collapsed.
Click to expand it.
src/z_zone.h
+
1
−
0
View file @
6c3111d8
...
...
@@ -46,6 +46,7 @@ enum
PU_HWRPATCHINFO
=
21
,
// Hardware GLPatch_t struct for OpenGL texture cache
PU_HWRPATCHCOLMIPMAP
=
22
,
// Hardware GLMipmap_t struct colormap variation of patch
PU_HWRMODELTEXTURE
=
23
,
// Hardware model texture
PU_HWRCACHE
=
48
,
// static until unlocked
PU_CACHE
=
49
,
// static until unlocked
...
...
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