MCPcopy Create free account
hub / github.com/ZDoom/Raze / LoadAliases

Function LoadAliases

source/core/textures/tilesetbuilder.cpp:279–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277}
278
279void LoadAliases(int firsttileid, int maxarttile)
280{
281 int lump, lastlump = 0;
282 while ((lump = fileSystem.FindLump("TEXNAMES", &lastlump, false)) != -1)
283 {
284 FScanner sc;
285 sc.OpenLumpNum(lump);
286 sc.SetCMode(true);
287 while (sc.GetNumber())
288 {
289 int tile = sc.Number;
290 if (tile < 0 || tile > maxarttile) tile = maxarttile;
291 sc.MustGetStringName("=");
292 sc.MustGetString();
293 TexMan.AddAlias(sc.String, FSetTextureID(firsttileid + tile));
294 FString basename = sc.String;
295 if (sc.CheckString(","))
296 {
297 sc.MustGetNumber();
298 int numframes = sc.Number;
299 int numrotations = 1, order = 0;
300 if (sc.CheckString(","))
301 {
302 sc.MustGetNumber();
303 numrotations = sc.Number;
304 if (sc.CheckString(","))
305 {
306 sc.MustGetNumber();
307 order = sc.Number;
308 }
309 }
310 if (numframes <= 0 || numframes > 26)
311 {
312 sc.ScriptMessage("%d: Bad number of frames\n", numframes);
313 continue;
314 }
315 if (numrotations >= 16 || numrotations < 1)
316 {
317 sc.ScriptMessage("%d: Bad number of rotations\n", numrotations);
318 continue;
319 }
320 if (order < 0)
321 {
322 sc.ScriptMessage("%d: Bad order\n", order);
323 continue;
324 }
325 GenerateRotations(firsttileid, basename.GetChars(), tile, numframes, numrotations, order);
326 if (sc.CheckString(","))
327 {
328 sc.MustGetString();
329 if (sc.String[0] != '@')
330 {
331 CompleteRotations(firsttileid, basename.GetChars(), sc.String, numframes, numrotations);
332 }
333 else
334 {
335 sc.UnGet();
336 do

Callers 1

ConstructTilesetFunction · 0.85

Calls 15

FSetTextureIDClass · 0.85
GenerateRotationsFunction · 0.85
CompleteRotationsFunction · 0.85
strtollFunction · 0.85
SubstituteRotationsFunction · 0.85
FindLumpMethod · 0.80
SetCModeMethod · 0.80
MustGetStringNameMethod · 0.80
MustGetStringMethod · 0.80
MustGetNumberMethod · 0.80
ScriptMessageMethod · 0.80
UnGetMethod · 0.80

Tested by

no test coverage detected