Game client codebase including: - CharacterActionControl: Character and creature management - GlobalScript: Network, items, skills, quests, utilities - RYLClient: Main client application with GUI and event handlers - Engine: 3D rendering engine (RYLGL) - MemoryManager: Custom memory allocation - Library: Third-party dependencies (DirectX, boost, etc.) - Tools: Development utilities 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
58 lines
1.3 KiB
C++
58 lines
1.3 KiB
C++
//------------------------------------------------------------------------------
|
|
// File: State.h
|
|
//
|
|
// Desc: DirectShow sample code - definition of CStreamState class.
|
|
// Provides state machine for picture start codes and timestamps.
|
|
//
|
|
// Copyright (c) 2000-2001 Microsoft Corporation. All rights reserved.
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
|
// We need to know:
|
|
//
|
|
// - The time stamp to associate with a picture start code
|
|
// - The next time stamp
|
|
//
|
|
// State:
|
|
//
|
|
// m_cbBytes - number of valid bytes of start code so far
|
|
// m_arTS[4] - array of all the timestamps
|
|
// m_cbBytes+1 entries are valid
|
|
|
|
|
|
|
|
// Not really invalid but unlikely enough for sample code.
|
|
static const REFERENCE_TIME INVALID_TIME = _I64_MAX;
|
|
|
|
|
|
class CStreamState
|
|
{
|
|
private:
|
|
|
|
DWORD m_cbBytes;
|
|
struct {
|
|
bool bValid;
|
|
REFERENCE_TIME rt;
|
|
} m_arTS[4];
|
|
REFERENCE_TIME m_rt;
|
|
BYTE m_bGOPData[4];
|
|
DWORD m_dwTimeCode;
|
|
DWORD m_dwNextTimeCode;
|
|
|
|
public:
|
|
CStreamState()
|
|
{
|
|
Reset();
|
|
}
|
|
// Returns true if a start code was identifed
|
|
bool NextByte(BYTE bData);
|
|
void TimeStamp(REFERENCE_TIME rt);
|
|
REFERENCE_TIME PictureTime(DWORD *pdwTimeCode) const
|
|
{
|
|
*pdwTimeCode = m_dwTimeCode;
|
|
return m_rt;
|
|
}
|
|
void Reset();
|
|
};
|
|
|