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

Method getInput

source/core/gameinput.cpp:327–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325//---------------------------------------------------------------------------
326
327void GameInput::getInput(InputPacket* packet)
328{
329 I_GetEvent();
330 SendAction(PlayerArray[myconnectindex]->cmd.ucmd.actions & SB_CENTERVIEW);
331
332 if (M_Active() || gamestate != GS_LEVEL)
333 {
334 inputBuffer = {};
335 return;
336 }
337
338 I_GetAxes(joyAxes);
339 processInputBits();
340 if (!paused) gi->doPlayerMovement();
341 mouseInput.Zero();
342
343 if (packet)
344 {
345 const DVector3& maxVel = MAXVEL[keymove];
346 *packet = { clamp(inputBuffer.vel, -maxVel, maxVel), clamp(inputBuffer.ang, -MAXANG, MAXANG), inputBuffer.actions };
347 inputBuffer = {};
348 }
349}
350
351
352//---------------------------------------------------------------------------

Callers 2

G_BuildTiccmdFunction · 0.80
TryRunTicsFunction · 0.80

Calls 6

M_ActiveFunction · 0.85
clampFunction · 0.85
I_GetEventFunction · 0.50
I_GetAxesFunction · 0.50
doPlayerMovementMethod · 0.45
ZeroMethod · 0.45

Tested by

no test coverage detected