(svn r22456) -Codechange: Derive NewGRFSpriteLayout from DrawTileSprites for spritelayouts allocated on the heap, and make use of constructors and destructors.

This commit is contained in:
frosch
2011-05-14 17:25:45 +00:00
parent 3183cb7907
commit 7415b9cca2
8 changed files with 81 additions and 44 deletions

View File

@@ -110,17 +110,3 @@ void DrawCommonTileSeqInGUI(int x, int y, const DrawTileSprites *dts, int32 orig
}
}
}
/** Create a copy of an existing DrawTileSeqStruct array. */
const DrawTileSeqStruct *CopyDrawTileSeqStruct(const DrawTileSeqStruct *dtss)
{
const DrawTileSeqStruct *element;
size_t count = 1; // 1 for the terminator
foreach_draw_tile_seq(element, dtss) count++;
DrawTileSeqStruct *copy = MallocT<DrawTileSeqStruct>(count);
MemCpyT(copy, dtss, count);
return copy;
}