MCPcopy Create free account
hub / github.com/diasurgical/devilution / CheckCursMove

Function CheckCursMove

Source/cursor.cpp:173–608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173void CheckCursMove()
174{
175 int i, sx, sy, fx, fy, mx, my, tx, ty, px, py, xx, yy, mi;
176 char bv;
177 BOOL flipflag, flipx, flipy;
178
179 sx = MouseX;
180 sy = MouseY;
181
182
183 if (PANELS_COVER) {
184 if (chrflag || questlog) {
185 if (sx >= 160) {
186 sx -= 160;
187 } else {
188 sx = 0;
189 }
190 } else if (invflag || sbookflag) {
191 if (sx <= 320) {
192 sx += 160;
193 } else {
194 sx = 0;
195 }
196 }
197 }
198 if (sy > PANEL_TOP - 1 && track_isscrolling()) {
199 sy = PANEL_TOP - 1;
200 }
201 sx -= (SCREEN_WIDTH % 64) / 2;
202 sy -= (VIEWPORT_HEIGHT % 32) / 2;
203 if (!zoomflag) {
204 sx >>= 1;
205 sy >>= 1;
206 }
207
208 sx -= ScrollInfo._sxoff;
209 sy -= ScrollInfo._syoff;
210
211 fx = plr[myplr]._pVar6 / 256;
212 fy = plr[myplr]._pVar7 / 256;
213 fx -= (plr[myplr]._pVar6 + plr[myplr]._pxvel) / 256;
214 fy -= (plr[myplr]._pVar7 + plr[myplr]._pyvel) / 256;
215
216 if (ScrollInfo._sdir != SDIR_NONE) {
217 sx -= fx;
218 sy -= fy;
219 }
220
221 if (sx < 0) {
222 sx = 0;
223 }
224 if (sx >= SCREEN_WIDTH) {
225 sx = SCREEN_WIDTH;
226 }
227 if (sy < 0) {
228 sy = 0;
229 }
230 if (sy >= SCREEN_HEIGHT) {

Callers 1

ProcessInputFunction · 0.85

Calls 6

track_isscrollingFunction · 0.85
CheckPanelInfoFunction · 0.85
CheckInvHLightFunction · 0.85
CheckTrigForceFunction · 0.85
CheckTownFunction · 0.85
CheckRportalFunction · 0.85

Tested by

no test coverage detected