mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
In 'datacache/mdlcache.cpp' the function 'CMDLCache::FindMDL' attempts to find 'mdl/error.rmdl' and assigns the studiohdr and handle to the members of CMDLFallback. In 'CMDLCache::FindUncachedMDL' we check if a model exists, if a model does not exist, we replace the studiohdr with the one of error.rmdl we stored in the CMDLFallback structure. This does actually work (on the dedicated server it doesn't crash at all!), but on the client it crashes when trying to gather props (right before rendering), setting the ConVar* 'old_gather_props' does interesting things (check IDA around this ConVar*). setting this to 1 causes it to crash in another CMDLCache method when trying to deref something in the global cache pool. This method is easy to rebuild. I will do this soon and attempt to return error.rmdl parts from here as well if results are null (this might actually just work). Leaving 'old_gather_props' to 0 causes it to crash in the middle of the function which is supposed to gather the props the 'new' way. The gather props functions are kind of daunting NOTE: Currently only confirmed to work somewhat properly on the dedicated server for prop_static. prop_dynamic is unconfirmed. And (almost?) works on the client.
58 lines
2.0 KiB
C++
58 lines
2.0 KiB
C++
//===== Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ======//
|
||
//
|
||
// Purpose:
|
||
//
|
||
// $NoKeywords: $
|
||
//===========================================================================//
|
||
#ifndef ENGINESPRITE_H
|
||
#define ENGINESPRITE_H
|
||
#include "public/avi/iavi.h"
|
||
#include "public/avi/ibik.h"
|
||
#include "public/include/const.h"
|
||
#include "game/client/hud.h"
|
||
|
||
typedef void* IMaterial; // HACK
|
||
|
||
//-----------------------------------------------------------------------------
|
||
// Purpose: Sprite Models
|
||
//-----------------------------------------------------------------------------
|
||
class CEngineSprite // !! UNCONFIRMED !!
|
||
{
|
||
// NOTE: don't define a constructor or destructor so that this can be allocated
|
||
// as before.
|
||
public:
|
||
int GetWidth(void) const { return m_width; }
|
||
int GetHeight(void) const { return m_height; }
|
||
int GetNumFrames(void) const { return m_numFrames; }
|
||
//IMaterial* GetMaterial(RenderMode_t nRenderMode) { return m_material[nRenderMode]; }
|
||
//IMaterial* GetMaterial(RenderMode_t nRenderMode, int nFrame);
|
||
//void SetFrame(RenderMode_t nRenderMode, int nFrame);
|
||
//bool Init(const char* name);
|
||
//void Shutdown(void);
|
||
//void UnloadMaterial();
|
||
//void SetColor(float r, float g, float b);
|
||
//int GetOrientation(void);
|
||
//void GetHUDSpriteColor(float* color);
|
||
float GetUp(void) const { return up; }
|
||
float GetDown(void) const { return down; }
|
||
float GetLeft(void) const { return left; }
|
||
float GetRight(void) const { return right; }
|
||
//void DrawFrame(RenderMode_t nRenderMode, int frame, int x, int y, const wrect_t* prcSubRect);
|
||
//void DrawFrameOfSize(RenderMode_t nRenderMode, int frame, int x, int y, int iWidth, int iHeight, const wrect_t* prcSubRect);
|
||
bool IsAVI(void) const;
|
||
bool IsBIK(void) const;
|
||
//void GetTexCoordRange(float* pMinU, float* pMinV, float* pMaxU, float* pMaxV);
|
||
|
||
private:
|
||
AVIMaterial_t m_hAVIMaterial;
|
||
BIKMaterial_t m_hBIKMaterial;
|
||
int m_width;
|
||
int m_height;
|
||
int m_numFrames;
|
||
IMaterial* m_material[kRenderModeCount];
|
||
int m_orientation;
|
||
float m_hudSpriteColor[3];
|
||
float up, down, left, right;
|
||
};
|
||
|
||
#endif // ENGINESPRITE_H
|