Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Commander-Genius
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
24
Issues
24
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gerhard Stein
Commander-Genius
Commits
af651999
Commit
af651999
authored
Jun 24, 2011
by
Gerstrong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Walking sound now works correctly and in all levels
parent
a57d3502
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
11 deletions
+60
-11
src/engine/galaxy/CAudioGalaxy.h
src/engine/galaxy/CAudioGalaxy.h
+2
-1
src/engine/galaxy/ai/CPlayerBase.cpp
src/engine/galaxy/ai/CPlayerBase.cpp
+19
-0
src/engine/galaxy/ai/CPlayerBase.h
src/engine/galaxy/ai/CPlayerBase.h
+10
-0
src/engine/galaxy/ai/CPlayerLevel.cpp
src/engine/galaxy/ai/CPlayerLevel.cpp
+28
-8
src/engine/galaxy/ai/CPlayerLevel.h
src/engine/galaxy/ai/CPlayerLevel.h
+0
-2
src/engine/galaxy/ai/CPlayerWM.cpp
src/engine/galaxy/ai/CPlayerWM.cpp
+1
-0
No files found.
src/engine/galaxy/CAudioGalaxy.h
View file @
af651999
...
...
@@ -13,7 +13,8 @@
const
unsigned
char
SndSlotMapGalaxy
[]
=
{
52
,
52
,
//52,52,
0
,
1
,
28
,
7
,
23
,
20
,
15
,
...
...
src/engine/galaxy/ai/CPlayerBase.cpp
View file @
af651999
...
...
@@ -28,6 +28,7 @@ m_Cheatmode(Cheatmode),
mp_processState
(
NULL
)
{
m_index
=
0
;
m_walktimer
=
0
;
m_timer
=
0
;
m_dying
=
false
;
m_hDir
=
facedir
;
...
...
@@ -200,6 +201,24 @@ void CPlayerBase::processLevelMiscFlagsCheck()
const
int
MAX_WALKSOUNDTIMER
=
20
;
void
CPlayerBase
::
makeWalkSound
()
{
const
int
time
=
m_walktimer
%
MAX_WALKSOUNDTIMER
;
// Process walk timer. This is only for the walking sound
if
(
time
==
MAX_WALKSOUNDTIMER
/
2
)
playSound
(
SOUND_KEEN_WALK2
);
else
if
(
time
==
0
)
playSound
(
SOUND_KEEN_WALK
);
m_walktimer
++
;
}
void
CPlayerBase
::
processDead
()
{
...
...
src/engine/galaxy/ai/CPlayerBase.h
View file @
af651999
...
...
@@ -55,6 +55,13 @@ public:
void
processLevelMiscFlagsCheck
();
/**
* Produces the walking sound. To produce that sound correctly, it uses a special timer.
* That's the reason we need that aiding function
*/
void
makeWalkSound
();
void
processDead
();
void
processDying
();
void
kill
();
...
...
@@ -74,6 +81,9 @@ protected:
stCheat
&
m_Cheatmode
;
void
(
CPlayerBase
::*
mp_processState
)();
private:
unsigned
char
m_walktimer
;
};
};
...
...
src/engine/galaxy/ai/CPlayerLevel.cpp
View file @
af651999
...
...
@@ -938,7 +938,13 @@ void CPlayerLevel::processPoleClimbing()
}
l_y_up
=
getYUpPos
()
+
(
16
<<
STC
);
// Check for the and upper lower side, upper because the hand can touch the edge in that case
if
(
!
hitdetectWithTileProperty
(
1
,
l_x
,
l_y_down
))
solid
=
true
;
else
solid
=
false
;
// Check for the and upper and lower side, upper because the hand can touch the edge in that case
if
(
hitdetectWithTileProperty
(
1
,
l_x
,
l_y_down
)
||
hitdetectWithTileProperty
(
1
,
l_x
,
l_y_up
)
)
{
// Slide down if there is more of the pole
...
...
@@ -949,12 +955,21 @@ void CPlayerLevel::processPoleClimbing()
{
// Fall down if there isn't any pole to slide down
m_climbing
=
false
;
setAction
(
A_KEEN_FALL
);
playSound
(
SOUND_KEEN_FALL
);
mp_processState
=
(
void
(
CPlayerBase
::*
)())
&
CPlayerLevel
::
processFalling
;
m_vDir
=
NONE
;
yinertia
=
0
;
solid
=
true
;
if
(
!
blockedd
)
{
setAction
(
A_KEEN_FALL
);
playSound
(
SOUND_KEEN_FALL
);
mp_processState
=
(
void
(
CPlayerBase
::*
)())
&
CPlayerLevel
::
processFalling
;
}
else
{
setAction
(
A_KEEN_STAND
);
mp_processState
=
(
void
(
CPlayerBase
::*
)())
&
CPlayerLevel
::
processStanding
;
}
}
}
else
...
...
@@ -1133,6 +1148,7 @@ void CPlayerLevel::processShootWhileStanding()
void
CPlayerLevel
::
processRunning
()
{
// Most of the walking routine is done by the action script itself
...
...
@@ -1147,7 +1163,7 @@ void CPlayerLevel::processRunning()
setAction
(
A_KEEN_STAND
);
}
// or he could change the walking direction
else
if
(
m_playcontrol
[
PA_X
]
<
0
)
// left
else
if
(
m_playcontrol
[
PA_X
]
<
0
)
// left
{
// Is he blocked make him stand, else continue walking
if
(
blockedl
)
...
...
@@ -1159,10 +1175,10 @@ void CPlayerLevel::processRunning()
{
// walk to the left
m_hDir
=
LEFT
;
playSound
(
SOUND_KEEN_WALK2
);
makeWalkSound
(
);
}
}
else
if
(
m_playcontrol
[
PA_X
]
>
0
)
// right
else
if
(
m_playcontrol
[
PA_X
]
>
0
)
// right
{
// Is he blocked make him stand, else continue walking
if
(
blockedr
)
...
...
@@ -1174,7 +1190,7 @@ void CPlayerLevel::processRunning()
{
// walk to the right
m_hDir
=
RIGHT
;
playSound
(
SOUND_KEEN_WALK2
);
makeWalkSound
(
);
}
}
...
...
@@ -1209,6 +1225,10 @@ void CPlayerLevel::processRunning()
{
m_ObjectPtrs
.
push_back
(
new
CBullets
(
mp_Map
,
newx
,
newy
,
m_hDir
));
}
else
{
playSound
(
SOUND_GUN_CLICK
);
}
setAction
(
A_KEEN_SHOOT
);
mp_processState
=
(
void
(
CPlayerBase
::*
)())
&
CPlayerLevel
::
processShootWhileStanding
;
...
...
src/engine/galaxy/ai/CPlayerLevel.h
View file @
af651999
...
...
@@ -234,8 +234,6 @@ private:
int
m_fire_recharge_time
;
bool
m_EnterDoorAttempt
;
//void (CPlayerLevel::*mp_processState)();
};
}
...
...
src/engine/galaxy/ai/CPlayerWM.cpp
View file @
af651999
...
...
@@ -265,6 +265,7 @@ void CPlayerWM::performWalkingAnimation(bool walking)
{
m_animation_time
=
5
;
sprite
+=
m_animation
%
3
;
makeWalkSound
();
}
else
sprite
+=
2
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment