[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src clone/ccl_player.c clone/groups.c...
From: |
Nehal Mistry |
Subject: |
[Stratagus-CVS] stratagus/src clone/ccl_player.c clone/groups.c... |
Date: |
Fri, 07 Nov 2003 20:08:09 -0500 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: Nehal Mistry <address@hidden> 03/11/07 20:08:09
Modified files:
src/clone : ccl_player.c groups.c selection.c
src/include : unit.h
Log message:
merge NumUnitsPerGroup into MaxSelectable
Patches:
Index: stratagus/src/clone/ccl_player.c
diff -u stratagus/src/clone/ccl_player.c:1.42
stratagus/src/clone/ccl_player.c:1.43
--- stratagus/src/clone/ccl_player.c:1.42 Sun Nov 2 21:19:33 2003
+++ stratagus/src/clone/ccl_player.c Fri Nov 7 20:08:08 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ccl_player.c,v 1.42 2003/11/03 02:19:33 nehalmistry Exp $
+// $Id: ccl_player.c,v 1.43 2003/11/08 01:08:08 nehalmistry Exp $
//@{
@@ -350,17 +350,6 @@
}
/**
-** Set NumUnitsPerGroup
-**
-** @param num Number of units per group.
-*/
-local SCM CclSetNumUnitsPerGroup(SCM num)
-{
- NumUnitsPerGroup = gh_scm2int(num);
- return num;
-}
-
-/**
** Set player unit limit.
**
** @param limit Unit limit.
@@ -655,8 +644,6 @@
gh_new_procedure1_0("set-this-player!", CclSetThisPlayer);
gh_new_procedure1_0("set-max-selectable!", CclSetMaxSelectable);
- gh_new_procedure1_0("set-num-units-per-group!",
- CclSetNumUnitsPerGroup);
gh_new_procedure1_0("set-all-players-food-unit-limit!",
CclSetAllPlayersFoodUnitLimit);
Index: stratagus/src/clone/groups.c
diff -u stratagus/src/clone/groups.c:1.24 stratagus/src/clone/groups.c:1.25
--- stratagus/src/clone/groups.c:1.24 Fri Nov 7 19:46:33 2003
+++ stratagus/src/clone/groups.c Fri Nov 7 20:08:08 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: groups.c,v 1.24 2003/11/08 00:46:33 nehalmistry Exp $
+// $Id: groups.c,v 1.25 2003/11/08 01:08:08 nehalmistry Exp $
//@{
@@ -55,7 +55,6 @@
} UnitGroup; /// group of units
global UnitGroup Groups[NUM_GROUPS]; /// Number of groups predefined
-global int NumUnitsPerGroup;
/*----------------------------------------------------------------------------
-- Functions
@@ -73,7 +72,7 @@
for (i = 0; i < NUM_GROUPS; ++i) {
int n;
- Groups[i].Units = malloc(NumUnitsPerGroup * sizeof(Unit*));
+ Groups[i].Units = malloc(MaxSelectable * sizeof(Unit*));
if ((n = Groups[i].NumUnits)) { // Cleanup after load
while (n--) {
@@ -96,7 +95,7 @@
char* ref;
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: groups $Id: groups.c,v 1.24 2003/11/08
00:46:33 nehalmistry Exp $\n\n");
+ CLprintf(file, ";;; MODULE: groups $Id: groups.c,v 1.25 2003/11/08
01:08:08 nehalmistry Exp $\n\n");
for (g = 0; g < NUM_GROUPS; ++g) {
CLprintf(file, "(group %d %d '(", g, Groups[g].NumUnits);
@@ -177,7 +176,7 @@
DebugCheck(num > NUM_GROUPS);
group = &Groups[num];
- for (i = 0; group->NumUnits < NumUnitsPerGroup && i < nunits; ++i) {
+ for (i = 0; group->NumUnits < MaxSelectable && i < nunits; ++i) {
group->Units[group->NumUnits++] = units[i];
units[i]->GroupId |= (1 << num);
}
@@ -192,11 +191,7 @@
*/
global void SetGroup(Unit** units, int nunits, int num)
{
- DebugCheck(num > NUM_GROUPS);
-
- if (nunits > NumUnitsPerGroup) {
- nunits = NumUnitsPerGroup;
- }
+ DebugCheck(num > NUM_GROUPS || nunits > MaxSelectable);
ClearGroup(num);
AddToGroup(units, nunits, num);
Index: stratagus/src/clone/selection.c
diff -u stratagus/src/clone/selection.c:1.56
stratagus/src/clone/selection.c:1.57
--- stratagus/src/clone/selection.c:1.56 Mon Nov 3 01:25:01 2003
+++ stratagus/src/clone/selection.c Fri Nov 7 20:08:08 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: selection.c,v 1.56 2003/11/03 06:25:01 jsalmon3 Exp $
+// $Id: selection.c,v 1.57 2003/11/08 01:08:08 nehalmistry Exp $
//@{
@@ -964,7 +964,7 @@
{
int i;
- Selected = malloc(NumUnitsPerGroup * sizeof(Unit*));
+ Selected = malloc(MaxSelectable * sizeof(Unit*));
if ((i = NumSelected)) { // Cleanup after load
while (i--) {
@@ -984,7 +984,7 @@
char* ref;
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: selection $Id: selection.c,v 1.56 2003/11/03
06:25:01 jsalmon3 Exp $\n\n");
+ CLprintf(file, ";;; MODULE: selection $Id: selection.c,v 1.57 2003/11/08
01:08:08 nehalmistry Exp $\n\n");
CLprintf(file, "(set-group-id! %d)\n", GroupId);
CLprintf(file, "(selection %d '(", NumSelected);
Index: stratagus/src/include/unit.h
diff -u stratagus/src/include/unit.h:1.230 stratagus/src/include/unit.h:1.231
--- stratagus/src/include/unit.h:1.230 Fri Nov 7 15:02:08 2003
+++ stratagus/src/include/unit.h Fri Nov 7 20:08:09 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit.h,v 1.230 2003/11/07 20:02:08 n0body Exp $
+// $Id: unit.h,v 1.231 2003/11/08 01:08:09 nehalmistry Exp $
#ifndef __UNIT_H__
#define __UNIT_H__
@@ -716,7 +716,6 @@
extern void (*DrawSelection)(VMemType, int, int, int, int);
extern int MaxSelectable; /// How many units could be selected
-extern int NumUnitsPerGroup; /// How many units could be in a group
extern Unit** Selected; /// currently selected units
extern int NumSelected; /// how many units selected
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Stratagus-CVS] stratagus/src clone/ccl_player.c clone/groups.c...,
Nehal Mistry <=