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>
65 lines
1.6 KiB
C++
65 lines
1.6 KiB
C++
//-----------------------------------------------------------------------------
|
|
// File: Util.cpp
|
|
//
|
|
// Desc: Misc routines
|
|
//
|
|
// Copyright (C) 1995-2001 Microsoft Corporation. All Rights Reserved.
|
|
//-----------------------------------------------------------------------------
|
|
#include "duel.h"
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// Name: randInt()
|
|
// Desc: Returns a random integer in the specified range
|
|
//-----------------------------------------------------------------------------
|
|
int randInt( int low, int high )
|
|
{
|
|
int range = high - low;
|
|
int num = rand() % range;
|
|
return( num + low );
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// Name: randDouble()
|
|
// Desc: Returns a random double in the specified range
|
|
//-----------------------------------------------------------------------------
|
|
double randDouble( double low, double high )
|
|
{
|
|
double range = high - low;
|
|
double num = range * (double)rand()/(double)RAND_MAX;
|
|
return( num + low );
|
|
}
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// Name: dtrace()
|
|
// Desc: Diagnostic trace to OutputDebugString() (UNICODE supported)
|
|
//-----------------------------------------------------------------------------
|
|
VOID dtrace( TCHAR* strFormat, ... )
|
|
{
|
|
int offset = 0;
|
|
TCHAR strBuf[256];
|
|
va_list ap;
|
|
|
|
va_start( ap, strFormat );
|
|
|
|
offset = wsprintf( strBuf, TEXT("DUEL: ") );
|
|
offset += wvsprintf( strBuf+offset, strFormat, ap );
|
|
|
|
OutputDebugString( strBuf );
|
|
|
|
va_end( ap );
|
|
}
|
|
|
|
|
|
|
|
|