diff --git a/src/wi_stuff.cpp b/src/wi_stuff.cpp index 58f8a349ae..0172223ec9 100644 --- a/src/wi_stuff.cpp +++ b/src/wi_stuff.cpp @@ -92,6 +92,7 @@ static const char *WI_Cmd[] = { "Pic", "NoAutostartMap", + "Screensize", NULL }; @@ -169,7 +170,10 @@ private: FGameTexture *background = nullptr; wbstartstruct_t *wbs; level_info_t *exitlevel; - + int bgwidth = -1; + int bgheight = -1; + + public: DInterBackground(wbstartstruct_t *wbst); @@ -456,6 +460,13 @@ bool DInterBackground::LoadBackground(bool isenterpic) noautostartmap = true; break; + case 15: // screensize + sc.MustGetNumber(); + bgwidth = sc.Number; + sc.MustGetNumber(); + bgheight = sc.Number; + break; + readanimation: sc.MustGetString(); an.LevelName = sc.String; @@ -591,20 +602,23 @@ DEFINE_ACTION_FUNCTION(DInterBackground, updateAnimatedBack) void DInterBackground::drawBackground(int state, bool drawsplat, bool snl_pointeron) { unsigned int i; - double animwidth = 320; // For a flat fill or clear background scale animations to 320x200 - double animheight = 200; + double animwidth = bgwidth; // For a flat fill or clear background scale animations to 320x200 + double animheight = bgheight; if (background) { // background if (background->isMiscPatch()) { - // scale all animations below to fit the size of the base pic + // if no explicit size was set scale all animations below to fit the size of the base pic // The base pic is always scaled to fit the screen so this allows // placing the animations precisely where they belong on the base pic - animwidth = background->GetDisplayWidth(); - animheight = background->GetDisplayHeight(); - if (animheight == 200) animwidth = 320; // deal with widescreen replacements that keep the original coordinates. + if (bgwidth < 0 || bgheight < 0) + { + animwidth = background->GetDisplayWidth(); + animheight = background->GetDisplayHeight(); + if (animheight == 200) animwidth = 320; // deal with widescreen replacements that keep the original coordinates. + } DrawTexture(twod, background, 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, TAG_DONE); } else diff --git a/wadsrc/static/in_epi1.txt b/wadsrc/static/in_epi1.txt index 3a20d009a7..627516ccaa 100644 --- a/wadsrc/static/in_epi1.txt +++ b/wadsrc/static/in_epi1.txt @@ -1,4 +1,5 @@ Background wimap0 +Screensize 320 200 Splat wisplat Pointer wiurh0 wiurh1 diff --git a/wadsrc/static/in_epi2.txt b/wadsrc/static/in_epi2.txt index 340bb04223..c0f35568a4 100644 --- a/wadsrc/static/in_epi2.txt +++ b/wadsrc/static/in_epi2.txt @@ -1,4 +1,5 @@ Background wimap1 +Screensize 320 200 Splat wisplat Pointer wiurh0 wiurh1 diff --git a/wadsrc/static/in_epi3.txt b/wadsrc/static/in_epi3.txt index 08e6fb341d..901a7655ca 100644 --- a/wadsrc/static/in_epi3.txt +++ b/wadsrc/static/in_epi3.txt @@ -1,4 +1,5 @@ Background wimap2 +Screensize 320 200 Splat wisplat Pointer wiurh0 wiurh1 diff --git a/wadsrc/static/in_htc1.txt b/wadsrc/static/in_htc1.txt index 15c2ac6015..20902bdfd6 100644 --- a/wadsrc/static/in_htc1.txt +++ b/wadsrc/static/in_htc1.txt @@ -1,5 +1,6 @@ NoAutostartMap Background mape1 +Screensize 320 200 Splat in_x Pointer in_yah diff --git a/wadsrc/static/in_htc2.txt b/wadsrc/static/in_htc2.txt index 9d506d777c..e123a26e29 100644 --- a/wadsrc/static/in_htc2.txt +++ b/wadsrc/static/in_htc2.txt @@ -1,5 +1,6 @@ NoAutostartMap Background mape2 +Screensize 320 200 Splat in_x Pointer in_yah diff --git a/wadsrc/static/in_htc3.txt b/wadsrc/static/in_htc3.txt index 545c59d3e0..21dd15c99e 100644 --- a/wadsrc/static/in_htc3.txt +++ b/wadsrc/static/in_htc3.txt @@ -1,5 +1,6 @@ NoAutostartMap Background mape3 +Screensize 320 200 Splat in_x Pointer in_yah