Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GCCProg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Claudio Hoffmann
GCCProg
Commits
0660af11
Commit
0660af11
authored
Jan 16, 2021
by
Claudio Hoffmann
Browse files
Options
Downloads
Patches
Plain Diff
Entity: Add an unexpectedly awesome destruction animation
parent
adc007e4
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Entity.cpp
+1
-1
1 addition, 1 deletion
Entity.cpp
PixelShaders.cpp
+1
-1
1 addition, 1 deletion
PixelShaders.cpp
PixelShaders.hpp
+3
-2
3 additions, 2 deletions
PixelShaders.hpp
with
5 additions
and
4 deletions
Entity.cpp
+
1
−
1
View file @
0660af11
...
@@ -65,7 +65,7 @@ int Entity::takeDamage()
...
@@ -65,7 +65,7 @@ int Entity::takeDamage()
void
Entity
::
blit
(
DynamicPixelBuffer
&
buf
)
void
Entity
::
blit
(
DynamicPixelBuffer
&
buf
)
{
{
if
(
hittime
>
0.0f
)
{
if
(
hittime
>
0.0f
)
{
HitShader
hs
{
getSprite
(),
hittime
,
HIT_TIME
};
HitShader
hs
{
getSprite
(),
(
hittime
/
HIT_TIME
),
(
hitpoints
==
0
)
};
buf
.
blit_topleft
(
topleft
,
hs
);
buf
.
blit_topleft
(
topleft
,
hs
);
}
else
if
(
hitpoints
>
0
)
{
}
else
if
(
hitpoints
>
0
)
{
buf
.
blit_topleft
(
topleft
,
getSprite
());
buf
.
blit_topleft
(
topleft
,
getSprite
());
...
...
This diff is collapsed.
Click to expand it.
PixelShaders.cpp
+
1
−
1
View file @
0660af11
...
@@ -22,5 +22,5 @@ Color HitShader::peekUnchecked(PixelPoint const &pos) const
...
@@ -22,5 +22,5 @@ Color HitShader::peekUnchecked(PixelPoint const &pos) const
if
(
src
==
_t
)
{
if
(
src
==
_t
)
{
return
_t
;
return
_t
;
}
}
return
(
dist
(
rng
.
rng
)
>
0.95f
)
?
_3
:
src
;
return
(
dist
(
rng
.
rng
)
>
0.95f
)
?
_3
:
(
is_final
?
_t
:
src
)
;
}
}
This diff is collapsed.
Click to expand it.
PixelShaders.hpp
+
3
−
2
View file @
0660af11
...
@@ -6,9 +6,10 @@
...
@@ -6,9 +6,10 @@
class
HitShader
:
public
ShadedPixelBuffer
{
class
HitShader
:
public
ShadedPixelBuffer
{
public:
public:
float
percent
;
float
percent
;
bool
is_final
;
HitShader
(
PixelBuffer
const
&
input
,
float
time_cur
,
float
time_tot
al
)
HitShader
(
PixelBuffer
const
&
input
,
float
percent
,
bool
is_fin
al
)
:
ShadedPixelBuffer
(
input
),
percent
(
time_cur
/
time_tot
al
)
{
:
ShadedPixelBuffer
(
input
),
percent
(
percent
),
is_final
(
is_fin
al
)
{
}
}
virtual
Color
peekUnchecked
(
PixelPoint
const
&
pos
)
const
;
virtual
Color
peekUnchecked
(
PixelPoint
const
&
pos
)
const
;
...
...
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