--- a/hedgewars/GSHandlers.inc Thu Nov 05 20:47:42 2009 +0000
+++ b/hedgewars/GSHandlers.inc Thu Nov 05 20:48:13 2009 +0000
@@ -16,32 +16,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*)
-procedure makeHogsWorry(x, y: hwFloat; r: LongInt);
-var gi: PGear;
- d: LongInt;
-begin
- gi:= GearsList;
- while gi <> nil do
- begin
- d:= r - hwRound(Distance(gi^.X - x, gi^.Y - y));
- if (d > 1) and (gi^.Kind = gtHedgehog) and not gi^.Invulnerable then
- begin
- if (gi^.State and gstMoving) = 0 then
- gi^.State:= gi^.State or gstLoser;
- if (CurrentHedgehog^.Gear = gi) then
- PlaySound(sndOops, false, PHedgehog(gi^.Hedgehog)^.Team^.voicepack)
- else
- begin
- if d > r div 2 then
- PlaySound(sndNooo, false, PHedgehog(gi^.Hedgehog)^.Team^.voicepack)
- else
- PlaySound(sndUhOh, false, PHedgehog(gi^.Hedgehog)^.Team^.voicepack);
- end;
- end;
- gi:= gi^.NextGear
- end;
-end;
-////////////////////////////////////////////////////////////////////////////////
procedure doStepDrowningGear(Gear: PGear); forward;
function CheckGearDrowning(Gear: PGear): boolean;
@@ -187,13 +161,6 @@
doStepFallingGear(Gear);
dec(Gear^.Timer);
-if Gear^.Timer = 1000 then // might need adjustments
- case Gear^.Kind of
- gtAmmo_Bomb: makeHogsWorry(Gear^.X, Gear^.Y, 50);
- gtClusterBomb: makeHogsWorry(Gear^.X, Gear^.Y, 20);
- gtWatermelon: makeHogsWorry(Gear^.X, Gear^.Y, 75);
- gtHellishBomb: makeHogsWorry(Gear^.X, Gear^.Y, 90);
- end;
if Gear^.Timer = 0 then
begin
case Gear^.Kind of
@@ -284,6 +251,7 @@
procedure doStepWatermelon(Gear: PGear);
begin
AllInactive:= false;
+PlaySound(sndMelon, false, nil);
Gear^.doStep:= @doStepBomb
end;
@@ -1191,8 +1159,6 @@
doStepFallingGear(Gear);
AllInactive:= false;
if Gear^.Timer mod 166 = 0 then inc(Gear^.Tag);
-if Gear^.Timer = 1000 then // might need better timing
- makeHogsWorry(Gear^.X, Gear^.Y, 75);
if Gear^.Timer = 0 then
begin
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 75, EXPLAutoSound);
@@ -1358,8 +1324,10 @@
if (hwRound(Gear^.Y) > cWaterLine) then
begin
for i:= 0 to 3 do
+ begin
AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 16 + Random(16), vgtSteam);
- PlaySound(sndVaporize, false, nil);
+ PlaySound(sndVaporize, false, nil);
+ end;
DeleteGear(Gear);
exit
end
@@ -1562,6 +1530,7 @@
Gear^.Health:= 6;
Gear^.doStep:= @doStepAirAttackWork;
+PlaySound(sndIncoming, false, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack)
end;
////////////////////////////////////////////////////////////////////////////////
@@ -2454,7 +2423,6 @@
end
end;
-////////////////////////////////////////////////////////////////////////////////
procedure doStepJetpack(Gear: PGear);
var HHGear: PGear;
begin
--- a/hedgewars/HHHandlers.inc Thu Nov 05 20:47:42 2009 +0000
+++ b/hedgewars/HHHandlers.inc Thu Nov 05 20:48:13 2009 +0000
@@ -136,8 +136,6 @@
yy:= -AngleCos(Angle);
if ((Gear^.State and gstHHHJump) <> 0) then xx:= - xx;
- if Ammo^[CurSlot, CurAmmo].AttackVoice <> sndNone then
- PlaySound(Ammo^[CurSlot, CurAmmo].AttackVoice, false, CurrentTeam^.voicepack);
case Ammo^[CurSlot, CurAmmo].AmmoType of
amGrenade: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtAmmo_Bomb, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, Ammo^[CurSlot, CurAmmo].Timer);
amMolotov: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtMolotov, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0);
@@ -151,10 +149,16 @@
amPickHammer: CurAmmoGear:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y) + cHHRadius, gtPickHammer, 0, _0, _0, 0);
amSkip: ParseCommand('/skip', true);
amRope: CurAmmoGear:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtRope, 0, xx, yy, 0);
- amMine: AddGear(hwRound(X) + hwSign(dX) * 7, hwRound(Y), gtMine, 0, SignAs(_0_02, dX), _0, 3000);
+ amMine: begin
+ AddGear(hwRound(X) + hwSign(dX) * 7, hwRound(Y), gtMine, 0, SignAs(_0_02, dX), _0, 3000);
+ PlaySound(sndLaugh, false, CurrentTeam^.voicepack)
+ end;
amDEagle: CurAmmoGear:= AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtDEagleShot, 0, xx * _0_5, yy * _0_5, 0);
amSniperRifle: CurAmmoGear:= AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtSniperRifleShot, 0, xx * _0_5, yy * _0_5, 0);
- amDynamite: AddGear(hwRound(X) + hwSign(dX) * 7, hwRound(Y), gtDynamite, 0, SignAs(_0_03, dX), _0, 5000);
+ amDynamite: begin
+ AddGear(hwRound(X) + hwSign(dX) * 7, hwRound(Y), gtDynamite, 0, SignAs(_0_03, dX), _0, 5000);
+ PlaySound(sndLaugh, false, CurrentTeam^.voicepack)
+ end;
amFirePunch: CurAmmoGear:= AddGear(hwRound(X) + hwSign(dX) * 10, hwRound(Y), gtFirePunch, 0, xx, _0, 0);
amWhip: begin
CurAmmoGear:= AddGear(hwRound(X) + hwSign(dX) * 10, hwRound(Y), gtWhip, 0, SignAs(_1, dX), - _0_8, 0);
@@ -180,7 +184,10 @@
PlaySound(sndRCPlane, true, nil)
end;
amKamikaze: CurAmmoGear:= AddGear(hwRound(X), hwRound(Y), gtKamikaze, 0, xx * _0_5, yy * _0_5, 0);
- amCake: CurAmmoGear:= AddGear(hwRound(X) + hwSign(dX) * 3, hwRound(Y), gtCake, 0, xx, _0, 0);
+ amCake: begin
+ CurAmmoGear:= AddGear(hwRound(X) + hwSign(dX) * 3, hwRound(Y), gtCake, 0, xx, _0, 0);
+ PlaySound(sndLaugh, false, CurrentTeam^.voicepack)
+ end;
amSeduction: CurAmmoGear:= AddGear(hwRound(X + xx * cHHRadius * 2), hwRound(Y + yy * cHHRadius * 2), gtSeduction, 0, xx * _0_4, yy * _0_4, 0);
amWatermelon: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtWatermelon, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, Ammo^[CurSlot, CurAmmo].Timer);
amHellishBomb: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtHellishBomb, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0);
@@ -396,13 +403,8 @@
end;
PrevdX:= hwSign(Gear^.dX);
-
- if (Gear^.Message and gm_Left) <> 0 then
- Gear^.dX:= -cLittle
- else if (Gear^.Message and gm_Right) <> 0 then
- Gear^.dX:= cLittle
- else
- exit;
+ if (Gear^.Message and gm_Left )<>0 then Gear^.dX:= -cLittle else
+ if (Gear^.Message and gm_Right )<>0 then Gear^.dX:= cLittle else exit;
StepTicks:= cHHStepTicks;
if PrevdX <> hwSign(Gear^.dX) then
@@ -591,7 +593,6 @@
if (TurnTimeLeft = 0) or (Gear^.Damage > 0) then
begin
- StopSound(sndWalking);
TurnTimeLeft:= 0;
isCursorVisible:= false;
Gear^.State:= Gear^.State and not (gstHHDriven or gstAnimation or gstAttacking);
@@ -603,9 +604,7 @@
if (Gear^.State and gstAnimation) <> 0 then
begin
- StopSound(sndWalking);
Gear^.Message:= 0;
- if (Gear^.Pos = Wavez[TWave(Gear^.Tag)].VoiceDelay) and (Gear^.Timer = 0) then PlaySound(Wavez[TWave(Gear^.Tag)].Voice, false, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack);
inc(Gear^.Timer);
if Gear^.Timer = Wavez[TWave(Gear^.Tag)].Interval then
begin
@@ -617,13 +616,6 @@
exit
end;
- // HACK? "StepTicks < 100" - any better way to detect the jump delay?
-if not cArtillery and (StepTicks < 100) and ((Gear^.State and (gstMoving or gstDrowning)) = 0) and ((Gear^.Message and (gm_Left or gm_Right)) <> 0) then
- LoopSound(sndWalking, nil)
-else
- StopSound(sndWalking);
-
-
if ((Gear^.State and gstMoving) <> 0)
or (StepTicks = cHHStepTicks)
or (CurAmmoGear <> nil) then // we are moving
--- a/hedgewars/hwengine.pas Thu Nov 05 20:47:42 2009 +0000
+++ b/hedgewars/hwengine.pas Thu Nov 05 20:48:13 2009 +0000
@@ -628,7 +628,7 @@
////////////////////////////////////////////////////////////////////////////////
begin
-WriteLnToConsole('Hedgewars ' + cVersionString + ' engine (protocol version ' + inttostr(cNetProtoVersion) + ')');
+WriteLnToConsole('Hedgewars ' + cVersionString + ' engine');
GetParams;
// FIXME - hack in font with support for CJK
if (cLocaleFName = 'zh_CN.txt') or (cLocaleFName = 'zh_TW.txt') or (cLocaleFName = 'ja.txt') then
--- a/hedgewars/tunsetborder.inc Thu Nov 05 20:47:42 2009 +0000
+++ b/hedgewars/tunsetborder.inc Thu Nov 05 20:48:13 2009 +0000
@@ -23,5 +23,5 @@
ty:= hwRound(Y);
if ((ty and LAND_HEIGHT_MASK) = 0) and
((tx and LAND_WIDTH_MASK) = 0) and
- ((Land[ty, tx] = COLOR_LAND) or (Land[ty, tx] = COLOR_OBJECT)) then LandPixels[ty, tx]:= cExplosionBorderColor
+ (Land[ty, tx] = COLOR_LAND) then LandPixels[ty, tx]:= cExplosionBorderColor
end;
--- a/hedgewars/uConsts.pas Thu Nov 05 20:47:42 2009 +0000
+++ b/hedgewars/uConsts.pas Thu Nov 05 20:48:13 2009 +0000
@@ -84,8 +84,7 @@
TGearsType = set of TGearType;
- TSound = (sndNone,
- sndGrenadeImpact, sndExplosion, sndThrowPowerUp, sndThrowRelease,
+ TSound = (sndGrenadeImpact, sndExplosion, sndThrowPowerUp, sndThrowRelease,
sndSplash, sndShotgunReload, sndShotgunFire, sndGraveImpact,
sndMineTick, sndPickhammer, sndGun, sndUFO, sndJump1, sndJump2,
sndJump3, sndYesSir, sndLaugh, sndIllGetYou, sndIncoming,
@@ -97,8 +96,7 @@
sndMelon, sndHellish, sndYoohoo, sndRCPlane, sndWhipCrack,
sndRideOfTheValkyries, sndDenied, sndPlaced, sndBaseballBat,
sndVaporize, sndWarp, sndSuddenDeath, sndMortar, sndShutter,
- sndHomerun, sndMolotov, sndWalking, sndCover, sndUhOh,
- sndOops, sndNooo, sndHello);
+ sndHomerun, sndMolotov);
TAmmoType = (amNothing, amGrenade, amClusterBomb, amBazooka, amUFO, amShotgun, amPickHammer,
amSkip, amRope, amMine, amDEagle, amDynamite, amFirePunch, amWhip,
@@ -133,7 +131,6 @@
Timer: LongWord;
Pos: LongWord;
AmmoType: TAmmoType;
- AttackVoice: TSound;
end;
TVertex2f = record
@@ -210,7 +207,6 @@
COLOR_LAND = $FFFF; // white
COLOR_INDESTRUCTIBLE = $88FF; // red
- COLOR_OBJECT = $44FF;
//some opengl headers do not have these macros
GL_BGR = $80E0;
@@ -651,23 +647,20 @@
FramesCount: Longword;
Interval: Longword;
cmd: String[20];
- Voice: TSound;
- VoiceDelay: ShortInt;
end = (
- (Sprite: sprKowtow; FramesCount: 12; Interval: 125; cmd: '/rollup'; Voice: sndNone; VoiceDelay: 0),
- (Sprite: sprSad; FramesCount: 14; Interval: 125; cmd: '/sad'; Voice: sndNone; VoiceDelay: 0),
- (Sprite: sprWave; FramesCount: 16; Interval: 125; cmd: '/wave'; Voice: sndHello; VoiceDelay: 5),
- (Sprite: sprHurrah; FramesCount: 14; Interval: 125; cmd: '/hurrah'; Voice: sndNone; VoiceDelay: 0),
- (Sprite: sprLemonade; FramesCount: 24; Interval: 125; cmd: '/ilovelotsoflemonade'; Voice: sndNone; VoiceDelay: 0),
- (Sprite: sprShrug; FramesCount: 24; Interval: 125; cmd: '/shrug'; Voice: sndNone; VoiceDelay: 0),
- (Sprite: sprJuggle; FramesCount: 49; Interval: 38; cmd: '/juggle'; Voice: sndNone; VoiceDelay: 0)
+ (Sprite: sprKowtow; FramesCount: 12; Interval: 125; cmd: '/rollup'),
+ (Sprite: sprSad; FramesCount: 14; Interval: 125; cmd: '/sad'),
+ (Sprite: sprWave; FramesCount: 16; Interval: 125; cmd: '/wave'),
+ (Sprite: sprHurrah; FramesCount: 14; Interval: 125; cmd: '/hurrah'),
+ (Sprite: sprLemonade; FramesCount: 24; Interval: 125; cmd: '/ilovelotsoflemonade'),
+ (Sprite: sprShrug; FramesCount: 24; Interval: 125; cmd: '/shrug'),
+ (Sprite: sprJuggle; FramesCount: 49; Interval: 38; cmd: '/juggle')
);
Soundz: array[TSound] of record
FileName: String[25];
Path : TPathType;
end = (
- (FileName: ''; Path: ptSounds),// sndNone
(FileName: 'grenadeimpact.ogg'; Path: ptSounds),// sndGrenadeImpact
(FileName: 'explosion.ogg'; Path: ptSounds),// sndExplosion
(FileName: 'throwpowerup.ogg'; Path: ptSounds),// sndThrowPowerUp
@@ -726,13 +719,7 @@
(FileName: 'mortar.ogg'; Path: ptSounds),// sndMortar
(FileName: 'shutterclick.ogg'; Path: ptSounds),// sndShutter
(FileName: 'homerun.ogg'; Path: ptSounds),// sndHomerun
- (FileName: 'molotov.ogg'; Path: ptSounds),// sndMolotov
- (FileName: 'walking.ogg'; Path: ptSounds),// sndWalking
- (FileName: 'Takecover.ogg'; Path: ptVoices),// sndCover
- (FileName: 'Uh-oh.ogg'; Path: ptVoices),// sndUhOh
- (FileName: 'Oops.ogg'; Path: ptVoices),// sndOops
- (FileName: 'Nooo.ogg'; Path: ptVoices),// sndNooo
- (FileName: 'Hello.ogg'; Path: ptVoices) // sndHello
+ (FileName: 'molotov.ogg'; Path: ptSounds) // sndMolotov
);
Ammoz: array [TAmmoType] of record
@@ -759,8 +746,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amNothing;
- AttackVoice: sndNone);
+ AmmoType: amNothing);
Slot: 0;
TimeAfterTurn: 0;
minAngle: 0;
@@ -780,8 +766,7 @@
NumPerTurn: 0;
Timer: 3000;
Pos: 0;
- AmmoType: amGrenade;
- AttackVoice: sndCover);
+ AmmoType: amGrenade);
Slot: 1;
TimeAfterTurn: 3000;
minAngle: 0;
@@ -801,8 +786,7 @@
NumPerTurn: 0;
Timer: 3000;
Pos: 0;
- AmmoType: amClusterBomb;
- AttackVoice: sndCover);
+ AmmoType: amClusterBomb);
Slot: 1;
TimeAfterTurn: 3000;
minAngle: 0;
@@ -821,8 +805,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amBazooka;
- AttackVoice: sndNone);
+ AmmoType: amBazooka);
Slot: 0;
TimeAfterTurn: 3000;
minAngle: 0;
@@ -842,8 +825,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amUFO;
- AttackVoice: sndNone);
+ AmmoType: amUFO);
Slot: 0;
TimeAfterTurn: 3000;
minAngle: 0;
@@ -861,8 +843,7 @@
NumPerTurn: 1;
Timer: 0;
Pos: 0;
- AmmoType: amShotgun;
- AttackVoice: sndNone);
+ AmmoType: amShotgun);
Slot: 2;
TimeAfterTurn: 3000;
minAngle: 0;
@@ -883,8 +864,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amPickHammer;
- AttackVoice: sndNone);
+ AmmoType: amPickHammer);
Slot: 6;
TimeAfterTurn: 0;
minAngle: 0;
@@ -903,8 +883,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amSkip;
- AttackVoice: sndNone);
+ AmmoType: amSkip);
Slot: 8;
TimeAfterTurn: 0;
minAngle: 0;
@@ -924,8 +903,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amRope;
- AttackVoice: sndNone);
+ AmmoType: amRope);
Slot: 7;
TimeAfterTurn: 0;
minAngle: 0;
@@ -946,8 +924,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amMine;
- AttackVoice: sndLaugh);
+ AmmoType: amMine);
Slot: 4;
TimeAfterTurn: 5000;
minAngle: 0;
@@ -965,8 +942,7 @@
NumPerTurn: 3;
Timer: 0;
Pos: 0;
- AmmoType: amDEagle;
- AttackVoice: sndNone);
+ AmmoType: amDEagle);
Slot: 2;
TimeAfterTurn: 3000;
minAngle: 0;
@@ -987,8 +963,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amDynamite;
- AttackVoice: sndLaugh);
+ AmmoType: amDynamite);
Slot: 4;
TimeAfterTurn: 5000;
minAngle: 0;
@@ -1008,8 +983,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amFirePunch;
- AttackVoice: sndNone);
+ AmmoType: amFirePunch);
Slot: 3;
TimeAfterTurn: 3000;
MinAngle: 0;
@@ -1027,8 +1001,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amWhip;
- AttackVoice: sndNone);
+ AmmoType: amWhip);
Slot: 3;
TimeAfterTurn: 3000;
MinAngle: 0;
@@ -1046,8 +1019,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amBaseballBat;
- AttackVoice: sndNone);
+ AmmoType: amBaseballBat);
Slot: 3;
TimeAfterTurn: 5000;
minAngle: 0;
@@ -1069,8 +1041,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amParachute;
- AttackVoice: sndNone);
+ AmmoType: amParachute);
Slot: 7;
TimeAfterTurn: 0;
minAngle: 0;
@@ -1092,8 +1063,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amAirAttack;
- AttackVoice: sndIncoming);
+ AmmoType: amAirAttack);
Slot: 5;
TimeAfterTurn: 0;
minAngle: 0;
@@ -1115,8 +1085,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amMineStrike;
- AttackVoice: sndNone);
+ AmmoType: amMineStrike);
Slot: 5;
TimeAfterTurn: 0;
minAngle: 0;
@@ -1134,8 +1103,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amBlowTorch;
- AttackVoice: sndNone);
+ AmmoType: amBlowTorch);
Slot: 6;
TimeAfterTurn: 3000;
minAngle: 768;
@@ -1155,8 +1123,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amGirder;
- AttackVoice: sndNone);
+ AmmoType: amGirder);
Slot: 6;
TimeAfterTurn: 3000;
minAngle: 0;
@@ -1178,8 +1145,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amTeleport;
- AttackVoice: sndNone);
+ AmmoType: amTeleport);
Slot: 7;
TimeAfterTurn: 0;
minAngle: 0;
@@ -1199,8 +1165,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amSwitch;
- AttackVoice: sndNone);
+ AmmoType: amSwitch);
Slot: 8;
TimeAfterTurn: 0;
minAngle: 0;
@@ -1218,8 +1183,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amMortar;
- AttackVoice: sndNone);
+ AmmoType: amMortar);
Slot: 1;
TimeAfterTurn: 3000;
minAngle: 0;
@@ -1239,8 +1203,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amKamikaze;
- AttackVoice: sndNone);
+ AmmoType: amKamikaze);
Slot: 3;
TimeAfterTurn: 0;
minAngle: 0;
@@ -1260,8 +1223,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amCake;
- AttackVoice: sndLaugh);
+ AmmoType: amCake);
Slot: 4;
TimeAfterTurn: 0;
minAngle: 0;
@@ -1279,8 +1241,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amSeduction;
- AttackVoice: sndNone);
+ AmmoType: amSeduction);
Slot: 2;
TimeAfterTurn: 0;
minAngle: 0;
@@ -1300,8 +1261,7 @@
NumPerTurn: 0;
Timer: 3000;
Pos: 0;
- AmmoType: amWatermelon;
- AttackVoice: sndMelon);
+ AmmoType: amWatermelon);
Slot: 1;
TimeAfterTurn: 3000;
minAngle: 0;
@@ -1320,8 +1280,7 @@
NumPerTurn: 0;
Timer: 5000;
Pos: 0;
- AmmoType: amHellishBomb;
- AttackVoice: sndNone);
+ AmmoType: amHellishBomb);
Slot: 4;
TimeAfterTurn: 3000;
minAngle: 0;
@@ -1343,8 +1302,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amNapalm;
- AttackVoice: sndNone);
+ AmmoType: amNapalm);
Slot: 5;
TimeAfterTurn: 0;
minAngle: 0;
@@ -1363,8 +1321,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amDrill;
- AttackVoice: sndNone);
+ AmmoType: amDrill);
Slot: 0;
TimeAfterTurn: 3000;
minAngle: 0;
@@ -1383,8 +1340,7 @@
NumPerTurn: 0;
Timer: 5001;
Pos: 0;
- AmmoType: amBallgun;
- AttackVoice: sndNone);
+ AmmoType: amBallgun);
Slot: 2;
TimeAfterTurn: 0;
minAngle: 0;
@@ -1404,8 +1360,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amRCPlane;
- AttackVoice: sndNone);
+ AmmoType: amRCPlane);
Slot: 6;
TimeAfterTurn: 0;
minAngle: 0;
@@ -1426,8 +1381,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amLowGravity;
- AttackVoice: sndNone);
+ AmmoType: amLowGravity);
Slot: 8;
TimeAfterTurn: 0;
minAngle: 0;
@@ -1448,8 +1402,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amExtraDamage;
- AttackVoice: sndNone);
+ AmmoType: amExtraDamage);
Slot: 8;
TimeAfterTurn: 0;
minAngle: 0;
@@ -1470,8 +1423,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amInvulnerable;
- AttackVoice: sndNone);
+ AmmoType: amInvulnerable);
Slot: 8;
TimeAfterTurn: 0;
minAngle: 0;
@@ -1492,8 +1444,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amExtraTime;
- AttackVoice: sndNone);
+ AmmoType: amExtraTime);
Slot: 7;
TimeAfterTurn: 0;
minAngle: 0;
@@ -1514,8 +1465,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amLaserSight;
- AttackVoice: sndNone);
+ AmmoType: amLaserSight);
Slot: 7;
TimeAfterTurn: 0;
minAngle: 0;
@@ -1536,8 +1486,7 @@
NumPerTurn: 0;
Timer: 0;
Pos: 0;
- AmmoType: amVampiric;
- AttackVoice: sndNone);
+ AmmoType: amVampiric);
Slot: 6;
TimeAfterTurn: 0;
minAngle: 0;
@@ -1555,8 +1504,7 @@
NumPerTurn: 1;
Timer: 0;
Pos: 0;
- AmmoType: amSniperRifle;
- AttackVoice: sndNone);
+ AmmoType: amSniperRifle);
Slot: 2;
TimeAfterTurn: 3000;
minAngle: 0;
@@ -1578,8 +1526,7 @@
NumPerTurn: 1;
Timer: 0;
Pos: 0;
- AmmoType: amJetpack;
- AttackVoice: sndNone);
+ AmmoType: amJetpack);
Slot: 3;
TimeAfterTurn: 3000;
minAngle: 0;
@@ -1599,8 +1546,7 @@
NumPerTurn: 0;
Timer: 3000;
Pos: 0;
- AmmoType: amMolotov;
- AttackVoice: sndNone);
+ AmmoType: amMolotov);
Slot: 1;
TimeAfterTurn: 3000;
minAngle: 0;
--- a/hedgewars/uLand.pas Thu Nov 05 20:47:42 2009 +0000
+++ b/hedgewars/uLand.pas Thu Nov 05 20:48:13 2009 +0000
@@ -38,14 +38,12 @@
hasBorder: boolean; // I'm putting this here for now. I'd like it to be toggleable by user (so user can set a border on a non-cave map) - will turn off air attacks
hasGirders: boolean; // I think should be on template by template basis. some caverns might have open water and large spaces. Some islands do not need? It might be better to tweak the girder code based upon space above. dunno.
playHeight, playWidth, leftX, rightX, topY, MaxHedgehogs: Longword; // idea is that a template can specify height/width. Or, a map, a height/width by the dimensions of the image. If the map has pixels near top of image, it triggers border. Maybe not a good idea, but, for now? Could also be used to prevent placing a girder outside play area on maps with hasBorder = true
- LandBackSurface: PSDL_Surface;
// in your coding style, it appears to be "isXXXX" for a verb, and "FooBar" for everything else - should be PlayHeight ?
procedure GenMap;
function GenPreview: TPreview;
procedure CheckLandDigest(s: shortstring);
-function LandBackPixel(x, y: LongInt): LongWord;
implementation
uses uConsole, uStore, uMisc, uRandom, uTeams, uLandObjects, uSHA, uIO, uAmmos, uLandTexture;
@@ -311,18 +309,6 @@
end;
end;
-function LandBackPixel(x, y: LongInt): LongWord;
-var p: PLongWordArray;
-begin
- if LandBackSurface = nil then
- begin
- LandBackPixel:= 0;
- exit;
- end;
- p:= LandBackSurface^.pixels;
- LandBackPixel:= p^[(LandBackSurface^.w) * (y mod LandBackSurface^.h) + (x mod LandBackSurface^.w)];// or $FF000000;
-end;
-
procedure ColorizeLand(Surface: PSDL_Surface);
var tmpsurf: PSDL_Surface;
r, rr: TSDL_Rect;
@@ -342,8 +328,6 @@
end;
SDL_FreeSurface(tmpsurf);
-LandBackSurface:= LoadImage(Pathz[ptCurrTheme] + '/LandBackTex', ifIgnoreCaps or ifTransparent);
-
tmpsurf:= LoadImage(Pathz[ptCurrTheme] + '/Border', ifCritical or ifIgnoreCaps or ifTransparent);
for x:= 0 to LAND_WIDTH - 1 do
begin
@@ -852,9 +836,5 @@
end;
initialization
-LandBackSurface:= nil;
-finalization
-if LandBackSurface <> nil then
- SDL_FreeSurface(LandBackSurface);
end.
--- a/hedgewars/uLandGraphics.pas Thu Nov 05 20:47:42 2009 +0000
+++ b/hedgewars/uLandGraphics.pas Thu Nov 05 20:48:13 2009 +0000
@@ -139,38 +139,25 @@
if (dx = dy) then ChangeCircleLines(x, y, dx, dy, doSet)
end;
-procedure FillLandCircleLines0(x, y, dx, dy, cr: LongInt);
+procedure FillLandCircleLines0(x, y, dx, dy: LongInt);
var i: LongInt;
begin
-cr:= cr * cr; // avoid sqrt() to compare lengths/distances
if ((y + dy) and LAND_HEIGHT_MASK) = 0 then
for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do
- if (LandPixels[y + dy, i] and $FF000000) <> 0 then
- if (dy * dy + (i - x) * (i - x) < cr) or (Land[y + dy, i] = COLOR_OBJECT) then
- LandPixels[y + dy, i]:= 0
- else
- LandPixels[y + dy, i]:= LandBackPixel(i, y + dy);
+ if Land[y + dy, i] = COLOR_LAND then
+ LandPixels[y + dy, i]:= 0;
if ((y - dy) and LAND_HEIGHT_MASK) = 0 then
for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do
- if (LandPixels[y - dy, i] and $FF000000) <> 0 then
- if (dy * dy + (i - x) * (i - x) < cr) or (Land[y - dy, i] = COLOR_OBJECT) then
- LandPixels[y - dy, i]:= 0
- else
- LandPixels[y - dy, i]:= LandBackPixel(i, y - dy);
+ if Land[y - dy, i] = COLOR_LAND then
+ LandPixels[y - dy, i]:= 0;
if ((y + dx) and LAND_HEIGHT_MASK) = 0 then
for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do
- if (LandPixels[y + dx, i] and $FF000000) <> 0 then
- if (dx * dx + (i - x) * (i - x) < cr) or (Land[y + dx, i] = COLOR_OBJECT) then
- LandPixels[y + dx, i]:= 0
- else
- LandPixels[y + dx, i]:= LandBackPixel(i, y + dx);
+ if Land[y + dx, i] = COLOR_LAND then
+ LandPixels[y + dx, i]:= 0;
if ((y - dx) and LAND_HEIGHT_MASK) = 0 then
for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do
- if (LandPixels[y - dx, i] and $FF000000) <> 0 then
- if (dx * dx + (i - x) * (i - x) < cr) or (Land[y - dx, i] = COLOR_OBJECT) then
- LandPixels[y - dx, i]:= 0
- else
- LandPixels[y - dx, i]:= LandBackPixel(i, y - dx);
+ if Land[y - dx, i] = COLOR_LAND then
+ LandPixels[y - dx, i]:= 0;
end;
procedure FillLandCircleLinesEBC(x, y, dx, dy: LongInt);
@@ -178,7 +165,7 @@
begin
if ((y + dy) and LAND_HEIGHT_MASK) = 0 then
for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do
- if (Land[y + dy, i] = COLOR_LAND) or (Land[y + dy, i] = COLOR_OBJECT) then
+ if Land[y + dy, i] = COLOR_LAND then
begin
LandPixels[y + dy, i]:= cExplosionBorderColor;
// Despeckle(y + dy, i);
@@ -186,7 +173,7 @@
end;
if ((y - dy) and LAND_HEIGHT_MASK) = 0 then
for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do
- if (Land[y - dy, i] = COLOR_LAND) or (Land[y - dy, i] = COLOR_OBJECT) then
+ if Land[y - dy, i] = COLOR_LAND then
begin
LandPixels[y - dy, i]:= cExplosionBorderColor;
// Despeckle(y - dy, i);
@@ -194,7 +181,7 @@
end;
if ((y + dx) and LAND_HEIGHT_MASK) = 0 then
for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do
- if (Land[y + dx, i] = COLOR_LAND) or (Land[y + dx, i] = COLOR_OBJECT) then
+ if Land[y + dx, i] = COLOR_LAND then
begin
LandPixels[y + dx, i]:= cExplosionBorderColor;
// Despeckle(y + dx, i);
@@ -202,7 +189,7 @@
end;
if ((y - dx) and LAND_HEIGHT_MASK) = 0 then
for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do
- if (Land[y - dx, i] = COLOR_LAND) or (Land[y - dx, i] = COLOR_OBJECT) then
+ if Land[y - dx, i] = COLOR_LAND then
begin
LandPixels[y - dx, i]:= cExplosionBorderColor;
// Despeckle(y - dx, i);
@@ -211,17 +198,14 @@
end;
procedure DrawExplosion(X, Y, Radius: LongInt);
-var dx, dy, ty, tx, d, cr: LongInt;
+var dx, dy, ty, tx, d: LongInt;
begin
dx:= 0;
dy:= Radius;
d:= 3 - 2 * Radius;
- cr:= Radius * 3 div 4;
- if cr < 10 then cr:= 0;
-
while (dx < dy) do
begin
- FillLandCircleLines0(x, y, dx, dy, cr);
+ FillLandCircleLines0(x, y, dx, dy);
if (d < 0)
then d:= d + 4 * dx + 6
else begin
@@ -230,7 +214,7 @@
end;
inc(dx)
end;
- if (dx = dy) then FillLandCircleLines0(x, y, dx, dy, cr);
+ if (dx = dy) then FillLandCircleLines0(x, y, dx, dy);
// FillRoundInLand after erasing land pixels to allow Land 0 check for mask.png to function
FillRoundInLand(X, Y, Radius, 0);
inc(Radius, 4);
@@ -265,9 +249,7 @@
for ty:= max(y - Radius, 0) to min(y + Radius, LAND_HEIGHT) do
for tx:= max(0, ar^[i].Left - Radius) to min(LAND_WIDTH, ar^[i].Right + Radius) do
if Land[ty, tx] = COLOR_LAND then
- LandPixels[ty, tx]:= LandBackPixel(tx, ty)
- else if Land[ty, tx] = COLOR_OBJECT then
- LandPixels[ty, tx]:= 0;
+ LandPixels[ty, tx]:= 0;
inc(y, dY)
end;
@@ -278,7 +260,7 @@
begin
for ty:= max(y - Radius, 0) to min(y + Radius, LAND_HEIGHT) do
for tx:= max(0, ar^[i].Left - Radius) to min(LAND_WIDTH, ar^[i].Right + Radius) do
- if (Land[ty, tx] = COLOR_LAND) or (Land[ty, tx] = COLOR_OBJECT) then
+ if Land[ty, tx] = COLOR_LAND then
begin
LandPixels[ty, tx]:= cExplosionBorderColor;
LandDirty[trunc((y + dy)/32), trunc(i/32)]:= 1;
@@ -330,13 +312,11 @@
tx:= hwRound(X);
ty:= hwRound(Y);
if ((ty and LAND_HEIGHT_MASK) = 0) and ((tx and LAND_WIDTH_MASK) = 0) then
- begin
- if Land[ty, tx] = COLOR_LAND then
- LandPixels[ty, tx]:= LandBackPixel(tx, ty)
- else if Land[ty, tx] = COLOR_OBJECT then
- LandPixels[ty, tx]:= 0;
- Land[ty, tx]:= 0;
- end
+ if Land[ty, tx] = COLOR_LAND then
+ begin
+ Land[ty, tx]:= 0;
+ LandPixels[ty, tx]:= 0;
+ end
end;
for t:= 0 to 7 do
{$INCLUDE "tunsetborder.inc"}
@@ -418,7 +398,7 @@
for x:= 0 to Pred(w) do
if PLongword(@(p^[x * 4]))^ <> 0 then
begin
- Land[cpY + y, cpX + x]:= COLOR_OBJECT;
+ Land[cpY + y, cpX + x]:= COLOR_LAND;
LandPixels[cpY + y, cpX + x]:= PLongword(@(p^[x * 4]))^
end;
p:= @(p^[Image^.pitch]);
@@ -454,10 +434,7 @@
if c < 4 then // 0-3 neighbours
begin
- if Land[Y, X] = COLOR_LAND then
- LandPixels[Y, X]:= LandBackPixel(X, Y)
- else if Land[Y, X] = COLOR_OBJECT then
- LandPixels[Y, X]:= 0;
+ LandPixels[Y, X]:= 0;
Land[Y, X]:= 0;
exit(true);
end;
--- a/hedgewars/uLandObjects.pas Thu Nov 05 20:47:42 2009 +0000
+++ b/hedgewars/uLandObjects.pas Thu Nov 05 20:48:13 2009 +0000
@@ -90,7 +90,7 @@
if LandPixels[cpY + y, cpX + x] = 0 then
begin
LandPixels[cpY + y, cpX + x]:= p^[x];
- if (p^[x] and AMask) <> 0 then Land[cpY + y, cpX + x]:= COLOR_OBJECT;
+ if (p^[x] and AMask) <> 0 then Land[cpY + y, cpX + x]:= COLOR_LAND;
end;
p:= @(p^[Image^.pitch shr 2]);
end;
--- a/hedgewars/uSound.pas Thu Nov 05 20:47:42 2009 +0000
+++ b/hedgewars/uSound.pas Thu Nov 05 20:48:13 2009 +0000
@@ -31,7 +31,6 @@
procedure ReleaseSound;
procedure SoundLoad;
procedure PlaySound(snd: TSound; infinite: boolean; voicepack: PVoicepack);
-procedure LoopSound(snd: TSound; voicepack: PVoicepack);
procedure PlayMusic;
procedure PauseMusic;
procedure ResumeMusic;
@@ -67,7 +66,6 @@
end;
procedure InitSound;
-var i: TSound;
begin
if not isSoundEnabled then exit;
WriteToConsole('Init sound...');
@@ -79,9 +77,6 @@
Mix_AllocateChannels(Succ(chanTPU));
if isMusicEnabled then Mix_VolumeMusic(50);
-for i:= Low(TSound) to High(TSound) do
- lastChan[i]:= -1;
-
Volume:= 0;
ChangeVolume(cInitVolume)
end;
@@ -110,7 +105,7 @@
defVoicepack:= AskForVoicepack('Default');
for i:= Low(TSound) to High(TSound) do
- if (Soundz[i].Path <> ptVoices) and (Soundz[i].FileName <> '') then
+ if Soundz[i].Path <> ptVoices then
begin
s:= Pathz[Soundz[i].Path] + '/' + Soundz[i].FileName;
WriteToConsole(msgLoading + s + ' ');
@@ -122,7 +117,7 @@
for t:= 0 to cMaxTeams do
if voicepacks[t].name <> '' then
for i:= Low(TSound) to High(TSound) do
- if (Soundz[i].Path = ptVoices) and (Soundz[i].FileName <> '') then
+ if Soundz[i].Path = ptVoices then
begin
s:= Pathz[Soundz[i].Path] + '/' + voicepacks[t].name + '/' + Soundz[i].FileName;
WriteToConsole(msgLoading + s + ' ');
@@ -149,25 +144,11 @@
lastChan[snd]:= Mix_PlayChannelTimed(-1, defVoicepack^.chunks[snd], loops, -1)
end;
-procedure LoopSound(snd: TSound; voicepack: PVoicepack);
-begin
-if (not isSoundEnabled) or fastUntilLag then exit;
-if lastChan[snd] <> -1 then exit;
-
-if (voicepack <> nil) and (voicepack^.chunks[snd] <> nil) then
- lastChan[snd]:= Mix_PlayChannelTimed(-1, voicepack^.chunks[snd], -1, -1)
-else
- lastChan[snd]:= Mix_PlayChannelTimed(-1, defVoicepack^.chunks[snd], -1, -1)
-end;
-
procedure StopSound(snd: TSound);
begin
if not isSoundEnabled then exit;
-if (lastChan[snd] <> -1) and (Mix_Playing(lastChan[snd]) <> 0) then
- begin
- Mix_HaltChannel(lastChan[snd]);
- lastChan[snd]:= -1;
- end;
+if Mix_Playing(lastChan[snd]) <> 0 then
+ Mix_HaltChannel(lastChan[snd])
end;
procedure PlayMusic;
--- a/hedgewars/uStore.pas Thu Nov 05 20:47:42 2009 +0000
+++ b/hedgewars/uStore.pas Thu Nov 05 20:48:13 2009 +0000
@@ -1100,7 +1100,20 @@
{$IFNDEF IPHONEOS}
-//SupportNPOTT:= glLoadExtension('GL_ARB_texture_non_power_of_two');
+// since ATI seems to be unable to provide proper texture filtering/quality,
+// do not even try to load the extension on ATI cards
+
+{$IFDEF DARWIN}
+if true then
+{$ELSE}
+if cGPUVendor <> gvATI then
+{$ENDIF}
+ SupportNPOTT:= glLoadExtension('GL_ARB_texture_non_power_of_two')
+{$IFDEF DEBUGFILE}
+else
+ AddFileLog('OpenGL: Skipped extension GL_ARB_texture_non_power_of_two due to ATI card')
+{$ENDIF}
+; // do not touch this line! :)
{$ENDIF}
// set view port to whole window