MCPcopy Create free account
hub / github.com/diasurgical/devilution / T_FillTile

Function T_FillTile

Source/town.cpp:60–75  ·  view source on GitHub ↗

* @brief Load a tile in to dPiece * @param P3Tiles Tile set * @param xx upper left destination * @param yy upper left destination * @param t tile id */

Source from the content-addressed store, hash-verified

58 * @param t tile id
59 */
60void T_FillTile(BYTE *P3Tiles, int xx, int yy, int t)
61{
62 long v1, v2, v3, v4;
63 WORD *Tiles;
64
65 Tiles = ((WORD *)&P3Tiles[(t - 1) * 8]);
66 v1 = SDL_SwapLE16(*(Tiles + 0)) + 1;
67 v2 = SDL_SwapLE16(*(Tiles + 1)) + 1;
68 v3 = SDL_SwapLE16(*(Tiles + 2)) + 1;
69 v4 = SDL_SwapLE16(*(Tiles + 3)) + 1;
70
71 dPiece[xx][yy] = v1;
72 dPiece[xx + 1][yy] = v2;
73 dPiece[xx][yy + 1] = v3;
74 dPiece[xx + 1][yy + 1] = v4;
75}
76
77/**
78 * @brief Initialize all of the levels data

Callers 1

town.cppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected