[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src missile/missile.c ui/botpanel.c u...
From: |
Jimmy Salmon |
Subject: |
[Stratagus-CVS] stratagus/src missile/missile.c ui/botpanel.c u... |
Date: |
Fri, 17 Oct 2003 13:02:21 -0400 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: Jimmy Salmon <address@hidden> 03/10/17 13:02:21
Modified files:
src/missile : missile.c
src/ui : botpanel.c
src/unit : ccl_unittype.c
Log message:
More cleanup
Patches:
Index: stratagus/src/missile/missile.c
diff -u stratagus/src/missile/missile.c:1.91
stratagus/src/missile/missile.c:1.92
--- stratagus/src/missile/missile.c:1.91 Mon Oct 13 07:21:08 2003
+++ stratagus/src/missile/missile.c Fri Oct 17 13:02:19 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: missile.c,v 1.91 2003/10/13 11:21:08 n0body Exp $
+// $Id: missile.c,v 1.92 2003/10/17 17:02:19 jsalmon3 Exp $
//@{
@@ -114,7 +114,7 @@
local Missile* GlobalMissiles[MAX_MISSILES]; /// all global missiles on map
local int NumGlobalMissiles; /// currently used missiles
-local Missile* LocalMissiles[MAX_MISSILES*8]; /// all local missiles on map
+local Missile* LocalMissiles[MAX_MISSILES * 8]; /// all local missiles
on map
local int NumLocalMissiles; /// currently used missiles
#ifdef DOXYGEN // no real code, only for document
@@ -222,7 +222,7 @@
// Rehash.
//
for (i = 0; i < NumMissileTypes; ++i) {
- *(MissileType**)hash_add(MissileTypeHash,MissileTypes[i].Ident) =
&MissileTypes[i];
+ *(MissileType**)hash_add(MissileTypeHash, MissileTypes[i].Ident) =
&MissileTypes[i];
}
mtype->CanHitOwner = 0; // defaults
@@ -326,7 +326,7 @@
**
** @return created missile.
*/
-global Missile* MakeMissile(MissileType* mtype,int sx,int sy,int dx,int dy)
+global Missile* MakeMissile(MissileType* mtype, int sx, int sy, int dx, int dy)
{
Missile* missile;
@@ -801,7 +801,7 @@
nextdir = 256 / missile->Type->NumDirections;
dir = ((DirectionToHeading(dx, dy) + nextdir / 2) & 0xFF) / nextdir;
- if (dir <= LookingS / nextdir ) { // north->east->south
+ if (dir <= LookingS / nextdir) { // north->east->south
missile->SpriteFrame += dir;
} else {
missile->SpriteFrame += 256 / nextdir - dir;
@@ -1033,7 +1033,7 @@
// Move missile
//
if (missile->Dy == 0) { // horizontal line
- for (i = 0; i<missile->Type->Speed; ++i) {
+ for (i = 0; i < missile->Type->Speed; ++i) {
if (missile->X == missile->DX) {
return 1;
}
@@ -1172,7 +1172,7 @@
x /= TileSizeX;
y /= TileSizeY;
- if (x < 0 || y < 0 || x >= TheMap.Width || y >= TheMap.Height ) {
+ if (x < 0 || y < 0 || x >= TheMap.Width || y >= TheMap.Height) {
// FIXME: this should handled by caller?
DebugLevel0Fn("Missile gone outside of map!\n");
return; // outside the map.
@@ -1217,7 +1217,7 @@
// We are attacking the nearest field of the unit
if (x < goal->X || y < goal->Y ||
x >= goal->X + goal->Type->TileWidth ||
- y >= goal->Y + goal->Type->TileHeight ) {
+ y >= goal->Y + goal->Type->TileHeight) {
MissileHitsGoal(missile, goal, 2);
} else {
MissileHitsGoal(missile, goal, 1);
@@ -1458,8 +1458,8 @@
char** sp;
int i;
- CLprintf(file,"\n;;; -----------------------------------------\n");
- CLprintf(file,";;; MODULE: missile-types $Id: missile.c,v 1.91 2003/10/13
11:21:08 n0body Exp $\n\n");
+ CLprintf(file, "\n;;; -----------------------------------------\n");
+ CLprintf(file, ";;; MODULE: missile-types $Id: missile.c,v 1.92 2003/10/17
17:02:19 jsalmon3 Exp $\n\n");
//
// Original number to internal missile-type name.
@@ -1483,7 +1483,7 @@
}
CLprintf(file, " 'size '(%d %d)", mtype->Width, mtype->Height);
if (mtype->Sprite) {
- CLprintf(file," 'frames %d", mtype->SpriteFrames);
+ CLprintf(file, " 'frames %d", mtype->SpriteFrames);
}
CLprintf(file, "\n 'num-directions %d", mtype->NumDirections);
CLprintf(file, "\n ");
@@ -1524,8 +1524,8 @@
CLprintf(file, "(missile 'type '%s",missile->Type->Ident);
CLprintf(file, " 'pos '(%d %d) 'goal '(%d %d)",
missile->X, missile->Y, missile->DX, missile->DY);
- CLprintf(file," '%s", missile->Local ? "local" : "global");
- CLprintf(file,"\n 'frame %d 'state %d 'wait %d 'delay %d\n ",
+ CLprintf(file, " '%s", missile->Local ? "local" : "global");
+ CLprintf(file, "\n 'frame %d 'state %d 'wait %d 'delay %d\n ",
missile->SpriteFrame, missile->State, missile->Wait, missile->Delay);
if (missile->SourceUnit) {
CLprintf(file, " 'source '%s", s1 = UnitReference(missile->SourceUnit));
@@ -1553,8 +1553,8 @@
{
Missile* const* missiles;
- CLprintf(file,"\n;;; -----------------------------------------\n");
- CLprintf(file,";;; MODULE: missiles $Id: missile.c,v 1.91 2003/10/13
11:21:08 n0body Exp $\n\n");
+ CLprintf(file, "\n;;; -----------------------------------------\n");
+ CLprintf(file, ";;; MODULE: missiles $Id: missile.c,v 1.92 2003/10/17
17:02:19 jsalmon3 Exp $\n\n");
for (missiles = GlobalMissiles; *missiles; ++missiles) {
SaveMissile(*missiles, file);
@@ -1780,6 +1780,11 @@
}
}
+/**
+** FIXME: docu
+**
+** @param missile pointer to missile
+*/
void MissileActionCycleOnce(Missile* missile)
{
int neg;
@@ -1815,7 +1820,7 @@
/*
** Missile flies from x,y to x1,y1 than shows hit animation.
-**
+**
** @param missile pointer to missile
*/
void MissileActionPointToPointWithHit(Missile* missile)
@@ -1865,6 +1870,11 @@
}
}
+/**
+** FIXME: docu
+**
+** @param missile pointer to missile
+*/
void MissileActionHit(Missile* missile)
{
if (PointToPointMissile(missile)) {
@@ -1874,7 +1884,7 @@
}
/*
-** Missile flies from x,y to x1,y1 using a parabolic path
+** Missile flies from x,y to x1,y1 using a parabolic path
**
** @param missile pointer to missile
*/
@@ -1951,7 +1961,7 @@
&& missile->TargetUnit->HP) {
if (missile->TargetUnit->HP <= 50) {// 50 should be parametrable
source->Player->Score += missile->TargetUnit->Type->Points;
- if( missile->TargetUnit->Type->Building) {
+ if (missile->TargetUnit->Type->Building) {
source->Player->TotalRazings++;
} else {
source->Player->TotalKills++;
@@ -2003,9 +2013,9 @@
if (IsEnemy(source->Player, table[i]) &&
table[i]->Type->Organic != 0) {
// disperse damage between them
//NOTE: 1 is the minimal damage
- if (table[i]->HP <= 50 / ec ) {
+ if (table[i]->HP <= 50 / ec) {
source->Player->Score += table[i]->Type->Points;
- if( table[i]->Type->Building ) {
+ if (table[i]->Type->Building) {
source->Player->TotalRazings++;
} else {
source->Player->TotalKills++;
@@ -2189,13 +2199,13 @@
n = SelectUnits(x - 1, y - 1, x + 1, y + 1, table);
DebugLevel3Fn("Damage on %d,%d-%d,%d = %d\n" _C_ x-1 _C_ y-1 _C_ x+1
_C_ y+1 _C_ n);
for (i = 0; i < n; ++i) {
- if( (table[i]->X != x || table[i]->Y != y) && table[i]->HP) {
+ if ((table[i]->X != x || table[i]->Y != y) && table[i]->HP) {
HitUnit(missile->SourceUnit,table[i], WHIRLWIND_DAMAGE2); //
should be in missile
}
}
}
- DebugLevel3Fn( "Whirlwind: %d, %d, TTL: %d\n" _C_
- missile->X _C_ missile->Y _C_ missile->TTL );
+ DebugLevel3Fn("Whirlwind: %d, %d, TTL: %d\n" _C_
+ missile->X _C_ missile->Y _C_ missile->TTL);
//
// Changes direction every 3 seconds (approx.)
@@ -2212,8 +2222,8 @@
missile->DX = nx * TileSizeX + TileSizeX / 2;
missile->DY = ny * TileSizeY + TileSizeY / 2;
missile->State=0;
- DebugLevel3Fn( "Whirlwind new direction: %d, %d, TTL: %d\n" _C_
- missile->X _C_ missile->Y _C_ missile->TTL );
+ DebugLevel3Fn("Whirlwind new direction: %d, %d, TTL: %d\n" _C_
+ missile->X _C_ missile->Y _C_ missile->TTL);
}
}
Index: stratagus/src/ui/botpanel.c
diff -u stratagus/src/ui/botpanel.c:1.91 stratagus/src/ui/botpanel.c:1.92
--- stratagus/src/ui/botpanel.c:1.91 Tue Oct 7 08:03:40 2003
+++ stratagus/src/ui/botpanel.c Fri Oct 17 13:02:20 2003
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: botpanel.c,v 1.91 2003/10/07 12:03:40 martinxyz Exp $
+// $Id: botpanel.c,v 1.92 2003/10/17 17:02:20 jsalmon3 Exp $
//@{
@@ -103,7 +103,7 @@
char* cp;
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: buttons $Id: botpanel.c,v 1.91 2003/10/07
12:03:40 martinxyz Exp $\n\n");
+ CLprintf(file, ";;; MODULE: buttons $Id: botpanel.c,v 1.92 2003/10/17
17:02:20 jsalmon3 Exp $\n\n");
for (i = 0; i < NumUnitButtons; ++i) {
CLprintf(file, "(define-button 'pos %d 'level %d 'icon '%s\n",
@@ -459,7 +459,7 @@
switch (buttons[i].Action) {
case ButtonMove:
for (j = 0; j < NumSelected; ++j) {
- if (Selected[j]->Orders[0].Action!=UnitActionMove &&
+ if (Selected[j]->Orders[0].Action != UnitActionMove
&&
Selected[j]->Orders[0].Action !=
UnitActionBuild &&
Selected[j]->Orders[0].Action !=
UnitActionFollow) {
break;
@@ -524,9 +524,7 @@
stats->Costs[WoodCost]);
SetCosts(0, UnitTypes[v]->Demand, stats->Costs);
-
break;
- //case ButtonUpgrade:
case ButtonResearch:
SetCosts(0, 0, Upgrades[v].Costs);
break;
@@ -845,8 +843,10 @@
MustRedraw |= RedrawButtonPanel;
}
-/*
+/**
** Handle bottom button clicked.
+**
+** @param button Button that was clicked.
*/
global void DoButtonButtonClicked(int button)
{
Index: stratagus/src/unit/ccl_unittype.c
diff -u stratagus/src/unit/ccl_unittype.c:1.95
stratagus/src/unit/ccl_unittype.c:1.96
--- stratagus/src/unit/ccl_unittype.c:1.95 Thu Oct 9 16:04:30 2003
+++ stratagus/src/unit/ccl_unittype.c Fri Oct 17 13:02:21 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ccl_unittype.c,v 1.95 2003/10/09 20:04:30 jsalmon3 Exp $
+// $Id: ccl_unittype.c,v 1.96 2003/10/17 17:02:21 jsalmon3 Exp $
//@{
@@ -955,7 +955,7 @@
i = gh_scm2int(gh_vector_ref(gh_car(value), gh_int2scm(3)));
t->Frame = i - frame;
frame = i;
- if (t->Flags&AnimationRestart) {
+ if (t->Flags & AnimationRestart) {
frame = 0;
}
++t;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Stratagus-CVS] stratagus/src missile/missile.c ui/botpanel.c u...,
Jimmy Salmon <=