mirror of
https://gitlab.com/GaryOderNichts/re3-wiiu.git
synced 2024-11-30 04:54:15 +01:00
weapons
This commit is contained in:
parent
265b07a8d9
commit
a38702a7d2
@ -110,6 +110,9 @@ public:
|
||||
static CVehicle *pPlayerVehicle;
|
||||
static CVector StaticCamCoors;
|
||||
static uint32 StaticCamStartTime;
|
||||
|
||||
//TODO(MIAMI)
|
||||
static void RemoveAllPickupsOfACertainWeaponGroupWithNoAmmo(eWeaponType) {}
|
||||
};
|
||||
|
||||
extern uint16 AmmoForWeapon[20];
|
||||
|
@ -49,6 +49,7 @@ bool CWorld::bProcessCutsceneOnly;
|
||||
|
||||
bool CWorld::bDoingCarCollisions;
|
||||
bool CWorld::bIncludeCarTyres;
|
||||
bool CWorld::bIncludeBikers;
|
||||
|
||||
CColPoint CWorld::m_aTempColPts[MAX_COLLISION_POINTS];
|
||||
|
||||
@ -63,6 +64,7 @@ CWorld::Initialise()
|
||||
bIncludeDeadPeds = false;
|
||||
bForceProcessControl = false;
|
||||
bIncludeCarTyres = false;
|
||||
bIncludeBikers = false;
|
||||
}
|
||||
|
||||
void
|
||||
@ -272,7 +274,9 @@ CWorld::ProcessLineOfSightSector(CSector §or, const CColLine &line, CColPoin
|
||||
{
|
||||
float mindist = dist;
|
||||
bool deadPeds = !!bIncludeDeadPeds;
|
||||
bool bikers = !!bIncludeBikers;
|
||||
bIncludeDeadPeds = false;
|
||||
bIncludeBikers = false;
|
||||
|
||||
if(checkBuildings) {
|
||||
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_BUILDINGS], line, point, mindist, entity,
|
||||
@ -290,11 +294,13 @@ CWorld::ProcessLineOfSightSector(CSector §or, const CColLine &line, CColPoin
|
||||
|
||||
if(checkPeds) {
|
||||
if(deadPeds) bIncludeDeadPeds = true;
|
||||
if(bikers) bIncludeBikers = true;
|
||||
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_PEDS], line, point, mindist, entity,
|
||||
ignoreSeeThrough, false, ignoreShootThrough);
|
||||
ProcessLineOfSightSectorList(sector.m_lists[ENTITYLIST_PEDS_OVERLAP], line, point, mindist, entity,
|
||||
ignoreSeeThrough, false, ignoreShootThrough);
|
||||
bIncludeDeadPeds = false;
|
||||
bIncludeBikers = false;
|
||||
}
|
||||
|
||||
if(checkObjects) {
|
||||
@ -312,6 +318,7 @@ CWorld::ProcessLineOfSightSector(CSector §or, const CColLine &line, CColPoin
|
||||
}
|
||||
|
||||
bIncludeDeadPeds = deadPeds;
|
||||
bIncludeBikers = bikers;
|
||||
|
||||
if(mindist < dist) {
|
||||
dist = mindist;
|
||||
@ -325,22 +332,24 @@ CWorld::ProcessLineOfSightSectorList(CPtrList &list, const CColLine &line, CColP
|
||||
CEntity *&entity, bool ignoreSeeThrough, bool ignoreSomeObjects, bool ignoreShootThrough)
|
||||
{
|
||||
bool deadPeds = false;
|
||||
bool bikers = false;
|
||||
float mindist = dist;
|
||||
CPtrNode *node;
|
||||
CEntity *e;
|
||||
CColModel *colmodel;
|
||||
|
||||
if(list.first && bIncludeDeadPeds && ((CEntity *)list.first->item)->IsPed()) deadPeds = true;
|
||||
if(list.first && bIncludeBikers && ((CEntity *)list.first->item)->IsPed()) bikers = true;
|
||||
|
||||
for(node = list.first; node; node = node->next) {
|
||||
e = (CEntity *)node->item;
|
||||
if(e->m_scanCode != GetCurrentScanCode() && e != pIgnoreEntity && (e->bUsesCollision || deadPeds) &&
|
||||
if(e->m_scanCode != GetCurrentScanCode() && e != pIgnoreEntity && (e->bUsesCollision || deadPeds || bikers) &&
|
||||
!(ignoreSomeObjects && CameraToIgnoreThisObject(e))) {
|
||||
colmodel = nil;
|
||||
e->m_scanCode = GetCurrentScanCode();
|
||||
|
||||
if(e->IsPed()) {
|
||||
if(e->bUsesCollision || deadPeds && ((CPed *)e)->m_nPedState == PED_DEAD) {
|
||||
if(e->bUsesCollision || deadPeds && ((CPed *)e)->m_nPedState == PED_DEAD || bikers) {
|
||||
colmodel = ((CPedModelInfo *)CModelInfo::GetModelInfo(e->GetModelIndex()))->AnimatePedColModelSkinned(e->GetClump());
|
||||
} else
|
||||
colmodel = nil;
|
||||
|
@ -71,6 +71,7 @@ public:
|
||||
static bool bProcessCutsceneOnly;
|
||||
static bool bDoingCarCollisions;
|
||||
static bool bIncludeCarTyres;
|
||||
static bool bIncludeBikers;
|
||||
static CColPoint m_aTempColPts[MAX_COLLISION_POINTS];
|
||||
|
||||
static void Remove(CEntity *entity);
|
||||
|
@ -53,4 +53,5 @@ public:
|
||||
|
||||
//TODO(MIAMI)
|
||||
static void CarWindscreenShatters(CVehicle *vehicle, bool unk) {}
|
||||
static void BreakGlassPhysically(CVector, float) {}
|
||||
};
|
@ -29,6 +29,7 @@ RwIm3DVertex TraceVertices[6];
|
||||
RwImVertexIndex TraceIndexList[12];
|
||||
|
||||
bool CSpecialFX::bSnapShotActive;
|
||||
int32 CSpecialFX::SnapShotFrames;
|
||||
|
||||
void
|
||||
CSpecialFX::Init(void)
|
||||
|
@ -4,6 +4,7 @@ class CSpecialFX
|
||||
{
|
||||
public:
|
||||
static bool bSnapShotActive;
|
||||
static int32 SnapShotFrames;
|
||||
|
||||
static void Render(void);
|
||||
static void Update(void);
|
||||
@ -56,6 +57,10 @@ public:
|
||||
static void AddTrace(CVector*, CVector*);
|
||||
static void Render(void);
|
||||
static void Update(void);
|
||||
|
||||
//TODO(MIAMI)
|
||||
static void AddTrace(CVector *, CVector *, float, unsigned int, unsigned char) {}
|
||||
static void AddTrace(CVector *, CVector *, int32 weapontype, class CEntity *shooter) {}
|
||||
};
|
||||
|
||||
enum
|
||||
|
@ -113,7 +113,7 @@ void CBulletInfo::Update(void)
|
||||
CEntity* pHitEntity;
|
||||
if (CWorld::ProcessLineOfSight(vecOldPos, vecNewPos, point, pHitEntity, true, true, true, true, true, false, false, true)) {
|
||||
if (pBullet->m_pSource && (pHitEntity->IsPed() || pHitEntity->IsVehicle()))
|
||||
CStats::InstantHitsHitByPlayer++;
|
||||
CStats::BulletsThatHit++;
|
||||
|
||||
CWeapon::CheckForShootingVehicleOccupant(&pHitEntity, &point, pBullet->m_eWeaponType, vecOldPos, vecNewPos);
|
||||
if (pHitEntity->IsPed()) {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -22,6 +22,8 @@ public:
|
||||
uint32 m_nTimer;
|
||||
bool m_bAddRotOffset;
|
||||
|
||||
static bool bPhotographHasBeenTaken;
|
||||
|
||||
CWeapon() {
|
||||
m_bAddRotOffset = false;
|
||||
}
|
||||
@ -41,6 +43,7 @@ public:
|
||||
bool FireMelee (CEntity *shooter, CVector &fireSource);
|
||||
bool FireInstantHit(CEntity *shooter, CVector *fireSource);
|
||||
|
||||
static void AddGunFlashBigGuns(CVector start, CVector end);
|
||||
void AddGunshell (CEntity *shooter, CVector const &source, CVector2D const &direction, float size);
|
||||
void DoBulletImpact(CEntity *shooter, CEntity *victim, CVector *source, CVector *target, CColPoint *point, CVector2D ahead);
|
||||
|
||||
@ -50,7 +53,9 @@ public:
|
||||
static void GenerateFlameThrowerParticles(CVector pos, CVector dir);
|
||||
|
||||
bool FireAreaEffect (CEntity *shooter, CVector *fireSource);
|
||||
bool LaserScopeDot (CVector *pOutPos, float *pOutSize);
|
||||
bool FireSniper (CEntity *shooter);
|
||||
bool TakePhotograph (CEntity *shooter);
|
||||
bool FireM16_1stPerson (CEntity *shooter);
|
||||
bool FireInstantHitFromCar(CVehicle *shooter, bool left, bool right);
|
||||
|
||||
@ -68,14 +73,12 @@ public:
|
||||
bool HitsGround(CEntity *holder, CVector *fireSource, CEntity *aimingTo);
|
||||
static void BlowUpExplosiveThings(CEntity *thing);
|
||||
bool HasWeaponAmmoToBeUsed(void);
|
||||
static void AddGunFlashBigGuns(CVector, CVector);
|
||||
|
||||
static bool IsShotgun(int weapon) { return weapon == WEAPONTYPE_SHOTGUN || weapon == WEAPONTYPE_SPAS12_SHOTGUN || weapon == WEAPONTYPE_STUBBY_SHOTGUN; }
|
||||
|
||||
// TODO(Miami): Is that still used?
|
||||
static bool ProcessLineOfSight(CVector const &point1, CVector const &point2, CColPoint &point, CEntity *&entity, eWeaponType type, CEntity *shooter, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects);
|
||||
|
||||
static void CheckForShootingVehicleOccupant(CEntity**, CColPoint*, eWeaponType, CVector const&, CVector const&);
|
||||
static void CheckForShootingVehicleOccupant(CEntity **victim, CColPoint *point, eWeaponType weapon, CVector const& source, CVector const& target);
|
||||
|
||||
#ifdef COMPATIBLE_SAVES
|
||||
void Save(uint8*& buf);
|
||||
|
@ -3,6 +3,9 @@
|
||||
#include "WeaponEffects.h"
|
||||
#include "TxdStore.h"
|
||||
#include "Sprite.h"
|
||||
#include "PlayerPed.h"
|
||||
#include "World.h"
|
||||
#include "WeaponType.h"
|
||||
|
||||
RwTexture *gpCrossHairTex;
|
||||
RwRaster *gpCrossHairRaster;
|
||||
@ -24,10 +27,10 @@ CWeaponEffects::Init(void)
|
||||
{
|
||||
gCrossHair.m_bActive = false;
|
||||
gCrossHair.m_vecPos = CVector(0.0f, 0.0f, 0.0f);
|
||||
gCrossHair.m_nRed = 0;
|
||||
gCrossHair.m_nRed = 255;
|
||||
gCrossHair.m_nGreen = 0;
|
||||
gCrossHair.m_nBlue = 0;
|
||||
gCrossHair.m_nAlpha = 255;
|
||||
gCrossHair.m_nAlpha = 127;
|
||||
gCrossHair.m_fSize = 1.0f;
|
||||
gCrossHair.m_fRotation = 0.0f;
|
||||
|
||||
@ -46,9 +49,7 @@ void
|
||||
CWeaponEffects::Shutdown(void)
|
||||
{
|
||||
RwTextureDestroy(gpCrossHairTex);
|
||||
#ifdef GTA3_1_1_PATCH
|
||||
gpCrossHairTex = nil;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
@ -56,10 +57,6 @@ CWeaponEffects::MarkTarget(CVector pos, uint8 red, uint8 green, uint8 blue, uint
|
||||
{
|
||||
gCrossHair.m_bActive = true;
|
||||
gCrossHair.m_vecPos = pos;
|
||||
gCrossHair.m_nRed = red;
|
||||
gCrossHair.m_nGreen = green;
|
||||
gCrossHair.m_nBlue = blue;
|
||||
gCrossHair.m_nAlpha = alpha;
|
||||
gCrossHair.m_fSize = size;
|
||||
}
|
||||
|
||||
@ -72,12 +69,32 @@ CWeaponEffects::ClearCrossHair(void)
|
||||
void
|
||||
CWeaponEffects::Render(void)
|
||||
{
|
||||
static float aCrossHairSize[WEAPONTYPE_TOTALWEAPONS] =
|
||||
{
|
||||
1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
|
||||
0.4f, 0.4f,
|
||||
0.5f,
|
||||
0.3f,
|
||||
0.9f, 0.9f, 0.9f,
|
||||
0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f,
|
||||
0.1f, 0.1f,
|
||||
1.0f,
|
||||
0.6f,
|
||||
0.7f,
|
||||
0.0f, 0.0f
|
||||
};
|
||||
|
||||
|
||||
|
||||
if ( gCrossHair.m_bActive )
|
||||
{
|
||||
float size = aCrossHairSize[FindPlayerPed()->GetWeapon()->m_eWeaponType];
|
||||
|
||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)FALSE);
|
||||
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void *)FALSE);
|
||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)TRUE);
|
||||
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void *)rwBLENDONE);
|
||||
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void *)rwBLENDONE);
|
||||
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void *)rwBLENDSRCALPHA);
|
||||
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void *)rwBLENDINVDESTALPHA);
|
||||
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, (void *)gpCrossHairRaster);
|
||||
|
||||
RwV3d pos;
|
||||
@ -85,15 +102,25 @@ CWeaponEffects::Render(void)
|
||||
if ( CSprite::CalcScreenCoors(gCrossHair.m_vecPos, &pos, &w, &h, true) )
|
||||
{
|
||||
float recipz = 1.0f / pos.z;
|
||||
CSprite::RenderOneXLUSprite(pos.x, pos.y, pos.z,
|
||||
gCrossHair.m_fSize * w, gCrossHair.m_fSize * h,
|
||||
gCrossHair.m_nRed, gCrossHair.m_nGreen, gCrossHair.m_nBlue, 255,
|
||||
recipz, 255);
|
||||
CSprite::RenderOneXLUSprite_Rotate_Aspect(pos.x, pos.y, pos.z,
|
||||
w, h,
|
||||
255, 88, 100, 158,
|
||||
recipz, gCrossHair.m_fRotation, gCrossHair.m_nAlpha);
|
||||
|
||||
float recipz2 = 1.0f / pos.z;
|
||||
|
||||
CSprite::RenderOneXLUSprite_Rotate_Aspect(pos.x, pos.y, pos.z,
|
||||
size*w, size*h,
|
||||
107, 134, 247, 158,
|
||||
recipz2, TWOPI - gCrossHair.m_fRotation, gCrossHair.m_nAlpha);
|
||||
|
||||
gCrossHair.m_fRotation += 0.02f;
|
||||
if ( gCrossHair.m_fRotation > TWOPI )
|
||||
gCrossHair.m_fRotation = 0.0;
|
||||
}
|
||||
|
||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)FALSE);
|
||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)FALSE);
|
||||
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void *)rwBLENDSRCALPHA);
|
||||
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void *)rwBLENDINVSRCALPHA);
|
||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)TRUE);
|
||||
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void *)TRUE);
|
||||
}
|
||||
}
|
@ -9,16 +9,57 @@
|
||||
#include "ModelInfo.h"
|
||||
#include "ModelIndices.h"
|
||||
|
||||
uint16 CWeaponInfo::ms_aReloadSampleTime[WEAPONTYPE_TOTALWEAPONS] =
|
||||
{
|
||||
0, // UNARMED
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0, // GRENADE
|
||||
0, // DETONATEGRENADE
|
||||
0, // TEARGAS
|
||||
0, // MOLOTOV
|
||||
0, // ROCKET
|
||||
250, // COLT45
|
||||
250, // PYTHON
|
||||
650, // SHOTGUN
|
||||
650, // SPAS12 SHOTGUN
|
||||
650, // STUBBY SHOTGUN
|
||||
400, // TEC9
|
||||
400, // UZIhec
|
||||
400, // SILENCED_INGRAM
|
||||
400, // MP5
|
||||
300, // M16
|
||||
300, // AK47
|
||||
423, // SNIPERRIFLE
|
||||
423, // LASERSCOPE
|
||||
400, // ROCKETLAUNCHER
|
||||
0, // FLAMETHROWER
|
||||
0, // M60
|
||||
0, // MINIGUN
|
||||
0, // DETONATOR
|
||||
0, // HELICANNON
|
||||
0 // CAMERA
|
||||
};
|
||||
|
||||
// Yeah...
|
||||
int32 CWeaponInfo::ms_aMaxAmmoForWeapon[WEAPONTYPE_TOTALWEAPONS] = {
|
||||
int32 CWeaponInfo::ms_aMaxAmmoForWeapon[WEAPONTYPE_TOTALWEAPONS] =
|
||||
{
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1
|
||||
};
|
||||
|
||||
CWeaponInfo CWeaponInfo::ms_apWeaponInfos[WEAPONTYPE_TOTALWEAPONS];
|
||||
|
||||
// --MIAMI: Todo
|
||||
static char ms_aWeaponNames[][32] = {
|
||||
char CWeaponInfo::ms_aWeaponNames[WEAPONTYPE_TOTALWEAPONS][32] =
|
||||
{
|
||||
"Unarmed",
|
||||
"BrassKnuckle",
|
||||
"ScrewDriver",
|
||||
@ -61,7 +102,7 @@ static char ms_aWeaponNames[][32] = {
|
||||
CWeaponInfo*
|
||||
CWeaponInfo::GetWeaponInfo(eWeaponType weaponType)
|
||||
{
|
||||
return &CWeaponInfo::ms_apWeaponInfos[weaponType];
|
||||
return &ms_apWeaponInfos[weaponType];
|
||||
}
|
||||
|
||||
// --MIAMI: done except WEAPONTYPE_TOTALWEAPONS value
|
||||
|
@ -8,7 +8,9 @@ enum AssocGroupId;
|
||||
|
||||
class CWeaponInfo {
|
||||
static CWeaponInfo ms_apWeaponInfos[WEAPONTYPE_TOTALWEAPONS];
|
||||
static char ms_aWeaponNames[WEAPONTYPE_TOTALWEAPONS][32];
|
||||
public:
|
||||
static uint16 ms_aReloadSampleTime[WEAPONTYPE_TOTALWEAPONS];
|
||||
static int32 ms_aMaxAmmoForWeapon[WEAPONTYPE_TOTALWEAPONS];
|
||||
|
||||
eWeaponFire m_eWeaponFire;
|
||||
|
Loading…
Reference in New Issue
Block a user