Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove profiler.h include where it's not needed. Remove some unreacha…
…ble and very old code
- Loading branch information
Showing
10 changed files
with
14 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,55 +162,37 @@ void Camera::step(f32 dtime) | |
{ | ||
//f32 offset = dtime * m_view_bobbing_speed * 0.035; | ||
f32 offset = dtime * m_view_bobbing_speed * 0.030; | ||
if (m_view_bobbing_state == 2) | ||
{ | ||
#if 0 | ||
if (m_view_bobbing_state == 2) { | ||
// Animation is getting turned off | ||
if (m_view_bobbing_anim < 0.5) | ||
if (m_view_bobbing_anim < 0.25) { | ||
m_view_bobbing_anim -= offset; | ||
else | ||
} else if (m_view_bobbing_anim > 0.75) { | ||
m_view_bobbing_anim += offset; | ||
if (m_view_bobbing_anim <= 0 || m_view_bobbing_anim >= 1) | ||
{ | ||
m_view_bobbing_anim = 0; | ||
m_view_bobbing_state = 0; | ||
} | ||
#endif | ||
#if 1 | ||
// Animation is getting turned off | ||
if(m_view_bobbing_anim < 0.25) | ||
{ | ||
m_view_bobbing_anim -= offset; | ||
} else if(m_view_bobbing_anim > 0.75) { | ||
m_view_bobbing_anim += offset; | ||
} | ||
if(m_view_bobbing_anim < 0.5) | ||
{ | ||
|
||
if (m_view_bobbing_anim < 0.5) { | ||
m_view_bobbing_anim += offset; | ||
if(m_view_bobbing_anim > 0.5) | ||
if (m_view_bobbing_anim > 0.5) | ||
m_view_bobbing_anim = 0.5; | ||
} else { | ||
m_view_bobbing_anim -= offset; | ||
if(m_view_bobbing_anim < 0.5) | ||
if (m_view_bobbing_anim < 0.5) | ||
m_view_bobbing_anim = 0.5; | ||
} | ||
if(m_view_bobbing_anim <= 0 || m_view_bobbing_anim >= 1 || | ||
fabs(m_view_bobbing_anim - 0.5) < 0.01) | ||
{ | ||
|
||
if (m_view_bobbing_anim <= 0 || m_view_bobbing_anim >= 1 || | ||
fabs(m_view_bobbing_anim - 0.5) < 0.01) { | ||
m_view_bobbing_anim = 0; | ||
m_view_bobbing_state = 0; | ||
} | ||
#endif | ||
} | ||
else | ||
{ | ||
else { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
nerzhul
Author
Member
|
||
float was = m_view_bobbing_anim; | ||
m_view_bobbing_anim = my_modf(m_view_bobbing_anim + offset); | ||
bool step = (was == 0 || | ||
(was < 0.5f && m_view_bobbing_anim >= 0.5f) || | ||
(was > 0.5f && m_view_bobbing_anim <= 0.5f)); | ||
if(step) | ||
{ | ||
if(step) { | ||
MtEvent *e = new SimpleTriggerEvent("ViewBobbingStep"); | ||
m_gamedef->event()->put(e); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You have extra newline here