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
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STJr
SRB2
Commits
b63bd97b
Commit
b63bd97b
authored
7 years ago
by
Monster Iestyn
Browse files
Options
Downloads
Plain Diff
Merge branch 'md2-interpolation-fix' into 'master'
MD2 interpolation fix Closes
#28
See merge request
!212
parents
cf10b55b
2b1fb67a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!252
OpenGL: Public flatsprite: The Fixening
,
!212
MD2 interpolation fix
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/hardware/hw_drv.h
+1
-1
1 addition, 1 deletion
src/hardware/hw_drv.h
src/hardware/hw_md2.c
+2
-2
2 additions, 2 deletions
src/hardware/hw_md2.c
src/hardware/r_opengl/r_opengl.c
+13
-14
13 additions, 14 deletions
src/hardware/r_opengl/r_opengl.c
with
16 additions
and
17 deletions
src/hardware/hw_drv.h
+
1
−
1
View file @
b63bd97b
...
...
@@ -66,7 +66,7 @@ EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value);
//Hurdler: added for new development
EXPORT
void
HWRAPI
(
DrawMD2
)
(
INT32
*
gl_cmd_buffer
,
md2_frame_t
*
frame
,
FTransform
*
pos
,
float
scale
);
EXPORT
void
HWRAPI
(
DrawMD2i
)
(
INT32
*
gl_cmd_buffer
,
md2_frame_t
*
frame
,
U
INT32
duration
,
U
INT32
tics
,
md2_frame_t
*
nextframe
,
FTransform
*
pos
,
float
scale
,
UINT8
flipped
,
UINT8
*
color
);
EXPORT
void
HWRAPI
(
DrawMD2i
)
(
INT32
*
gl_cmd_buffer
,
md2_frame_t
*
frame
,
INT32
duration
,
INT32
tics
,
md2_frame_t
*
nextframe
,
FTransform
*
pos
,
float
scale
,
UINT8
flipped
,
UINT8
*
color
);
EXPORT
void
HWRAPI
(
SetTransform
)
(
FTransform
*
ptransform
);
EXPORT
INT32
HWRAPI
(
GetTextureUsed
)
(
void
);
EXPORT
INT32
HWRAPI
(
GetRenderVersion
)
(
void
);
...
...
This diff is collapsed.
Click to expand it.
src/hardware/hw_md2.c
+
2
−
2
View file @
b63bd97b
...
...
@@ -1252,8 +1252,8 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
{
GLPatch_t
*
gpatch
;
INT32
*
buff
;
U
INT32
durs
=
spr
->
mobj
->
state
->
tics
;
U
INT32
tics
=
spr
->
mobj
->
tics
;
INT32
durs
=
spr
->
mobj
->
state
->
tics
;
INT32
tics
=
spr
->
mobj
->
tics
;
md2_frame_t
*
curr
,
*
next
=
NULL
;
const
UINT8
flip
=
(
UINT8
)((
spr
->
mobj
->
eflags
&
MFE_VERTICALFLIP
)
==
MFE_VERTICALFLIP
);
spritedef_t
*
sprdef
;
...
...
This diff is collapsed.
Click to expand it.
src/hardware/r_opengl/r_opengl.c
+
13
−
14
View file @
b63bd97b
...
...
@@ -1819,15 +1819,14 @@ EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value)
}
}
static
void
DrawMD2Ex
(
INT32
*
gl_cmd_buffer
,
md2_frame_t
*
frame
,
U
INT32
duration
,
U
INT32
tics
,
md2_frame_t
*
nextframe
,
FTransform
*
pos
,
float
scale
,
UINT8
flipped
,
UINT8
*
color
)
static
void
DrawMD2Ex
(
INT32
*
gl_cmd_buffer
,
md2_frame_t
*
frame
,
INT32
duration
,
INT32
tics
,
md2_frame_t
*
nextframe
,
FTransform
*
pos
,
float
scale
,
UINT8
flipped
,
UINT8
*
color
)
{
INT32
val
,
count
,
pindex
;
GLfloat
s
,
t
;
GLfloat
ambient
[
4
];
GLfloat
diffuse
[
4
];
float
pol
;
UINT32
newtime
;
float
pol
=
0
.
0
f
;
float
scalex
=
scale
,
scaley
=
scale
,
scalez
=
scale
;
// Because Otherwise, scaling the screen negatively vertically breaks the lighting
...
...
@@ -1835,18 +1834,18 @@ static void DrawMD2Ex(INT32 *gl_cmd_buffer, md2_frame_t *frame, UINT32 duration
GLfloat
LightPos
[]
=
{
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
};
#endif
if
(
duration
==
0
)
duration
=
1
;
newtime
=
(
duration
-
tics
)
+
1
;
if
(
duration
!=
0
&&
duration
!=
-
1
&&
tics
!=
-
1
)
// don't interpolate if instantaneous or infinite in length
{
UINT32
newtime
=
(
duration
-
tics
);
// + 1;
pol
=
(
newtime
)
/
(
float
)
duration
;
pol
=
(
newtime
)
/
(
float
)
duration
;
if
(
pol
>
1
.
0
f
)
pol
=
1
.
0
f
;
if
(
pol
>
1
.
0
f
)
pol
=
1
.
0
f
;
if
(
pol
<
0
.
0
f
)
pol
=
0
.
0
f
;
if
(
pol
<
0
.
0
f
)
pol
=
0
.
0
f
;
}
if
(
color
)
{
...
...
@@ -1940,7 +1939,7 @@ static void DrawMD2Ex(INT32 *gl_cmd_buffer, md2_frame_t *frame, UINT32 duration
pglTexCoord2f
(
s
,
t
);
if
(
!
nextframe
)
if
(
!
nextframe
||
pol
==
0
.
0
f
)
{
pglNormal3f
(
frame
->
vertices
[
pindex
].
normal
[
0
],
frame
->
vertices
[
pindex
].
normal
[
1
],
...
...
@@ -1990,7 +1989,7 @@ static void DrawMD2Ex(INT32 *gl_cmd_buffer, md2_frame_t *frame, UINT32 duration
// -----------------+
// HWRAPI DrawMD2 : Draw an MD2 model with glcommands
// -----------------+
EXPORT
void
HWRAPI
(
DrawMD2i
)
(
INT32
*
gl_cmd_buffer
,
md2_frame_t
*
frame
,
U
INT32
duration
,
U
INT32
tics
,
md2_frame_t
*
nextframe
,
FTransform
*
pos
,
float
scale
,
UINT8
flipped
,
UINT8
*
color
)
EXPORT
void
HWRAPI
(
DrawMD2i
)
(
INT32
*
gl_cmd_buffer
,
md2_frame_t
*
frame
,
INT32
duration
,
INT32
tics
,
md2_frame_t
*
nextframe
,
FTransform
*
pos
,
float
scale
,
UINT8
flipped
,
UINT8
*
color
)
{
DrawMD2Ex
(
gl_cmd_buffer
,
frame
,
duration
,
tics
,
nextframe
,
pos
,
scale
,
flipped
,
color
);
}
...
...
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