MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / Update

Method Update

engine/Poseidon/Input/InputProcessingSdl.cpp:297–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295 GInput.gamepad.stickPov[i] = false;
296 GInput.gamepad.stickPovToDo[i] = false;
297 GInput.gamepad.stickPovOld[i] = false;
298 }
299}
300
301// SDLRumble — 3-source model (engine continuous + weapon ramp)
302
303struct SDLRumble
304{
305 float engineMag = 0;
306 float weaponBegMag = 0, weaponEndMag = 0;
307 uint32_t weaponStart = 0, weaponEnd = 0;
308
309 void SetEngine(float mag) { engineMag = fabsf(mag); }
310
311 void PlayRamp(float beg, float end, float duration)
312 {
313 weaponBegMag = fabsf(beg);
314 weaponEndMag = fabsf(end);
315 weaponStart = SDL_GetTicks();
316 weaponEnd = weaponStart + (uint32_t)(duration * 1000.f);
317 }
318
319 void Update(SDL_Gamepad* g)
320 {
321 if (!g)
322 return;
323 float weaponMag = 0;
324 uint32_t now = SDL_GetTicks();
325 if (now < weaponEnd)
326 {

Callers 3

ProcessKeyboard_SDLFunction · 0.45
ProcessMouse_SDLFunction · 0.45
ProcessJoystick_SDLFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected