[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src/map tileset.c
From: |
Jimmy Salmon |
Subject: |
[Stratagus-CVS] stratagus/src/map tileset.c |
Date: |
Wed, 29 Oct 2003 18:37:09 -0500 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: Jimmy Salmon <address@hidden> 03/10/29 18:37:08
Modified files:
src/map : tileset.c
Log message:
Removed gap
Patches:
Index: stratagus/src/map/tileset.c
diff -u stratagus/src/map/tileset.c:1.53 stratagus/src/map/tileset.c:1.54
--- stratagus/src/map/tileset.c:1.53 Thu Oct 9 19:04:03 2003
+++ stratagus/src/map/tileset.c Wed Oct 29 18:37:08 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: tileset.c,v 1.53 2003/10/09 23:04:03 jsalmon3 Exp $
+// $Id: tileset.c,v 1.54 2003/10/29 23:37:08 jsalmon3 Exp $
//@{
@@ -91,7 +91,6 @@
int i;
int n;
int tile;
- int gap;
int tiles_per_row;
int solid;
int mixed;
@@ -137,24 +136,9 @@
//
// Calculate number of tiles in graphic tile
//
- if (TheMap.TileData->Width == 626) {
- // FIXME: allow 1 pixel gap between the tiles!!
- gap = 1;
- tiles_per_row = (TheMap.TileData->Width + 1) / (TileSizeX + 1);
- TheMap.TileCount = n =
- tiles_per_row * ((TheMap.TileData->Height + 1) / (TileSizeY + 1));
- } else if (TheMap.TileData->Width == 527) {
- // FIXME: allow 1 pixel gap between the tiles!!
- gap = 1;
- tiles_per_row = (TheMap.TileData->Width + 1) / (TileSizeX + 1);
- TheMap.TileCount = n =
- tiles_per_row * ((TheMap.TileData->Height + 1) / (TileSizeY + 1));
- } else {
- gap = 0;
- tiles_per_row = TheMap.TileData->Width / TileSizeX;
- TheMap.TileCount = n =
- tiles_per_row * (TheMap.TileData->Height / TileSizeY);
- }
+ tiles_per_row = TheMap.TileData->Width / TileSizeX;
+ TheMap.TileCount = n =
+ tiles_per_row * (TheMap.TileData->Height / TileSizeY);
DebugLevel2Fn(" %d Tiles in file %s, %d per row\n" _C_ TheMap.
TileCount _C_ TheMap.Tileset->ImageFile _C_ tiles_per_row);
@@ -178,16 +162,14 @@
// Convert the graphic data into faster format
//
for (tile = 0; tile < n; ++tile) {
- unsigned char *s;
- unsigned char *d;
+ unsigned char* s;
+ unsigned char* d;
s = (char *)TheMap.TileData->Frames +
- (tile % tiles_per_row) * (TileSizeX + gap) +
- (tile / tiles_per_row) * (TileSizeY + gap) * TheMap.TileData->Width;
+ (tile % tiles_per_row) * TileSizeX +
+ (tile / tiles_per_row) * TileSizeY * TheMap.TileData->Width;
d = TheMap.Tiles[tile];
- if (d != data + tile * TileSizeX * TileSizeY) {
- abort();
- }
+ DebugCheck(d != data + tile * TileSizeX * TileSizeY);
for (i = 0; i < TileSizeY; ++i) {
memcpy(d, s, TileSizeX * sizeof(unsigned char));
d += TileSizeX;
@@ -740,7 +722,7 @@
char** sp;
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: tileset $Id: tileset.c,v 1.53 2003/10/09
23:04:03 jsalmon3 Exp $\n\n");
+ CLprintf(file, ";;; MODULE: tileset $Id: tileset.c,v 1.54 2003/10/29
23:37:08 jsalmon3 Exp $\n\n");
// Original number to internal tileset name
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Stratagus-CVS] stratagus/src/map tileset.c,
Jimmy Salmon <=