Hey folks,

Recently I've been looking through hw.dll (just for fun) and managed to
work up a long list of questions - if anyone (perhaps even a Valve
member?) could provide some answers I would be very grateful.  Apologies
for the length of this post.

General Questions
=================

Why does the decal code handle decals with the name "}z_" specially?  I
can't quite understand what the code does (floating-point assembly isn't
my strong point).

What determines the colour of text in the new VGUI console? As far as I
can tell, there's no way for it to determine whether the engine or the
game DLL is printing to it yet it variously prints in white or brown.

Regarding the server blending API (SV_StudioSetupBones), why is the
passed in edict_t pointer sometimes NULL?  Surely the server always has
all the required data for entities?

Now that player movement is all handled by the client/game DLLs, why
would the engine ever need to find out the texture the player is
standing on (HUD_PlayerMoveTexture)?  Or is this an obsolete function now?

Whatever happend to VGUI::GLSurface?  The header is there but it's
mostly unimplemented.  Is it possible to create your own surface and
have VGUI panels in-game (i.e. like doom3 guis).

Undocumented Functions
======================
Poking around I found quite a few functions exposed to the game DLLs
that aren't documented - they're tacked onto the end of existing
interface structures.  Some I've managed to figure out, but many are
still a mystery.  If anyone knows more (or has the header files - hint
hint Valve ;) ) please let me know.  Any function names are taken either
from string literals found in hw.dll or are best guesses based on their
effects.

SV_SaveGameComment
------------------
Stick this in your server DLL and you can control what goes in the
description field of saved games (appears in the load dialog):
extern "C" void __declspec(dllexport) SV_SaveGameComment(char *buffer,
int max_length)
{
    strcpy( buffer, "Hello, world!" );
}

HUD_ChatInputPosition
---------------------
I think the engine trys to call this from the client DLL, but what its
prototype is and what values it shoudl return I don't know.

---------------------
Extra function in pEfxAPI structure, immediately after R_DecalRemoveAll:
/* Prototype and function unknown - seems to have something to do with
decals */
void (*UnknownFunction1)();

---------------------
Extra functions in pTriAPI structure, immediately after fog function:
/* Prototype and function unknown */
void (*UnknownFunction1)();

/* Prototype and function unknown (passthrough to glGetFloatv?) */
void (*UnknownFunction2)();

/* Prototype and function unknown */
void (*UnknownFunction3)();
/* Prototype and function unknown */

void (*UnknownFunction4)();
/* Prototype and function unknown (passthrough to glColor4f?) */
void UnknownFunction5();

/* Prototype and function unknown (something to do with fog?) */
void (*UnknownFunction6)();

---------------------
Extra function in pVoiceTweakAPI struct, immediately after GetControlFloat:
/* Prototype and function unknown */
void (*UnknownFunction1)();

---------------------
Extra functions in client engine interface, immediately after
pfnSetMouseEnable:
/* Returns pointer to start of registered cvar linked list. Added for
VGUI console autocomplete? */
cvar_t* (*pfnGetCvarList)( void );

/* Returns pointer to start of registered command linked list. Added for
VGUI console autocomplete?
typedef struct cmd_function_s {
        struct cmd_function_s *next;
        const char *name;
        xcommand_t  function;
        const char *description;
        qboolean    pure;
} cmd_function_t; */
cmd_function_t* (*pfnGetCmdList)( void );

/* Not sure about this - convert cvar_t pointer to cvar name? Why? */
char* (pfnCvarNameFromPointer)( cvar_t* pointer );

/* Not sure abput this - convert cmd_function_t pointer to command name?
Why? */
char* (*pfnCmdNameFromPointer)( cmd_function_t* pointer );

/* Returns current time for this client? Why is this needed when
GetClientTime() already exists? */
float (*pfnGetCurrentTime)( void );

/* Unsure - always seems to return 800.0f (no, it's not horizontal
resolution) */
float (*pfnGetUnknownFloat)( void );

/* Appears to be identical to function in IEngineStudio */
struct model_s* (*pfnGetModelByIndex)( int index );

