UwUHax/materials.h
2021-08-27 18:58:23 +07:00

62 lines
1.4 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
struct ModelRenderInfo_t
{
Vector origin;
Vector angles;
void* renderable;
const void *pModel;
const matrix3x4_t *pModelToWorld;
const matrix3x4_t *pLightingOffset;
const Vector* lightingOrigin;
int flags;
int entity_index;
};
enum MaterialVarFlag
{
NO_DRAW = (1 << 2),
ZNEARER = (1 << 10),
NOCULL = (1 << 13),
NOFOG = (1 << 14),
IGNOREZ = (1 << 15),
HALFLAMBERT = (1 << 27)
};
class IMaterial
{
public:
void ColorModulate(float r, float g, float b)
{
typedef void(__thiscall* ColorModulateFn)(void*, float, float, float);
getvfunc<ColorModulateFn>(this, 28)(this, r, g, b);
}
void SetMaterialVarFlag(MaterialVarFlag flag, bool on)
{
typedef void(__thiscall* SetMaterialVarFlagFn)(void*, MaterialVarFlag, bool);
getvfunc<SetMaterialVarFlagFn>(this, 29)(this, flag, on);
}
};
class IMaterialSystem
{
public:
IMaterial *FindMaterial(char const* pMaterialName, const char *pTextureGroupName, bool complain = true, const char *pComplainPrefix = NULL)
{
typedef IMaterial*(__thiscall* OriginalFn)(PVOID, char const*, const char*, bool, const char*);
return getvfunc<OriginalFn>(this, 71)(this, pMaterialName, pTextureGroupName, complain, pComplainPrefix);
}
};
class IVModelRender
{
public:
void ForcedMaterialOverride(IMaterial* mat)
{
typedef void(__thiscall *OriginalFn)(void*, IMaterial*, int);
return getvfunc<OriginalFn>(this, 1)(this, mat, 0);
}
};