MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / UpdateView

Method UpdateView

editor/BriefScreenEdit.cpp:108–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108void CBriefScreenEdit::UpdateView(void) {
109 CWnd *objwnd;
110 RECT rect;
111 int x, y, w, h;
112
113 objwnd = GetDlgItem(IDC_BRIEF_ADDS_PICTURE);
114 objwnd->GetWindowRect(&rect);
115 ScreenToClient(&rect);
116
117 int bmw, bmh;
118
119 Desktop_surf->attach_to_window((unsigned)m_hWnd);
120
121 w = rect.right - rect.left;
122 h = rect.bottom - rect.top;
123
124 bmw = w;
125 bmh = h;
126
127 static bool first_call = true;
128
129 if (first_call)
130 Desktop_surf->clear(rect.left, rect.top, w, h);
131
132 m_ObjectSurf.create(bmw, bmh, BPP_16);
133
134 if (bm_handle > BAD_BITMAP_HANDLE) {
135 m_ObjectSurf.load(bm_handle);
136 } else
137 Desktop_surf->clear(rect.left, rect.top, w, h);
138
139 x = rect.left + (w / 2) - m_ObjectSurf.width() / 2;
140 y = rect.top + (h / 2) - m_ObjectSurf.height() / 2;
141
142 Desktop_surf->blt(x, y, &m_ObjectSurf);
143
144 m_ObjectSurf.free();
145 Desktop_surf->attach_to_window((unsigned)NULL);
146
147 if (first_call)
148 first_call = false;
149}
150
151void CBriefScreenEdit::OnTimer(UINT nIDEvent) {
152 UpdateView();

Callers

nothing calls this directly

Calls 8

attach_to_windowMethod · 0.80
clearMethod · 0.45
createMethod · 0.45
loadMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45
bltMethod · 0.45
freeMethod · 0.45

Tested by

no test coverage detected