[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src clone/unit_draw.c include/unittyp...
From: |
Jimmy Salmon |
Subject: |
[Stratagus-CVS] stratagus/src clone/unit_draw.c include/unittyp... |
Date: |
Tue, 21 Oct 2003 22:42:13 -0400 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: Jimmy Salmon <address@hidden> 03/10/21 22:42:13
Modified files:
src/clone : unit_draw.c
src/include : unittype.h
src/unit : ccl_unittype.c unittype.c
Log message:
Added shadow offset in X direction, changed ccl format
Patches:
Index: stratagus/src/clone/unit_draw.c
diff -u stratagus/src/clone/unit_draw.c:1.169
stratagus/src/clone/unit_draw.c:1.170
--- stratagus/src/clone/unit_draw.c:1.169 Tue Oct 21 17:33:52 2003
+++ stratagus/src/clone/unit_draw.c Tue Oct 21 22:42:12 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit_draw.c,v 1.169 2003/10/21 21:33:52 jsalmon3 Exp $
+// $Id: unit_draw.c,v 1.170 2003/10/22 02:42:12 jsalmon3 Exp $
//@{
@@ -577,7 +577,7 @@
global void SaveDecorations(CLFile* file)
{
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: decorations $Id: unit_draw.c,v 1.169
2003/10/21 21:33:52 jsalmon3 Exp $\n\n");
+ CLprintf(file, ";;; MODULE: decorations $Id: unit_draw.c,v 1.170
2003/10/22 02:42:12 jsalmon3 Exp $\n\n");
CLprintf(file, "(mana-sprite \"%s\" %d %d %d %d)\n",
ManaSprite.File, ManaSprite.HotX, ManaSprite.HotY,
@@ -1139,7 +1139,8 @@
type->TileWidth * TileSizeX) / 2;
y -= (type->Construction->ShadowHeight -
type->TileHeight * TileSizeY) / 2;
- y += type->ShadowOffset;
+ x += type->ShadowOffsetX;
+ y += type->ShadowOffsetY;
if (unit->Frame < 0) {
VideoDrawShadowClipX(type->Construction->
ShadowSprite, -unit->Frame, x, y);
@@ -1157,7 +1158,8 @@
type->TileWidth * TileSizeX) / 2;
y -= (type->ShadowHeight -
type->TileHeight * TileSizeY) / 2;
- y += type->ShadowOffset;
+ x += type->ShadowOffsetX;
+ y += type->ShadowOffsetY;
if (unit) {
if (unit->Frame < 0) {
VideoDrawShadowClipX(type->ShadowSprite, -unit->Frame, x,
y);
@@ -1185,7 +1187,8 @@
type->TileWidth * TileSizeX) / 2;
y -= (type->ShadowHeight -
type->TileHeight * TileSizeY) / 2;
- y += type->ShadowOffset;
+ x += type->ShadowOffsetX;
+ y += type->ShadowOffsetY;
if (unit) {
if (unit->Frame < 0) {
Index: stratagus/src/include/unittype.h
diff -u stratagus/src/include/unittype.h:1.118
stratagus/src/include/unittype.h:1.119
--- stratagus/src/include/unittype.h:1.118 Thu Oct 9 07:31:46 2003
+++ stratagus/src/include/unittype.h Tue Oct 21 22:42:12 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unittype.h,v 1.118 2003/10/09 11:31:46 n0body Exp $
+// $Id: unittype.h,v 1.119 2003/10/22 02:42:12 jsalmon3 Exp $
#ifndef __UNITTYPE_H__
#define __UNITTYPE_H__
@@ -671,7 +671,8 @@
int DrawLevel; /// Level to Draw Unittype at
int ShadowWidth; /// Shadow sprite width
int ShadowHeight; /// Shadow sprite height
- int ShadowOffset; /// Shadow vertical offset
+ int ShadowOffsetX; /// Shadow horizontal offset
+ int ShadowOffsetY; /// Shadow vertical offset
Animations* Animations; /// Animation scripts
Index: stratagus/src/unit/ccl_unittype.c
diff -u stratagus/src/unit/ccl_unittype.c:1.96
stratagus/src/unit/ccl_unittype.c:1.97
--- stratagus/src/unit/ccl_unittype.c:1.96 Fri Oct 17 13:02:21 2003
+++ stratagus/src/unit/ccl_unittype.c Tue Oct 21 22:42:13 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ccl_unittype.c,v 1.96 2003/10/17 17:02:21 jsalmon3 Exp $
+// $Id: ccl_unittype.c,v 1.97 2003/10/22 02:42:13 jsalmon3 Exp $
//@{
@@ -192,12 +192,13 @@
free(type->ShadowFile);
}
type->ShadowFile = gh_scm2newstr(gh_car(sublist), NULL);
- } else if (gh_eq_p(value, gh_symbol2scm("width"))) {
- type->ShadowWidth = gh_scm2int(gh_car(sublist));
+ } else if (gh_eq_p(value, gh_symbol2scm("size"))) {
+ type->ShadowWidth = gh_scm2int(gh_car(gh_car(sublist)));
+ type->ShadowHeight =
gh_scm2int(gh_car(gh_cdr(gh_car(sublist))));
} else if (gh_eq_p(value, gh_symbol2scm("height"))) {
- type->ShadowHeight = gh_scm2int(gh_car(sublist));
} else if (gh_eq_p(value, gh_symbol2scm("offset"))) {
- type->ShadowOffset = gh_scm2int(gh_car(sublist));
+ type->ShadowOffsetX = gh_scm2int(gh_car(gh_car(sublist)));
+ type->ShadowOffsetY =
gh_scm2int(gh_car(gh_cdr(gh_car(sublist))));
} else {
errl("Unsupported shadow tag", value);
}
Index: stratagus/src/unit/unittype.c
diff -u stratagus/src/unit/unittype.c:1.113 stratagus/src/unit/unittype.c:1.114
--- stratagus/src/unit/unittype.c:1.113 Tue Oct 21 18:31:32 2003
+++ stratagus/src/unit/unittype.c Tue Oct 21 22:42:13 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unittype.c,v 1.113 2003/10/21 22:31:32 jsalmon3 Exp $
+// $Id: unittype.c,v 1.114 2003/10/22 02:42:13 jsalmon3 Exp $
//@{
@@ -689,8 +689,9 @@
}
CLprintf(file, "\n 'size '(%d %d)\n", type->Width, type->Height);
if (type->ShadowFile) {
- CLprintf(file, " 'shadow '(file \"%s\" width %d height %d)\n",
- type->ShadowFile, type->ShadowWidth, type->ShadowHeight);
+ CLprintf(file, " 'shadow '(file \"%s\" size (%d %d) offset (%d %d))\n",
+ type->ShadowFile, type->ShadowWidth, type->ShadowHeight,
+ type->ShadowOffsetX, type->ShadowOffsetY);
}
//
@@ -1151,7 +1152,7 @@
char** sp;
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: unittypes $Id: unittype.c,v 1.113 2003/10/21
22:31:32 jsalmon3 Exp $\n\n");
+ CLprintf(file, ";;; MODULE: unittypes $Id: unittype.c,v 1.114 2003/10/22
02:42:13 jsalmon3 Exp $\n\n");
// Original number to internal unit-type name.
@@ -1511,18 +1512,18 @@
for (res = 0; res < MaxCosts; ++res) {
if (type->ResInfo[res]) {
if (type->ResInfo[res]->SpriteWhenLoaded) {
- free (type->ResInfo[res]->SpriteWhenLoaded);
+ free(type->ResInfo[res]->SpriteWhenLoaded);
}
if (type->ResInfo[res]->SpriteWhenEmpty) {
- free (type->ResInfo[res]->SpriteWhenEmpty);
+ free(type->ResInfo[res]->SpriteWhenEmpty);
}
if (type->ResInfo[res]->FileWhenEmpty) {
- free (type->ResInfo[res]->FileWhenEmpty);
+ free(type->ResInfo[res]->FileWhenEmpty);
}
if (type->ResInfo[res]->FileWhenLoaded) {
- free (type->ResInfo[res]->FileWhenLoaded);
+ free(type->ResInfo[res]->FileWhenLoaded);
}
- free (type->ResInfo[res]);
+ free(type->ResInfo[res]);
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Stratagus-CVS] stratagus/src clone/unit_draw.c include/unittyp...,
Jimmy Salmon <=