You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
2.1 KiB
68 lines
2.1 KiB
#include "uniquake.h"
|
|
|
|
#include "../Quake/quakedef.h"
|
|
|
|
typedef struct unity_gamecalls_s
|
|
{
|
|
void(*SetEntityModel)(void *context, int entityNum, const char *modelName);
|
|
void(*SetEntityTransform)(void *context, int entityNum, vec3_t origin, vec3_t angles);
|
|
void(*RemoveEntity)(void *context, int entityNum);
|
|
void(*UpdateEntityAnimation)(void *context, int entityNum, int pose1, int pose2, float blend);
|
|
void(*SetEntitySkin)(void *context, int entityNum, int skinNum);
|
|
|
|
void(*RunParticleEffect)(void *context, vec3_t origin, vec3_t direction, unsigned int colorMin, unsigned int colorMax, int count);
|
|
void(*ParticleExplosion)(void *context, vec3_t origin);
|
|
void(*TeleportSplash)(void *context, vec3_t origin);
|
|
} unity_gamecalls_t;
|
|
|
|
static void *unity_context;
|
|
static const unity_gamecalls_t *unity_gamecalls;
|
|
|
|
UNIQUAKE_API void UniQuake_SetGameCallbacks(void *context, const unity_gamecalls_t *callbacks)
|
|
{
|
|
unity_context = context;
|
|
unity_gamecalls = callbacks;
|
|
}
|
|
|
|
void UQ_Game_SetEntityModel(int entityNum, const char *modelName)
|
|
{
|
|
unity_gamecalls->SetEntityModel(unity_context, entityNum, modelName);
|
|
}
|
|
|
|
void UQ_Game_SetEntityTransform(int entityNum, vec3_t origin, vec3_t angles)
|
|
{
|
|
unity_gamecalls->SetEntityTransform(unity_context, entityNum, origin, angles);
|
|
}
|
|
|
|
void UQ_Game_RemoveEntity(int entityNum)
|
|
{
|
|
unity_gamecalls->RemoveEntity(unity_context, entityNum);
|
|
}
|
|
|
|
void UQ_Game_UpdateEntityAnimation(int entityNum, int pose1, int pose2, float blend)
|
|
{
|
|
unity_gamecalls->UpdateEntityAnimation(unity_context, entityNum, pose1, pose2, blend);
|
|
}
|
|
|
|
void UQ_Game_SetEntitySkin(int entityNum, int skinNum)
|
|
{
|
|
unity_gamecalls->SetEntitySkin(unity_context, entityNum, skinNum);
|
|
}
|
|
|
|
void UQ_Game_RunParticleEffect(vec3_t origin, vec3_t direction, int color, int count)
|
|
{
|
|
unsigned int colorMin, colorMax;
|
|
colorMin = d_8to24table[color & ~7];
|
|
colorMax = d_8to24table[color | 7];
|
|
unity_gamecalls->RunParticleEffect(unity_context, origin, direction, colorMin, colorMax, count);
|
|
}
|
|
|
|
void UQ_Game_ParticleExplosion(vec3_t origin)
|
|
{
|
|
unity_gamecalls->ParticleExplosion(unity_context, origin);
|
|
}
|
|
|
|
void UQ_Game_TeleportSplash(vec3_t origin)
|
|
{
|
|
unity_gamecalls->TeleportSplash(unity_context, origin);
|
|
}
|