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

Function tileSetHightileReplacement

source/core/defparser.cpp:132–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130//===========================================================================
131
132static int tileSetHightileReplacement(FScanner& sc, int tilenum, int palnum, const char* filename, float alphacut, float xscale, float yscale, float specpower, float specfactor, bool indexed = false)
133{
134 if ((uint32_t)tilenum >= (uint32_t)MAXTILES) return -1;
135 if ((uint32_t)palnum >= (uint32_t)MAXPALOOKUPS) return -1;
136
137 auto tex = tbuild->tile[tilenum].tileimage;
138
139 if (tex == nullptr || tex->GetWidth() <= 0 || tex->GetHeight() <= 0)
140 {
141 sc.ScriptMessage("Warning: defined hightile replacement for empty tile %d.", tilenum);
142 return -1; // cannot add replacements to empty tiles, must create one beforehand
143 }
144
145 FTextureID texid = TexMan.CheckForTexture(filename, ETextureType::Any, FTextureManager::TEXMAN_ForceLookup);
146 if (!texid.isValid())
147 {
148 sc.ScriptMessage("%s: Replacement for tile %d does not exist or is invalid\n", filename, tilenum);
149 return -1;
150 }
151 tileSetHightileReplacement(tilenum, palnum, texid, alphacut, xscale, yscale, specpower, specfactor, indexed);
152 return 0;
153}
154
155//==========================================================================
156//

Callers 4

tileImportFromTextureFunction · 0.70
parseDefineTextureFunction · 0.70
parseTexturePaletteBlockFunction · 0.70
parseTextureSpecialBlockFunction · 0.70

Calls 5

ScriptMessageMethod · 0.80
CheckForTextureMethod · 0.80
GetWidthMethod · 0.45
GetHeightMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected