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

Function UpdateFrame

source/games/duke/src/sbar.cpp:43–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41#include "automap.h"
42
43BEGIN_DUKE_NS
44
45//==========================================================================
46//
47// 3D viewport size management
48//
49//==========================================================================
50
51void UpdateFrame()
52{
53 auto tex = TexMan.FindGameTexture(isRRRA()? "RRRABORDER" : "BIGHOLE", ETextureType::Any);
54 if (tex != nullptr && tex->isValid())
55 {
56 // Backdrop.
57 if (viewport3d.Top() > 0)
58 {
59 twod->AddFlatFill(0, 0, twod->GetWidth(), viewport3d.Top(), tex, false, 1);
60 }
61 if (viewport3d.Bottom() < twod->GetHeight())
62 {
63 twod->AddFlatFill(0, viewport3d.Bottom(), twod->GetWidth(), twod->GetHeight(), tex, false, 1);
64 }
65 if (viewport3d.Left() > 0)
66 {
67 twod->AddFlatFill(0, viewport3d.Top(), viewport3d.Left(), viewport3d.Bottom(), tex, false, 1);
68 }
69 if (viewport3d.Right() < twod->GetWidth())
70 {
71 twod->AddFlatFill(viewport3d.Right(), viewport3d.Top(), twod->GetWidth(), viewport3d.Bottom(), tex, false, 1);
72 }
73
74 // Border.
75 if (hud_size < Hud_Stbar)
76 {
77 auto vb = TexMan.FindGameTexture("VIEWBORDER", ETextureType::Any);
78 auto ve = TexMan.FindGameTexture("VIEWEDGE", ETextureType::Any);
79 int x1 = viewport3d.Left() - 4;
80 int y1 = viewport3d.Top() - 4;
81 int x2 = viewport3d.Right() + 4;
82 int y2 = viewport3d.Bottom() + 4;
83 twod->AddFlatFill(x1, y1, x2, y1 + 4, vb, 5);
84 twod->AddFlatFill(x1, y2 - 4, x2, y2, vb, 6);
85 twod->AddFlatFill(x1, y1, x1 + 4, y2, vb, 1);
86 twod->AddFlatFill(x2 - 4, y1, x2, y2, vb, 3);
87 twod->AddFlatFill(x1, y1, x1 + 4, y1 + 4, ve, 1);
88 twod->AddFlatFill(x2 - 4, y1, x2, y1 + 4, ve, 3);
89 twod->AddFlatFill(x1, y2 - 4, x1 + 4, y2, ve, 2);
90 twod->AddFlatFill(x2 - 4, y2 - 4, x2, y2, ve, 4);
91 }
92 }
93}
94
95void DrawStatusBar()
96{

Callers 1

DrawStatusBarFunction · 0.70

Calls 10

isRRRAFunction · 0.85
FindGameTextureMethod · 0.80
AddFlatFillMethod · 0.80
isValidMethod · 0.45
TopMethod · 0.45
GetWidthMethod · 0.45
BottomMethod · 0.45
GetHeightMethod · 0.45
LeftMethod · 0.45
RightMethod · 0.45

Tested by

no test coverage detected