Changeset 419
- Timestamp:
- Feb 7, 2011, 2:40:30 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/monsterz/piece.cpp
r384 r419 49 49 } 50 50 state; 51 52 char namebuf[40]; 51 53 }; 52 54 … … 87 89 88 90 data->pos = data->cell * data->size; 91 } 92 93 char const *Piece::GetName() 94 { 95 sprintf(data->namebuf, "<piece> %ix%i @ %i,%i", 96 data->size.x, data->size.y, data->cell.x, data->cell.y); 97 return data->namebuf; 89 98 } 90 99 -
trunk/monsterz/piece.h
r384 r419 34 34 virtual ~Piece(); 35 35 36 virtual char const *GetName(); 37 36 38 void SetCell(int2 cell); 37 39 int2 GetCell() const; -
trunk/src/dict.cpp
r259 r419 78 78 if (!e) 79 79 empty = id; 80 else if (!strcasecmp(name, e->GetName())) 81 break; 80 else 81 { 82 char const *oldname = e->GetName(); 83 if (*oldname == '<') 84 { 85 while (*oldname && *oldname != '>') 86 oldname++; 87 while (*oldname == '>') 88 oldname++; 89 while (*oldname == ' ') 90 oldname++; 91 } 92 93 if (!strcasecmp(name, oldname)) 94 break; 95 } 82 96 } 83 97 -
trunk/src/sample.cpp
r280 r419 30 30 31 31 private: 32 char *name ;32 char *name, *path; 33 33 Mix_Chunk *chunk; 34 34 }; … … 41 41 : data(new SampleData()) 42 42 { 43 data->name = strdup(path); 43 data->name = (char *)malloc(9 + strlen(path) + 1); 44 data->path = data->name + 9; 45 sprintf(data->name, "<sample> %s", path); 46 44 47 data->chunk = Mix_LoadWAV(path); 45 48 if (!data->chunk) -
trunk/src/tileset.cpp
r335 r419 41 41 42 42 private: 43 char *name ;43 char *name, *path; 44 44 int *tiles; 45 45 int w, h, nw, nh, ntiles; … … 57 57 : data(new TileSetData()) 58 58 { 59 data->name = strdup(path); 59 data->name = (char *)malloc(10 + strlen(path) + 1); 60 data->path = data->name + 10; 61 sprintf(data->name, "<tileset> %s", path); 62 60 63 data->tiles = NULL; 61 64 data->img = NULL;
Note: See TracChangeset
for help on using the changeset viewer.