[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus ./configure.in src/include/unit.h src...
From: |
address@hidden |
Subject: |
[Stratagus-CVS] stratagus ./configure.in src/include/unit.h src... |
Date: |
7 Feb 2004 01:02:19 +1100 |
CVSROOT: /home/strat
Module name: stratagus
Changes by: <address@hidden> 04/02/07 01:02:19
Modified files:
. : configure.in
src/include : unit.h
src/unit : unit.c
Log message:
--enable-profile doesn't -DDEBUG. Made IsEnemy/Allied/SharedVision a
macro
Patches:
Index: stratagus/configure.in
diff -u stratagus/configure.in:1.38 stratagus/configure.in:1.39
--- stratagus/configure.in:1.38 Fri Jan 16 05:02:50 2004
+++ stratagus/configure.in Sat Feb 7 01:02:16 2004
@@ -79,7 +79,10 @@
if test "$enable_debug" != "yes" -a "$enable_profile" != "yes"; then
DEBUG_CFLAGS="-O2 -pipe -fsigned-char -fomit-frame-pointer
-fexpensive-optimizations -ffast-math"
else
- DEBUG_CFLAGS="-g -O1 -fsigned-char -Wsign-compare -Wall -Werror -DDEBUG"
+ DEBUG_CFLAGS="-g -O1 -fsigned-char -Wsign-compare"
+ if test "$enable_debug" == "yes"; then
+ DEBUG_CFLAGS="$DEBUG_CFLAGS -Werror -Wall -DDEBUG"
+ fi
fi
AC_SUBST(DEBUG_CFLAGS)
Index: stratagus/src/include/unit.h
diff -u stratagus/src/include/unit.h:1.255 stratagus/src/include/unit.h:1.256
--- stratagus/src/include/unit.h:1.255 Sun Feb 1 17:03:33 2004
+++ stratagus/src/include/unit.h Sat Feb 7 01:02:17 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit.h,v 1.255 2004/02/01 06:03:33 wizzard Exp $
+// $Id: unit.h,v 1.256 2004/02/06 14:02:17 nobody_ Exp $
#ifndef __UNIT_H__
#define __UNIT_H__
@@ -879,11 +879,15 @@
extern int ViewPointDistanceToUnit(const Unit* dest);
/// Return true, if unit is an enemy of the player
-extern int IsEnemy(const Player* player,const Unit* dest);
- /// Return true, if unit is allied with the player
-extern int IsAllied(const Player* player,const Unit* dest);
+#define IsEnemy(player, dest) \
+ ((player)->Enemy & (1 << (dest)->Player->Player))
+ /// Return true, if unit is allied of the player
+#define IsAllied(player, dest) \
+ ((player)->Allied & (1 << (dest)->Player->Player))
/// Return true, if unit is shared vision with the player
-extern int IsSharedVision(const Player* player,const Unit* dest);
+#define IsSharedVision(player, dest) \
+ (( (player)->SharedVision & (1 << (dest)->Player->Player) ) && \
+ ( (dest)->Player->SharedVision & (1 << (player)->Player)))
/// Can this unit-type attack the other (destination)
extern int CanTarget(const UnitType* type,const UnitType* dest);
Index: stratagus/src/unit/unit.c
diff -u stratagus/src/unit/unit.c:1.388 stratagus/src/unit/unit.c:1.389
--- stratagus/src/unit/unit.c:1.388 Sun Feb 1 17:03:34 2004
+++ stratagus/src/unit/unit.c Sat Feb 7 01:02:18 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit.c,v 1.388 2004/02/01 06:03:34 wizzard Exp $
+// $Id: unit.c,v 1.389 2004/02/06 14:02:18 nobody_ Exp $
//@{
@@ -3293,47 +3293,6 @@
}
/**
-** Check if unit is an enemy.
-**
-** @param player The source player.
-** @param dest The destination unit.
-**
-** @return Returns true, if the
destination unit is an enemy.
-*/
-global int IsEnemy(const Player* player, const Unit* dest)
-{
- return player->Enemy & (1 << dest->Player->Player);
-}
-
-/**
-** Check if unit is allied.
-**
-** @param player The source player.
-** @param dest The destination unit.
-**
-** @return Returns true, if the
destination unit is allied.
-*/
-global int IsAllied(const Player* player, const Unit* dest)
-{
- return player->Allied & (1 << dest->Player->Player);
-}
-
-/**
-** Check if unit is shared vision.
-**
-** @param player The source player.
-** @param dest The destination unit.
-**
-** @return Returns true, if the
destination unit is shared
-** vision.
-*/
-global int IsSharedVision(const Player* player, const Unit* dest)
-{
- return (player->SharedVision & (1 << dest->Player->Player)) &&
- (dest->Player->SharedVision & (1 << player->Player));
-}
-
-/**
** Can the source unit attack the destination unit.
**
** @param source Unit type pointer of the attacker.
@@ -3778,7 +3737,7 @@
int j;
CLprintf(file, "\n--- -----------------------------------------\n");
- CLprintf(file, "--- MODULE: units $Id: unit.c,v 1.388 2004/02/01
06:03:34 wizzard Exp $\n\n");
+ CLprintf(file, "--- MODULE: units $Id: unit.c,v 1.389 2004/02/06
14:02:18 nobody_ Exp $\n\n");
#if 0
//
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Stratagus-CVS] stratagus ./configure.in src/include/unit.h src...,
address@hidden <=