Update of /cvsroot/opentnl/tnl/zap
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2705/zap
Modified Files:
sfx.cpp ship.cpp ship.h sparkManager.cpp
Log Message:
- Turbo noise is louder.
- Adjusted turbo sound profile to make it fade properly on the screen.
- Added spark grabbing logic so newest particle effects always have particles.
- Tweaked energy usage for shield and turbo. Energy usage is faster tempo now.
- Enabled client side prediction of energy (should give better feedback on when your shields are down).
Index: ship.h
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/ship.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** ship.h 5 May 2004 09:50:35 -0000 1.14
--- ship.h 7 May 2004 00:51:01 -0000 1.15
***************
*** 57,61 ****
MaxControlObjectInterpDistance = 200,
TrailCount = 2,
! RechargeRate = 3, // How many percent/second
};
--- 57,61 ----
MaxControlObjectInterpDistance = 200,
TrailCount = 2,
! RechargeRate = 6, // How many percent/second
};
***************
*** 93,96 ****
--- 93,97 ----
void render();
Ship(StringTableEntry playerName="", Point p = Point(0,0), F32 m = 1.0);
+ ~Ship();
F32 getHealth() { return mHealth; }
Index: sfx.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/sfx.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** sfx.cpp 5 May 2004 09:50:35 -0000 1.10
--- sfx.cpp 7 May 2004 00:50:59 -0000 1.11
***************
*** 43,47 ****
{ "ship_explode.wav", false, 1.0, false, 300, 1000 },
{ "ship_heal.wav", false, 1.0, false, 300, 1000 },
! { "ship_turbo.wav", false, 1.0, true, 300, 1000 },
{ "flag_capture.wav", true, 0.45f, false, 0, 0 },
{ "flag_drop.wav", true, 0.45f, false, 0, 0 },
--- 43,47 ----
{ "ship_explode.wav", false, 1.0, false, 300, 1000 },
{ "ship_heal.wav", false, 1.0, false, 300, 1000 },
! { "ship_turbo.wav", false, 1.0, true, 150, 500 },
{ "flag_capture.wav", true, 0.45f, false, 0, 0 },
{ "flag_drop.wav", true, 0.45f, false, 0, 0 },
Index: sparkManager.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/sparkManager.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** sparkManager.cpp 6 May 2004 01:36:01 -0000 1.7
--- sparkManager.cpp 7 May 2004 00:51:01 -0000 1.8
***************
*** 49,60 ****
U32 firstFreeIndex = 0;
Spark gSparks[MaxSparks];
void emitSpark(Point pos, Point vel, Color color, F32 ttl)
{
if(firstFreeIndex >= MaxSparks)
! return;
! Spark *s = gSparks + firstFreeIndex;
! firstFreeIndex++;
s->pos = pos;
--- 49,71 ----
U32 firstFreeIndex = 0;
+ U32 grabIndex = MaxSparks/2;
Spark gSparks[MaxSparks];
void emitSpark(Point pos, Point vel, Color color, F32 ttl)
{
+ Spark *s;
+
if(firstFreeIndex >= MaxSparks)
! {
! s = gSparks + grabIndex;
!
! // Bump an arbitrary amount ahead to avoid noticable artifacts.
! grabIndex = (grabIndex + 100) % MaxSparks;
! }
! else
! {
! s = gSparks + firstFreeIndex;
! firstFreeIndex++;
! }
s->pos = pos;
***************
*** 83,90 ****
theSpark->ttl -= dT;
theSpark->pos += theSpark->vel * dT;
! if(theSpark->ttl > 2)
theSpark->alpha = 1;
else
! theSpark->alpha = theSpark->ttl * 0.5;
i++;
}
--- 94,101 ----
theSpark->ttl -= dT;
theSpark->pos += theSpark->vel * dT;
! if(theSpark->ttl > 1)
theSpark->alpha = 1;
else
! theSpark->alpha = theSpark->ttl;
i++;
}
Index: ship.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/ship.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** ship.cpp 5 May 2004 09:50:35 -0000 1.24
--- ship.cpp 7 May 2004 00:51:00 -0000 1.25
***************
*** 77,80 ****
--- 77,89 ----
}
+ Ship::~Ship()
+ {
+ if(mTurboNoise.isValid())
+ {
+ mTurboNoise->setGain(0.f);
+ mTurboNoise->stop();
+ }
+ }
+
void Ship::processArguments(S32 argc, const char **argv)
{
***************
*** 175,179 ****
void Ship::burnEnergy( U32 dT )
{
! if(isGhost()) return;
F32 scaleFactor = ((F32)dT) / 1000.f;
--- 184,188 ----
void Ship::burnEnergy( U32 dT )
{
! // if(isGhost()) return;
F32 scaleFactor = ((F32)dT) / 1000.f;
***************
*** 194,203 ****
if(mShield)
{
! mEnergy -= 7.0f * scaleFactor;
}
if(mTurbo)
{
! mEnergy -= 20.0f * scaleFactor;
}
--- 203,212 ----
if(mShield)
{
! mEnergy -= 15.0f * scaleFactor;
}
if(mTurbo)
{
! mEnergy -= 15.0f * scaleFactor;
}
***************
*** 205,209 ****
if(mEnergy < 100.f)
{
! mEnergy += (F32)(dT * RechargeRate) / 1000.f;
if(mEnergy < 0.f)
--- 214,220 ----
if(mEnergy < 100.f)
{
! // If we're not doing anything, recharge.
! if(!(mShield || mTurbo))
! mEnergy += (F32)(dT * RechargeRate) / 1000.f;
if(mEnergy < 0.f)
***************
*** 221,227 ****
// Factor in shields
! if(mShield && mEnergy >= 10.f)
{
! mEnergy -= 10.f;
return;
}
--- 232,238 ----
// Factor in shields
! if(mShield && mEnergy >= 20.f)
{
! mEnergy -= 20.f;
return;
}
|