halflife-photomode/common/r_studioint.h

139 lines
4.9 KiB
C
Raw Normal View History

#pragma once
2013-08-30 13:34:05 -07:00
#define STUDIO_INTERFACE_VERSION 1
typedef struct engine_studio_api_s
{
// Allocate number*size bytes and zero it
void* (*Mem_Calloc)(int number, size_t size);
2013-08-30 13:34:05 -07:00
// Check to see if pointer is in the cache
void* (*Cache_Check)(struct cache_user_s* c);
2013-08-30 13:34:05 -07:00
// Load file into cache ( can be swapped out on demand )
void (*LoadCacheFile)(char* path, struct cache_user_s* cu);
2013-08-30 13:34:05 -07:00
// Retrieve model pointer for the named model
struct model_s* (*Mod_ForName)(const char* name, int crash_if_missing);
2013-08-30 13:34:05 -07:00
// Retrieve pointer to studio model data block from a model
void* (*Mod_Extradata)(struct model_s* mod);
2013-08-30 13:34:05 -07:00
// Retrieve indexed model from client side model precache list
struct model_s* (*GetModelByIndex)(int index);
2013-08-30 13:34:05 -07:00
// Get entity that is set for rendering
struct cl_entity_s* (*GetCurrentEntity)(void);
2013-08-30 13:34:05 -07:00
// Get referenced player_info_t
struct player_info_s* (*PlayerInfo)(int index);
2013-08-30 13:34:05 -07:00
// Get most recently received player state data from network system
struct entity_state_s* (*GetPlayerState)(int index);
2013-08-30 13:34:05 -07:00
// Get viewentity
struct cl_entity_s* (*GetViewEntity)(void);
2013-08-30 13:34:05 -07:00
// Get current frame count, and last two timestampes on client
void (*GetTimes)(int* framecount, double* current, double* old);
2013-08-30 13:34:05 -07:00
// Get a pointer to a cvar by name
struct cvar_s* (*GetCvar)(const char* name);
2013-08-30 13:34:05 -07:00
// Get current render origin and view vectors ( up, right and vpn )
void (*GetViewInfo)(float* origin, float* upv, float* rightv, float* vpnv);
2013-08-30 13:34:05 -07:00
// Get sprite model used for applying chrome effect
struct model_s* (*GetChromeSprite)(void);
2013-08-30 13:34:05 -07:00
// Get model counters so we can incement instrumentation
void (*GetModelCounters)(int** s, int** a);
2013-08-30 13:34:05 -07:00
// Get software scaling coefficients
void (*GetAliasScale)(float* x, float* y);
2013-08-30 13:34:05 -07:00
// Get bone, light, alias, and rotation matrices
float**** (*StudioGetBoneTransform)(void);
float**** (*StudioGetLightTransform)(void);
float*** (*StudioGetAliasTransform)(void);
float*** (*StudioGetRotationMatrix)(void);
2013-08-30 13:34:05 -07:00
// Set up body part, and get submodel pointers
void (*StudioSetupModel)(int bodypart, void** ppbodypart, void** ppsubmodel);
2013-08-30 13:34:05 -07:00
// Check if entity's bbox is in the view frustum
int (*StudioCheckBBox)(void);
2013-08-30 13:34:05 -07:00
// Apply lighting effects to model
void (*StudioDynamicLight)(struct cl_entity_s* ent, struct alight_s* plight);
void (*StudioEntityLight)(struct alight_s* plight);
void (*StudioSetupLighting)(struct alight_s* plighting);
2013-08-30 13:34:05 -07:00
// Draw mesh vertices
void (*StudioDrawPoints)(void);
2013-08-30 13:34:05 -07:00
// Draw hulls around bones
void (*StudioDrawHulls)(void);
2013-08-30 13:34:05 -07:00
// Draw bbox around studio models
void (*StudioDrawAbsBBox)(void);
2013-08-30 13:34:05 -07:00
// Draws bones
void (*StudioDrawBones)(void);
2013-08-30 13:34:05 -07:00
// Loads in appropriate texture for model
void (*StudioSetupSkin)(void* ptexturehdr, int index);
2013-08-30 13:34:05 -07:00
// Sets up for remapped colors
void (*StudioSetRemapColors)(int top, int bottom);
2013-08-30 13:34:05 -07:00
// Set's player model and returns model pointer
struct model_s* (*SetupPlayerModel)(int index);
2013-08-30 13:34:05 -07:00
// Fires any events embedded in animation
void (*StudioClientEvents)(void);
2013-08-30 13:34:05 -07:00
// Retrieve/set forced render effects flags
int (*GetForceFaceFlags)(void);
void (*SetForceFaceFlags)(int flags);
2013-08-30 13:34:05 -07:00
// Tell engine the value of the studio model header
void (*StudioSetHeader)(void* header);
2013-08-30 13:34:05 -07:00
// Tell engine which model_t * is being renderered
void (*SetRenderModel)(struct model_s* model);
2013-08-30 13:34:05 -07:00
// Final state setup and restore for rendering
void (*SetupRenderer)(int rendermode);
void (*RestoreRenderer)(void);
2013-08-30 13:34:05 -07:00
// Set render origin for applying chrome effect
void (*SetChromeOrigin)(void);
2013-08-30 13:34:05 -07:00
// True if using D3D/OpenGL
int (*IsHardware)(void);
2013-08-30 13:34:05 -07:00
// Only called by hardware interface
void (*GL_StudioDrawShadow)(void);
void (*GL_SetRenderMode)(int mode);
2013-08-30 13:34:05 -07:00
void (*StudioSetRenderamt)(int iRenderamt); //!!!CZERO added for rendering glass on viewmodels
void (*StudioSetCullState)(int iCull);
void (*StudioRenderShadow)(int iSprite, float* p1, float* p2, float* p3, float* p4);
2013-08-30 13:34:05 -07:00
} engine_studio_api_t;
typedef struct server_studio_api_s
{
// Allocate number*size bytes and zero it
void* (*Mem_Calloc)(int number, size_t size);
2013-08-30 13:34:05 -07:00
// Check to see if pointer is in the cache
void* (*Cache_Check)(struct cache_user_s* c);
2013-08-30 13:34:05 -07:00
// Load file into cache ( can be swapped out on demand )
void (*LoadCacheFile)(char* path, struct cache_user_s* cu);
2013-08-30 13:34:05 -07:00
// Retrieve pointer to studio model data block from a model
void* (*Mod_Extradata)(struct model_s* mod);
2013-08-30 13:34:05 -07:00
} server_studio_api_t;
// client blending
typedef struct r_studio_interface_s
{
int version;
int (*StudioDrawModel)(int flags);
int (*StudioDrawPlayer)(int flags, struct entity_state_s* pplayer);
2013-08-30 13:34:05 -07:00
} r_studio_interface_t;
extern r_studio_interface_t* pStudioAPI;
2013-08-30 13:34:05 -07:00
// server blending
#define SV_BLENDING_INTERFACE_VERSION 1
typedef struct sv_blending_interface_s
{
int version;
void (*SV_StudioSetupBones)(struct model_s* pModel,
float frame,
int sequence,
const Vector angles,
const Vector origin,
const byte* pcontroller,
const byte* pblending,
int iBone,
const edict_t* pEdict);
2013-08-30 13:34:05 -07:00
} sv_blending_interface_t;