mirror of
https://github.com/halpz/re3.git
synced 2025-06-26 20:46:21 +00:00
Merge branch 'master' of github.com:gtamodding/re3
This commit is contained in:
@ -233,7 +233,7 @@ CClouds::Render(void)
|
||||
szx*55.0f, szy*55.0f,
|
||||
tr, tg, tb, br, bg, bb, 0.0f, -1.0f,
|
||||
1.0f/screenpos.z,
|
||||
IndividualRotation/65336.0f * 2*3.14f + ms_cameraRoll,
|
||||
(uint16)IndividualRotation/65336.0f * 6.28f + ms_cameraRoll,
|
||||
fluffyalpha);
|
||||
bCloudOnScreen[i] = true;
|
||||
}else
|
||||
|
@ -404,6 +404,7 @@ CGlass::AskForObjectToBeRenderedInGlass(CEntity *entity)
|
||||
void
|
||||
CGlass::RenderEntityInGlass(CEntity *entity)
|
||||
{
|
||||
ASSERT(entity!=nil);
|
||||
CObject *object = (CObject *)entity;
|
||||
|
||||
if ( object->bGlassBroken )
|
||||
@ -419,7 +420,7 @@ CGlass::RenderEntityInGlass(CEntity *entity)
|
||||
uint8 alpha = CalcAlphaWithNormal(&fwdNorm);
|
||||
|
||||
CColModel *col = object->GetColModel();
|
||||
|
||||
ASSERT(col!=nil);
|
||||
if ( col->numTriangles >= 2 )
|
||||
{
|
||||
CVector a = object->GetMatrix() * col->vertices[0];
|
||||
@ -523,6 +524,8 @@ CGlass::RenderEntityInGlass(CEntity *entity)
|
||||
int32
|
||||
CGlass::CalcAlphaWithNormal(CVector *normal)
|
||||
{
|
||||
ASSERT(normal!=nil);
|
||||
|
||||
float fwdDir = 2.0f * DotProduct(*normal, TheCamera.GetForward());
|
||||
float fwdDot = DotProduct(TheCamera.GetForward()-fwdDir*(*normal), CVector(0.57f, 0.57f, -0.57f));
|
||||
return int32(lerp(fwdDot*fwdDot*fwdDot*fwdDot*fwdDot*fwdDot, 20.0f, 255.0f));
|
||||
@ -597,6 +600,8 @@ CGlass::RenderReflectionPolys(void)
|
||||
void
|
||||
CGlass::WindowRespondsToCollision(CEntity *entity, float amount, CVector speed, CVector point, bool explosion)
|
||||
{
|
||||
ASSERT(entity!=nil);
|
||||
|
||||
CObject *object = (CObject *)entity;
|
||||
|
||||
if ( object->bGlassBroken )
|
||||
@ -605,7 +610,8 @@ CGlass::WindowRespondsToCollision(CEntity *entity, float amount, CVector speed,
|
||||
object->bGlassCracked = true;
|
||||
|
||||
CColModel *col = object->GetColModel();
|
||||
|
||||
ASSERT(col!=nil);
|
||||
|
||||
CVector a = object->GetMatrix() * col->vertices[0];
|
||||
CVector b = object->GetMatrix() * col->vertices[1];
|
||||
CVector c = object->GetMatrix() * col->vertices[2];
|
||||
@ -647,6 +653,8 @@ CGlass::WindowRespondsToCollision(CEntity *entity, float amount, CVector speed,
|
||||
void
|
||||
CGlass::WindowRespondsToSoftCollision(CEntity *entity, float amount)
|
||||
{
|
||||
ASSERT(entity!=nil);
|
||||
|
||||
CObject *object = (CObject *)entity;
|
||||
|
||||
if ( amount > 50.0f && !object->bGlassCracked )
|
||||
@ -659,6 +667,8 @@ CGlass::WindowRespondsToSoftCollision(CEntity *entity, float amount)
|
||||
void
|
||||
CGlass::WasGlassHitByBullet(CEntity *entity, CVector point)
|
||||
{
|
||||
ASSERT(entity!=nil);
|
||||
|
||||
CObject *object = (CObject *)entity;
|
||||
|
||||
if ( IsGlass(object->GetModelIndex()) )
|
||||
@ -679,6 +689,8 @@ CGlass::WasGlassHitByBullet(CEntity *entity, CVector point)
|
||||
void
|
||||
CGlass::WindowRespondsToExplosion(CEntity *entity, CVector point)
|
||||
{
|
||||
ASSERT(entity!=nil);
|
||||
|
||||
CObject *object = (CObject *)entity;
|
||||
|
||||
CVector distToGlass = object->GetPosition() - point;
|
||||
|
@ -39,16 +39,17 @@ struct EntityInfo
|
||||
float sort;
|
||||
};
|
||||
|
||||
CLinkList<EntityInfo> &gSortedVehiclesAndPeds = *(CLinkList<EntityInfo>*)0x629AC0;
|
||||
CLinkList<EntityInfo> gSortedVehiclesAndPeds;
|
||||
|
||||
int32 &CRenderer::ms_nNoOfVisibleEntities = *(int32*)0x940730;
|
||||
CEntity *(&CRenderer::ms_aVisibleEntityPtrs)[NUMVISIBLEENTITIES] = *(CEntity * (*)[NUMVISIBLEENTITIES]) * (uintptr*)0x6E9920;
|
||||
CEntity *(&CRenderer::ms_aInVisibleEntityPtrs)[NUMINVISIBLEENTITIES] = *(CEntity * (*)[NUMINVISIBLEENTITIES]) * (uintptr*)0x880B50;
|
||||
int32 &CRenderer::ms_nNoOfInVisibleEntities = *(int32*)0x8F1B78;
|
||||
int32 CRenderer::ms_nNoOfVisibleEntities;
|
||||
CEntity *CRenderer::ms_aVisibleEntityPtrs[NUMVISIBLEENTITIES];
|
||||
CEntity *CRenderer::ms_aInVisibleEntityPtrs[NUMINVISIBLEENTITIES];
|
||||
int32 CRenderer::ms_nNoOfInVisibleEntities;
|
||||
|
||||
CVector &CRenderer::ms_vecCameraPosition = *(CVector*)0x8E2C3C;
|
||||
CVehicle *&CRenderer::m_pFirstPersonVehicle = *(CVehicle**)0x885B80;
|
||||
bool &CRenderer::m_loadingPriority = *(bool*)0x95CD86;
|
||||
CVector CRenderer::ms_vecCameraPosition;
|
||||
CVehicle *CRenderer::m_pFirstPersonVehicle;
|
||||
bool CRenderer::m_loadingPriority;
|
||||
float CRenderer::ms_lodDistScale = 1.2f;
|
||||
|
||||
void
|
||||
CRenderer::Init(void)
|
||||
|
@ -20,17 +20,17 @@ class CPtrList;
|
||||
|
||||
class CRenderer
|
||||
{
|
||||
static int32 &ms_nNoOfVisibleEntities;
|
||||
static CEntity *(&ms_aVisibleEntityPtrs)[NUMVISIBLEENTITIES];
|
||||
static int32 &ms_nNoOfInVisibleEntities;
|
||||
static CEntity *(&ms_aInVisibleEntityPtrs)[NUMINVISIBLEENTITIES];
|
||||
static int32 ms_nNoOfVisibleEntities;
|
||||
static CEntity *ms_aVisibleEntityPtrs[NUMVISIBLEENTITIES];
|
||||
static int32 ms_nNoOfInVisibleEntities;
|
||||
static CEntity *ms_aInVisibleEntityPtrs[NUMINVISIBLEENTITIES];
|
||||
|
||||
static CVector &ms_vecCameraPosition;
|
||||
static CVehicle *&m_pFirstPersonVehicle;
|
||||
static CVector ms_vecCameraPosition;
|
||||
static CVehicle *m_pFirstPersonVehicle;
|
||||
|
||||
public:
|
||||
static float ms_lodDistScale; // defined in Frontend.cpp
|
||||
static bool &m_loadingPriority;
|
||||
static float ms_lodDistScale;
|
||||
static bool m_loadingPriority;
|
||||
|
||||
static void Init(void);
|
||||
static void Shutdown(void);
|
||||
|
@ -137,8 +137,8 @@ CSprite::RenderOneXLUSprite(float x, float y, float z, float w, float h, uint8 r
|
||||
void
|
||||
CSprite::RenderOneXLUSprite_Rotate_Aspect(float x, float y, float z, float w, float h, uint8 r, uint8 g, uint8 b, int16 intens, float recipz, float rotation, uint8 a)
|
||||
{
|
||||
float c = Cos(DEGTORAD(rotation));
|
||||
float s = Sin(DEGTORAD(rotation));
|
||||
float c = Cos(rotation);
|
||||
float s = Sin(rotation);
|
||||
|
||||
float xs[4];
|
||||
float ys[4];
|
||||
@ -315,8 +315,8 @@ void
|
||||
CSprite::RenderBufferedOneXLUSprite_Rotate_Aspect(float x, float y, float z, float w, float h, uint8 r, uint8 g, uint8 b, int16 intens, float recipz, float rotation, uint8 a)
|
||||
{
|
||||
m_bFlushSpriteBufferSwitchZTest = 0;
|
||||
float c = Cos(DEGTORAD(rotation));
|
||||
float s = Sin(DEGTORAD(rotation));
|
||||
float c = Cos(rotation);
|
||||
float s = Sin(rotation);
|
||||
|
||||
float xs[4];
|
||||
float ys[4];
|
||||
@ -367,8 +367,8 @@ void
|
||||
CSprite::RenderBufferedOneXLUSprite_Rotate_2Colours(float x, float y, float z, float w, float h, uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2, float cx, float cy, float recipz, float rotation, uint8 a)
|
||||
{
|
||||
m_bFlushSpriteBufferSwitchZTest = 0;
|
||||
float c = Cos(DEGTORAD(rotation));
|
||||
float s = Sin(DEGTORAD(rotation));
|
||||
float c = Cos(rotation);
|
||||
float s = Sin(rotation);
|
||||
|
||||
float xs[4];
|
||||
float ys[4];
|
||||
@ -398,11 +398,11 @@ CSprite::RenderBufferedOneXLUSprite_Rotate_2Colours(float x, float y, float z, f
|
||||
// Colour factors, cx/y is the direction in which colours change from rgb1 to rgb2
|
||||
cf[0] = (cx*(-c-s) + cy*(-c+s))*0.5f + 0.5f;
|
||||
cf[0] = clamp(cf[0], 0.0f, 1.0f);
|
||||
cf[1] = (cx*(-c-s) + cy*(-c+s))*0.5f + 0.5f;
|
||||
cf[1] = (cx*(-c+s) + cy*( c+s))*0.5f + 0.5f;
|
||||
cf[1] = clamp(cf[1], 0.0f, 1.0f);
|
||||
cf[2] = (cx*(-c-s) + cy*(-c+s))*0.5f + 0.5f;
|
||||
cf[2] = (cx*( c+s) + cy*( c-s))*0.5f + 0.5f;
|
||||
cf[2] = clamp(cf[2], 0.0f, 1.0f);
|
||||
cf[3] = (cx*(-c-s) + cy*(-c+s))*0.5f + 0.5f;
|
||||
cf[3] = (cx*( c-s) + cy*(-c-s))*0.5f + 0.5f;
|
||||
cf[3] = clamp(cf[3], 0.0f, 1.0f);
|
||||
|
||||
float screenz = m_f2DNearScreenZ +
|
||||
|
Reference in New Issue
Block a user