/* Appears to modifies hidden cvar gl_texsort.  Value of 0 disables it,
other values enable it.  Effect is a very bright (but not fullbright)
screen. Who uses gl_texsort these days? */
void (*pfnSetGL_TexSort)( int value );

/* Colour scaling values for screen.  Only works when gl_texsort is
active. Defaults to white (1.0 1.0 1.0) */
void (pfnSetGL_TexSort_Colour)( float red, float green, float blue );

/* Final scaling factor for screen.  Only works when gl_texsort is
active. Defaults to 1.0 */
void (*pfnSetGL_TexSort_Scale)( float scale );

/* Seems to be a client entry point to the pfnSequenceGet function
introduced for CS:CZ (see post "Engine interface changes" by Alfred on
hlcoders) */
sequenceEntry_s* (*pfnSequenceGet)( const char *fileName, const char
*entryName );

/* Draws a sprite on the screen - parameters are likely incorrect. What
does this offer over the existing pfnDrawSpriteXXX functions? */
void (*pfnDrawSpriteGeneric)( int frame, int x, int y, const wrect_t
*prc, int u1, int u2, int u3, int u4 );

/* Seems to be a client entry point to the pfnSequencePickSentence
function introduced for CS:CZ (see post "Engine interface changes" by
Alfred on hlcoders) */
sentenceEntry_s* (*pfnSequencePickSentence)( const char *groupName, int
pickMethod, int *picked );

/* Unknown (deals with wchar_t's) */
void (*pfnUnknownFunction6)( void *u1, void *u2, void *u3, void *u4,
void *u5, void *u6 );

/* Unknown (deals with wchar_t's) */
void (*pfnUnknownFunction7)( void *u1, void *u2 );

/* Unknown (something to do with players infostring?) */
char* (*pfnUnknownFunction8)( char *u1 );

/* Unknown */
void (*pfnUnknownFunction9)( void *u1, void *u2 );

/* Unknown */
void (*pfnUnknownFunction10)( void *u1, void *u2, void *u3, void *u4,
void *u5 );

/* Seems to be a client entry point to the pfnGetApproxWavePlayLen
function introduced for CS:CZ (see post "Engine interface changes" by
Alfred on hlcoders) */
void (*pfnGetApproxWavePlayLen)( char *filename );

/* Unknown */
int (*pfnUnknownFunction11)( void );

/* Sets cvar value - why is this needed when Cvar_SetValue already
exists? */
void (*Cvar_Set)( char *name, char *value );

/* Seems to be a client entry point to the pfnIsCareerMatch function
introduced for CS:CZ (see post "Engine interface changes" by Alfred on
hlcoders) */
int (*pfnIsCareerMatch)( void );

/* Starts a local sound - why is this needed? */
void (*pfnStartDynamicSound)( char *filename, float volume, float pitch );

/* MP3 interface - unsure what int parameter is. Just queues the sound
up - have to issue command "mp3 play" to start it. */
void (*pfnMP3_InitStream)( char *filename, int i1 );

/* Returns unknown, constantly increasing float.  Timing? (calls
QueryPerformanceCounters) */
float (*pfnUnknownFunction12)( void );

/* Seems to be a client entry point to the
pfnProcessTutorMessageDecayBuffer function introduced for CS:CZ (see
post "Engine interface changes" by Alfred on hlcoders) */
void (*pfnProcessTutorMessageDecayBuffer)( int *buffer,int buflen );

/* Seems to be a client entry point to the
pfnConstructTutorMessageDecayBuffer function introduced for CS:CZ (see
post "Engine interface changes" by Alfred on hlcoders) */
void (*pfnConstructTutorMessageDecayBuffer)( int *buffer,int buflen );

/* Seems to be a client entry point to the pfnResetTutorMessageDecayData
function introduced for CS:CZ (see post "Engine interface changes" by
Alfred on hlcoders) */
void (*pfnResetTutorMessageDecayData)( void );

/* Seems to be an exact copy of the previous StartDynamicSound
function??? */
void (*pfnStartDynamicSound2)( char *filename, float volume, float pitch );

/* Seems to be an exact copy of the previous FillRGBA function??? */
void (*pfnFillRGBA2)( int x, int y, int width, int height, int r, int g,
int b, int a );

---------------------

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Reply via email to