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

Function tileImportFromTexture

source/core/defparser.cpp:162–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160//==========================================================================
161
162static int tileImportFromTexture(FScanner& sc, const char* fn, int tilenum, int alphacut, int istexture)
163{
164 FTextureID texid = TexMan.CheckForTexture(fn, ETextureType::Any, FTextureManager::TEXMAN_ForceLookup);
165 if (!texid.isValid()) return -1;
166 auto tex = TexMan.GetGameTexture(texid);
167
168 int32_t xsiz = tex->GetTexelWidth(), ysiz = tex->GetTexelHeight();
169
170 if (xsiz <= 0 || ysiz <= 0)
171 return -2;
172
173 tbuild->tile[tilenum].imported = TexMan.GetGameTexture(texid);
174 tbuild->tile[tilenum].tileimage = tbuild->tile[tilenum].imported->GetTexture()->GetImage();
175
176 if (istexture)
177 tileSetHightileReplacement(sc, tilenum, 0, fn, (float)(255 - alphacut) * (1.f / 255.f), 1.0f, 1.0f, 1.0, 1.0);
178 return 0;
179
180}
181
182//===========================================================================
183//

Callers 2

processTileImportFunction · 0.85
parseImportTileFunction · 0.85

Calls 8

CheckForTextureMethod · 0.80
GetGameTextureMethod · 0.80
GetTexelWidthMethod · 0.80
GetTexelHeightMethod · 0.80
isValidMethod · 0.45
GetImageMethod · 0.45
GetTextureMethod · 0.45

Tested by

no test coverage detected