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
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Krabs
SRB2
Commits
ab7987d1
Commit
ab7987d1
authored
5 years ago
by
Lactozilla
Browse files
Options
Downloads
Patches
Plain Diff
Fix OpenGL only recording the first frame of unoptimized GIFs
parent
38232ce0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/m_anigif.c
+31
-26
31 additions, 26 deletions
src/m_anigif.c
with
31 additions
and
26 deletions
src/m_anigif.c
+
31
−
26
View file @
ab7987d1
...
@@ -490,29 +490,28 @@ const UINT8 gifframe_gchead[4] = {0x21,0xF9,0x04,0x04}; // GCE, bytes, packed by
...
@@ -490,29 +490,28 @@ const UINT8 gifframe_gchead[4] = {0x21,0xF9,0x04,0x04}; // GCE, bytes, packed by
static
UINT8
*
gifframe_data
=
NULL
;
static
UINT8
*
gifframe_data
=
NULL
;
static
size_t
gifframe_size
=
8192
;
static
size_t
gifframe_size
=
8192
;
//
// GIF_rgbconvert
// converts an RGB frame to a frame with a palette.
//
#ifdef HWRENDER
#ifdef HWRENDER
static
void
hwr
convert
(
void
)
static
void
GIF_rgb
convert
(
UINT8
*
linear
,
UINT8
*
scr
)
{
{
UINT8
*
linear
=
HWR_GetScreenshot
();
UINT8
*
dest
=
screens
[
2
];
UINT8
r
,
g
,
b
;
UINT8
r
,
g
,
b
;
INT32
x
,
y
;
size_t
src
=
0
,
dest
=
0
;
size_t
i
=
0
;
size_t
size
=
(
vid
.
width
*
vid
.
height
*
3
)
;
InitColorLUT
(
gif_framepalette
);
InitColorLUT
(
gif_framepalette
);
for
(
y
=
0
;
y
<
vid
.
height
;
y
++
)
while
(
src
<
size
)
{
{
for
(
x
=
0
;
x
<
vid
.
width
;
x
++
,
i
+=
3
)
r
=
(
UINT8
)
linear
[
src
];
{
g
=
(
UINT8
)
linear
[
src
+
1
];
r
=
(
UINT8
)
linear
[
i
];
b
=
(
UINT8
)
linear
[
src
+
2
];
g
=
(
UINT8
)
linear
[
i
+
1
];
scr
[
dest
]
=
colorlookup
[
r
>>
SHIFTCOLORBITS
][
g
>>
SHIFTCOLORBITS
][
b
>>
SHIFTCOLORBITS
];
b
=
(
UINT8
)
linear
[
i
+
2
];
src
+=
(
3
*
scrbuf_downscaleamt
);
dest
[(
y
*
vid
.
width
)
+
x
]
=
colorlookup
[
r
>>
SHIFTCOLORBITS
][
g
>>
SHIFTCOLORBITS
][
b
>>
SHIFTCOLORBITS
];
dest
+=
scrbuf_downscaleamt
;
}
}
}
free
(
linear
);
}
}
#endif
#endif
...
@@ -556,7 +555,11 @@ static void GIF_framewrite(void)
...
@@ -556,7 +555,11 @@ static void GIF_framewrite(void)
I_ReadScreen
(
movie_screen
);
I_ReadScreen
(
movie_screen
);
#ifdef HWRENDER
#ifdef HWRENDER
else
if
(
rendermode
==
render_opengl
)
else
if
(
rendermode
==
render_opengl
)
hwrconvert
();
{
UINT8
*
linear
=
HWR_GetScreenshot
();
GIF_rgbconvert
(
linear
,
movie_screen
);
free
(
linear
);
}
#endif
#endif
}
}
else
else
...
@@ -565,18 +568,20 @@ static void GIF_framewrite(void)
...
@@ -565,18 +568,20 @@ static void GIF_framewrite(void)
blitw
=
vid
.
width
;
blitw
=
vid
.
width
;
blith
=
vid
.
height
;
blith
=
vid
.
height
;
if
(
gif_frames
==
0
)
{
if
(
rendermode
==
render_soft
)
I_ReadScreen
(
movie_screen
);
#ifdef HWRENDER
#ifdef HWRENDER
else
if
(
rendermode
==
render_opengl
)
// Copy the current OpenGL frame into the base screen
{
if
(
rendermode
==
render_opengl
)
hwrconvert
();
{
VID_BlitLinearScreen
(
screens
[
2
],
screens
[
0
],
vid
.
width
*
vid
.
bpp
,
vid
.
height
,
vid
.
width
*
vid
.
bpp
,
vid
.
rowbytes
);
UINT8
*
linear
=
HWR_GetScreenshot
(
);
}
GIF_rgbconvert
(
linear
,
screens
[
0
]);
#endif
free
(
linear
);
}
}
#endif
// Copy the first frame into the movie screen
// OpenGL already does the same above.
if
(
gif_frames
==
0
&&
rendermode
==
render_soft
)
I_ReadScreen
(
movie_screen
);
movie_screen
=
screens
[
0
];
movie_screen
=
screens
[
0
];
}
}
...
...
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