MCPcopy Create free account
hub / github.com/ZDoom/gzdoom / LoadBackground

Method LoadBackground

src/wi_stuff.cpp:374–934  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372//====================================================================
373
374bool DInterBackground::LoadBackground(bool isenterpic)
375{
376 const char* lumpname = nullptr;
377 const char* exitpic = nullptr;
378 const char* exitanim = nullptr;
379 char buffer[10];
380 in_anim_t an;
381 lnode_t pt;
382 FTextureID texture;
383 bool noautostartmap = false;
384 bool id24anim = false;
385
386 bcnt = 0;
387
388 if (!isenterpic) tilebackground = false;
389 texture.SetInvalid();
390
391 level_info_t* li = FindLevelInfo(wbs->current.GetChars());
392 if (li != nullptr)
393 {
394 if (li->ExitAnim.IsNotEmpty())
395 {
396 id24anim = true;
397 exitpic = li->ExitAnim.GetChars();
398 tilebackground = false;
399 }
400 else
401 {
402 exitpic = li->ExitPic.GetChars();
403 if (li->ExitPic.IsNotEmpty()) tilebackground = false;
404 }
405 }
406 lumpname = exitpic;
407
408 if (isenterpic)
409 {
410 level_info_t* li = FindLevelInfo(wbs->next.GetChars());
411 if (li != NULL)
412 {
413 if (li->EnterAnim.IsNotEmpty())
414 {
415 id24anim = true;
416 lumpname = li->EnterAnim.GetChars();
417 tilebackground = false;
418 }
419 else
420 {
421 lumpname = li->EnterPic.GetChars();
422 if (li->EnterPic.IsNotEmpty()) tilebackground = false;
423 }
424 }
425 }
426
427 // Try to get a default if nothing specified
428 if (lumpname == NULL || lumpname[0] == 0)
429 {
430 lumpname = NULL;
431 switch (gameinfo.gametype)

Callers 1

DEFINE_ACTION_FUNCTIONFunction · 0.80

Calls 15

FindLevelInfoFunction · 0.85
I_ErrorFunction · 0.85
MusicExistsFunction · 0.85
PrintfFunction · 0.85
SetInvalidMethod · 0.80
IsNotEmptyMethod · 0.80
CheckNumForFullNameMethod · 0.80
GetFileFullPathMethod · 0.80
OpenReaderMethod · 0.80
stringMethod · 0.80
CheckForTextureMethod · 0.80
IsKeyNullMethod · 0.80

Tested by

no test coverage detected