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

Function GetRawPixels

source/core/textures/tiletexture.cpp:242–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240static TMap<int, RawCacheNode> CacheNodes;
241
242const uint8_t* GetRawPixels(FTextureID texid)
243{
244 if (!texid.isValid()) return nullptr;
245 auto gtex = TexMan.GetGameTexture(texid);
246 auto tex = dynamic_cast<FImageTexture*>(gtex->GetTexture());
247
248 if (!tex || !tex->GetImage()) return nullptr;
249 auto img = tex->GetImage();
250 auto timg = dynamic_cast<FTileTexture*>(img);
251 if (!timg || !timg->GetRawData())
252 {
253 auto cache = CacheNodes.CheckKey(texid.GetIndex());
254 if (cache)
255 {
256 cache->lastUseTime = I_nsTime();
257 return cache->data.Data();
258 }
259 RawCacheNode newnode;
260 newnode.data = img->GetPalettedPixels(0);
261 newnode.lastUseTime = I_nsTime();
262 auto retval =newnode.data.Data();
263 CacheNodes.Insert(texid.GetIndex(), std::move(newnode));
264 return retval;
265 }
266 else
267 {
268 return timg->GetRawData();
269 }
270}
271
272//==========================================================================
273//

Callers 9

tileCopySectionFunction · 0.85
InitSpiritHeadFunction · 0.85
CopyHeadToWorkTileFunction · 0.85
DoSpiritHeadFunction · 0.85
CopyTileToBitmapFunction · 0.85
InitPlayerInventoryFunction · 0.85
menu_DoPlasmaFunction · 0.85
VectorScanFunction · 0.85
intersectWallSpriteFunction · 0.85

Calls 12

I_nsTimeFunction · 0.85
moveFunction · 0.85
GetGameTextureMethod · 0.80
GetPalettedPixelsMethod · 0.80
isValidMethod · 0.45
GetTextureMethod · 0.45
GetImageMethod · 0.45
GetRawDataMethod · 0.45
CheckKeyMethod · 0.45
GetIndexMethod · 0.45
DataMethod · 0.45
InsertMethod · 0.45

Tested by

no test coverage detected