GekkoNet 1.0
C/C++ Peer to Peer Game Networking SDK
Loading...
Searching...
No Matches
Gekko::InputBuffer Struct Reference

#include <input.h>

Collaboration diagram for Gekko::InputBuffer:

Public Member Functions

 InputBuffer ()
void Init (u8 delay, u8 input_window, u32 input_size, u32 buffer_size=DEFAULT_BUFF_SIZE)
void AddLocalInput (Frame frame, u8 *input)
void AddInput (Frame frame, u8 *input)
void OverwriteInput (Frame frame, u8 *input)
void SetDelay (u8 delay)
u8 GetDelay ()
void SetInputPredictionWindow (u8 input_window)
Frame GetIncorrectPredictionFrame ()
std::unique_ptr< GameInput > GetInput (Frame frame, bool prediction=false)
void SetRunaheadMode (bool running_ahead)
Frame GetLastReceivedFrame ()
void SetLastReceivedFrame (Frame frame)
void ClearIncorrectFrames (Frame clear_limit)

Static Public Attributes

static const u32 DEFAULT_BUFF_SIZE = 128

Private Member Functions

void ResetPrediction ()
u32 PreviousFrame (Frame frame)
bool HandleInputPrediction (Frame frame)
bool CanPredictInput ()

Private Attributes

bool _running_ahead
u8 _input_delay
u8 _input_prediction_window
u32 _input_size
u32 _buff_size
std::unique_ptr< u8[]> _empty_input
Frame _last_received_input
Frame _last_predicted_input
Frame _first_predicted_input
std::deque< Frame > _incorrent_predicted_inputs
std::deque< std::unique_ptr< GameInput > > _inputs

Detailed Description

Definition at line 30 of file input.h.

Constructor & Destructor Documentation

◆ InputBuffer()

Gekko::InputBuffer::InputBuffer ( )

Definition at line 7 of file input.cpp.

Member Function Documentation

◆ AddInput()

void Gekko::InputBuffer::AddInput ( Frame frame,
u8 * input )

Definition at line 60 of file input.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddLocalInput()

void Gekko::InputBuffer::AddLocalInput ( Frame frame,
u8 * input )

Definition at line 50 of file input.cpp.

Here is the call graph for this function:

◆ CanPredictInput()

bool Gekko::InputBuffer::CanPredictInput ( )
private

Definition at line 244 of file input.cpp.

Here is the caller graph for this function:

◆ ClearIncorrectFrames()

void Gekko::InputBuffer::ClearIncorrectFrames ( Frame clear_limit)

Definition at line 204 of file input.cpp.

◆ GetDelay()

u8 Gekko::InputBuffer::GetDelay ( )

Definition at line 171 of file input.cpp.

◆ GetIncorrectPredictionFrame()

Frame Gekko::InputBuffer::GetIncorrectPredictionFrame ( )

Definition at line 181 of file input.cpp.

◆ GetInput()

std::unique_ptr< Gekko::GameInput > Gekko::InputBuffer::GetInput ( Frame frame,
bool prediction = false )

Definition at line 262 of file input.cpp.

Here is the call graph for this function:

◆ GetLastReceivedFrame()

Frame Gekko::InputBuffer::GetLastReceivedFrame ( )

Definition at line 192 of file input.cpp.

◆ HandleInputPrediction()

bool Gekko::InputBuffer::HandleInputPrediction ( Frame frame)
private

Definition at line 212 of file input.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Init()

void Gekko::InputBuffer::Init ( u8 delay,
u8 input_window,
u32 input_size,
u32 buffer_size = DEFAULT_BUFF_SIZE )

Definition at line 23 of file input.cpp.

◆ OverwriteInput()

void Gekko::InputBuffer::OverwriteInput ( Frame frame,
u8 * input )

Definition at line 107 of file input.cpp.

◆ PreviousFrame()

u32 Gekko::InputBuffer::PreviousFrame ( Frame frame)
private

Definition at line 252 of file input.cpp.

Here is the caller graph for this function:

◆ ResetPrediction()

void Gekko::InputBuffer::ResetPrediction ( )
private

Definition at line 186 of file input.cpp.

Here is the caller graph for this function:

◆ SetDelay()

void Gekko::InputBuffer::SetDelay ( u8 delay)

Definition at line 138 of file input.cpp.

Here is the call graph for this function:

◆ SetInputPredictionWindow()

void Gekko::InputBuffer::SetInputPredictionWindow ( u8 input_window)

Definition at line 176 of file input.cpp.

◆ SetLastReceivedFrame()

void Gekko::InputBuffer::SetLastReceivedFrame ( Frame frame)

Definition at line 197 of file input.cpp.

Here is the call graph for this function:

◆ SetRunaheadMode()

void Gekko::InputBuffer::SetRunaheadMode ( bool running_ahead)

Definition at line 257 of file input.cpp.

Member Data Documentation

◆ _buff_size

u32 Gekko::InputBuffer::_buff_size
private

Definition at line 79 of file input.h.

◆ _empty_input

std::unique_ptr<u8[]> Gekko::InputBuffer::_empty_input
private

Definition at line 81 of file input.h.

◆ _first_predicted_input

Frame Gekko::InputBuffer::_first_predicted_input
private

Definition at line 87 of file input.h.

◆ _incorrent_predicted_inputs

std::deque<Frame> Gekko::InputBuffer::_incorrent_predicted_inputs
private

Definition at line 89 of file input.h.

◆ _input_delay

u8 Gekko::InputBuffer::_input_delay
private

Definition at line 73 of file input.h.

◆ _input_prediction_window

u8 Gekko::InputBuffer::_input_prediction_window
private

Definition at line 75 of file input.h.

◆ _input_size

u32 Gekko::InputBuffer::_input_size
private

Definition at line 77 of file input.h.

◆ _inputs

std::deque<std::unique_ptr<GameInput> > Gekko::InputBuffer::_inputs
private

Definition at line 91 of file input.h.

◆ _last_predicted_input

Frame Gekko::InputBuffer::_last_predicted_input
private

Definition at line 85 of file input.h.

◆ _last_received_input

Frame Gekko::InputBuffer::_last_received_input
private

Definition at line 83 of file input.h.

◆ _running_ahead

bool Gekko::InputBuffer::_running_ahead
private

Definition at line 71 of file input.h.

◆ DEFAULT_BUFF_SIZE

const u32 Gekko::InputBuffer::DEFAULT_BUFF_SIZE = 128
static

Definition at line 31 of file input.h.


The documentation for this struct was generated from the following files: