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

Function GetWritablePixels

source/core/textures/tiletexture.cpp:278–293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276//==========================================================================
277
278uint8_t* GetWritablePixels(FTextureID texid, bool reload)
279{
280 if (!texid.isValid()) return nullptr;
281 auto gtex = TexMan.GetGameTexture(texid);
282 auto tex = dynamic_cast<FImageTexture*>(gtex->GetTexture());
283
284 if (!tex || !tex->GetImage()) return nullptr;
285 auto timg = dynamic_cast<FWritableTile*>(tex->GetImage());
286 if (!timg) return nullptr;
287
288 if (reload)
289 timg->Reload();
290
291 gtex->CleanHardwareData(); // we can safely assume that this only gets called when the texture is about to be changed.
292 return timg->GetRawData();
293}
294
295
296//==========================================================================

Callers 10

updatepindisplayFunction · 0.85
InitSpiritHeadFunction · 0.85
DoSpiritHeadFunction · 0.85
DrawClockFunction · 0.85
CopyTileToBitmapFunction · 0.85
DoEnergyTileFunction · 0.85
menu_DoPlasmaFunction · 0.85
DoStaticFunction · 0.85
UndoStaticFunction · 0.85
DoFireFrameFunction · 0.85

Calls 7

GetGameTextureMethod · 0.80
CleanHardwareDataMethod · 0.80
isValidMethod · 0.45
GetTextureMethod · 0.45
GetImageMethod · 0.45
ReloadMethod · 0.45
GetRawDataMethod · 0.45

Tested by

no test coverage detected