[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src/unit ccl_unittype.c unit_draw.c u...
From: |
address@hidden |
Subject: |
[Stratagus-CVS] stratagus/src/unit ccl_unittype.c unit_draw.c u... |
Date: |
11 Jan 2004 07:54:44 +1100 |
CVSROOT: /home/strat
Module name: stratagus
Changes by: <address@hidden> 04/01/11 07:54:44
Modified files:
src/unit : ccl_unittype.c unit_draw.c unittype.c
Log message:
^M
Patches:
Index: stratagus/src/unit/ccl_unittype.c
diff -u stratagus/src/unit/ccl_unittype.c:1.128
stratagus/src/unit/ccl_unittype.c:1.129
--- stratagus/src/unit/ccl_unittype.c:1.128 Sun Jan 11 07:54:01 2004
+++ stratagus/src/unit/ccl_unittype.c Sun Jan 11 07:54:42 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ccl_unittype.c,v 1.128 2004/01/10 20:54:01 jsalmon3 Exp $
+// $Id: ccl_unittype.c,v 1.129 2004/01/10 20:54:42 jsalmon3 Exp $
//@{
@@ -141,7 +141,7 @@
type->CanTargetFlag = realloc(type->CanTargetFlag, NumberBoolFlag *
sizeof (*type->CanTargetFlag));
memset(type->CanTargetFlag, 0, NumberBoolFlag * sizeof
(*type->CanTargetFlag));
- type->NumDirections = 8;
+ type->NumDirections = 8;
type->Flip = 1;
//
@@ -256,8 +256,8 @@
lua_rawgeti(l, -1, 2);
type->Height = LuaToNumber(l, -1);
lua_pop(l, 1);
- } else if (!strcmp(value, "Flip")) {
- type->Flip = LuaToBoolean(l, -1);
+ } else if (!strcmp(value, "Flip")) {
+ type->Flip = LuaToBoolean(l, -1);
} else if (!strcmp(value, "Animations")) {
type->Animations = AnimationsByIdent(LuaToString(l,
-1));
} else if (!strcmp(value, "Icon")) {
Index: stratagus/src/unit/unit_draw.c
diff -u stratagus/src/unit/unit_draw.c:1.201
stratagus/src/unit/unit_draw.c:1.202
--- stratagus/src/unit/unit_draw.c:1.201 Sun Jan 11 07:54:01 2004
+++ stratagus/src/unit/unit_draw.c Sun Jan 11 07:54:42 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit_draw.c,v 1.201 2004/01/10 20:54:01 jsalmon3 Exp $
+// $Id: unit_draw.c,v 1.202 2004/01/10 20:54:42 jsalmon3 Exp $
//@{
@@ -744,7 +744,7 @@
{
#if 0
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: decorations $Id: unit_draw.c,v 1.201
2004/01/10 20:54:01 jsalmon3 Exp $\n\n");
+ CLprintf(file, ";;; MODULE: decorations $Id: unit_draw.c,v 1.202
2004/01/10 20:54:42 jsalmon3 Exp $\n\n");
CLprintf(file, "(mana-sprite \"%s\" %d %d %d %d)\n",
ManaSprite.File, ManaSprite.HotX, ManaSprite.HotY,
@@ -1313,23 +1313,23 @@
y -= (type->ShadowHeight -
type->TileHeight * TileSizeY) / 2;
x += type->ShadowOffsetX;
- y += type->ShadowOffsetY;
+ y += type->ShadowOffsetY;
if (type->Flip) {
if (frame < 0) {
VideoDrawShadowClipX(type->ShadowSprite, -frame, x, y);
} else {
VideoDrawShadowClip(type->ShadowSprite,
frame, x, y);
- }
- } else {
- int row;
-
- row = type->NumDirections / 2 + 1;
- if (frame < 0) {
- frame = (-frame / row) *
type->NumDirections + type->NumDirections - -frame % row;
- } else {
- frame = (frame / row) *
type->NumDirections + frame % row;
- }
- VideoDrawShadowClip(type->ShadowSprite, frame,
x, y);
+ }
+ } else {
+ int row;
+
+ row = type->NumDirections / 2 + 1;
+ if (frame < 0) {
+ frame = (-frame / row) *
type->NumDirections + type->NumDirections - -frame % row;
+ } else {
+ frame = (frame / row) *
type->NumDirections + frame % row;
+ }
+ VideoDrawShadowClip(type->ShadowSprite, frame,
x, y);
}
}
return;
@@ -1347,23 +1347,23 @@
type->TileHeight * TileSizeY) / 2;
x += type->ShadowOffsetX;
y += type->ShadowOffsetY;
-
+
if (type->Flip) {
if (frame < 0) {
VideoDrawShadowClipX(type->ShadowSprite,
-frame, x, y);
} else {
VideoDrawShadowClip(type->ShadowSprite, frame,
x, y);
- }
- } else {
- int row;
-
- row = type->NumDirections / 2 + 1;
- if (frame < 0) {
- frame = (-frame / row) * type->NumDirections +
type->NumDirections - -frame % row;
- } else {
- frame = (frame / row) * type->NumDirections +
frame % row;
- }
- VideoDrawShadowClip(type->ShadowSprite, frame, x, y);
+ }
+ } else {
+ int row;
+
+ row = type->NumDirections / 2 + 1;
+ if (frame < 0) {
+ frame = (-frame / row) * type->NumDirections +
type->NumDirections - -frame % row;
+ } else {
+ frame = (frame / row) * type->NumDirections +
frame % row;
+ }
+ VideoDrawShadowClip(type->ShadowSprite, frame, x, y);
}
return;
}
@@ -1855,12 +1855,12 @@
{
if (!type->PlayerColorSprite[player] ||
!type->PlayerColorSprite[player]->TextureNames[
- type->Flip ?
- (frame < 0 ? -frame : frame) :
- (frame < 0 ?
- (-frame / (type->NumDirections
/ 2 + 1)) * type->NumDirections +
- type->NumDirections -
-frame % (type->NumDirections / 2 + 1) :
- (frame / (type->NumDirections /
2 + 1)) * type->NumDirections +
+ type->Flip ?
+ (frame < 0 ? -frame : frame) :
+ (frame < 0 ?
+ (-frame / (type->NumDirections
/ 2 + 1)) * type->NumDirections +
+ type->NumDirections -
-frame % (type->NumDirections / 2 + 1) :
+ (frame / (type->NumDirections /
2 + 1)) * type->NumDirections +
frame %
(type->NumDirections / 2 + 1))]) {
unsigned char mapping[4 * 2];
int i;
@@ -1890,17 +1890,17 @@
VideoDrawClipX(type->PlayerColorSprite[player], -frame,
x, y);
} else {
VideoDrawClip(type->PlayerColorSprite[player], frame,
x, y);
- }
- } else {
- int row;
-
- row = type->NumDirections / 2 + 1;
- if (frame < 0) {
- frame = (-frame / row) * type->NumDirections +
type->NumDirections - -frame % row;
- } else {
- frame = (frame / row) * type->NumDirections + frame %
row;
- }
- VideoDrawClip(type->PlayerColorSprite[player], frame, x, y);
+ }
+ } else {
+ int row;
+
+ row = type->NumDirections / 2 + 1;
+ if (frame < 0) {
+ frame = (-frame / row) * type->NumDirections +
type->NumDirections - -frame % row;
+ } else {
+ frame = (frame / row) * type->NumDirections + frame %
row;
+ }
+ VideoDrawClip(type->PlayerColorSprite[player], frame, x, y);
}
}
#endif
@@ -1923,7 +1923,7 @@
x -= (unit->Type->Construction->Width -
unit->Type->TileWidth * TileSizeX) / 2;
y -= (unit->Type->Construction->Height -
unit->Type->TileHeight * TileSizeY )/ 2;
// x += type->ShadowOffsetX;
-// y += type->ShadowOffsetY;
+// y += type->ShadowOffsetY;
if (unit->Type->Flip) {
if (frame < 0) {
VideoDrawShadowClipX(unit->Type->Construction->ShadowSprite,
@@ -1931,18 +1931,18 @@
} else {
VideoDrawShadowClip(unit->Type->Construction->ShadowSprite,
frame, x, y);
- }
- } else {
- int row;
-
- row = unit->Type->NumDirections / 2 + 1;
- if (frame < 0) {
- frame = (-frame / row) *
unit->Type->NumDirections + unit->Type->NumDirections - -frame % row;
- } else {
- frame = (frame / row) *
unit->Type->NumDirections + frame % row;
- }
-
VideoDrawShadowClip(unit->Type->Construction->ShadowSprite, frame,
- x, y);
+ }
+ } else {
+ int row;
+
+ row = unit->Type->NumDirections / 2 + 1;
+ if (frame < 0) {
+ frame = (-frame / row) *
unit->Type->NumDirections + unit->Type->NumDirections - -frame % row;
+ } else {
+ frame = (frame / row) *
unit->Type->NumDirections + frame % row;
+ }
+
VideoDrawShadowClip(unit->Type->Construction->ShadowSprite, frame,
+ x, y);
}
}
} else {
@@ -1950,23 +1950,23 @@
x -= (unit->Type->ShadowWidth - unit->Type->TileWidth *
TileSizeX) / 2;
y -= (unit->Type->ShadowHeight - unit->Type->TileHeight
* TileSizeY) / 2;
x += unit->Type->ShadowOffsetX;
- y += unit->Type->ShadowOffsetY;
+ y += unit->Type->ShadowOffsetY;
if (unit->Type->Flip) {
if (frame < 0) {
VideoDrawShadowClipX(unit->Type->ShadowSprite, -frame, x, y);
} else {
VideoDrawShadowClip(unit->Type->ShadowSprite, frame, x, y);
- }
- } else {
- int row;
-
- row = unit->Type->NumDirections / 2 + 1;
- if (frame < 0) {
- frame = (-frame / row) *
unit->Type->NumDirections + unit->Type->NumDirections - -frame % row;
- } else {
- frame = (frame / row) *
unit->Type->NumDirections + frame % row;
- }
- VideoDrawShadowClip(unit->Type->ShadowSprite,
frame, x, y);
+ }
+ } else {
+ int row;
+
+ row = unit->Type->NumDirections / 2 + 1;
+ if (frame < 0) {
+ frame = (-frame / row) *
unit->Type->NumDirections + unit->Type->NumDirections - -frame % row;
+ } else {
+ frame = (frame / row) *
unit->Type->NumDirections + frame % row;
+ }
+ VideoDrawShadowClip(unit->Type->ShadowSprite,
frame, x, y);
}
}
}
Index: stratagus/src/unit/unittype.c
diff -u stratagus/src/unit/unittype.c:1.135 stratagus/src/unit/unittype.c:1.136
--- stratagus/src/unit/unittype.c:1.135 Sun Jan 11 07:54:02 2004
+++ stratagus/src/unit/unittype.c Sun Jan 11 07:54:43 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unittype.c,v 1.135 2004/01/10 20:54:02 jsalmon3 Exp $
+// $Id: unittype.c,v 1.136 2004/01/10 20:54:43 jsalmon3 Exp $
//@{
@@ -1193,7 +1193,7 @@
// char** sp;
CLprintf(file, "\n--- -----------------------------------------\n");
- CLprintf(file, "--- MODULE: unittypes $Id: unittype.c,v 1.135
2004/01/10 20:54:02 jsalmon3 Exp $\n\n");
+ CLprintf(file, "--- MODULE: unittypes $Id: unittype.c,v 1.136
2004/01/10 20:54:43 jsalmon3 Exp $\n\n");
#if 0
// Original number to internal unit-type name.
@@ -1311,23 +1311,23 @@
x -= (type->Width - type->TileWidth * TileSizeX) / 2;
y -= (type->Height - type->TileHeight * TileSizeY) / 2;
- if (type->Flip) {
- if (frame < 0) {
- VideoDrawClipX(sprite, -frame, x, y);
- } else {
- VideoDrawClip(sprite, frame, x, y);
- }
- } else {
- int row;
-
- row = type->NumDirections / 2 + 1;
- if (frame < 0) {
- frame = (-frame / row) * type->NumDirections +
type->NumDirections - -frame % row;
- } else {
- frame = (frame / row) * type->NumDirections + frame %
row;
- }
- VideoDrawClip(sprite, frame, x, y);
- }
+ if (type->Flip) {
+ if (frame < 0) {
+ VideoDrawClipX(sprite, -frame, x, y);
+ } else {
+ VideoDrawClip(sprite, frame, x, y);
+ }
+ } else {
+ int row;
+
+ row = type->NumDirections / 2 + 1;
+ if (frame < 0) {
+ frame = (-frame / row) * type->NumDirections +
type->NumDirections - -frame % row;
+ } else {
+ frame = (frame / row) * type->NumDirections + frame %
row;
+ }
+ VideoDrawClip(sprite, frame, x, y);
+ }
}
/**
- [Stratagus-CVS] stratagus/src/unit ccl_unittype.c unit_draw.c u...,
address@hidden <=