mirror of
https://github.com/GTAmodding/re3.git
synced 2025-01-17 16:16:36 +00:00
Merge remote-tracking branch 'origin/miami' into lcs
# Conflicts: # src/modelinfo/PedModelInfo.cpp
This commit is contained in:
commit
519218572a
16 changed files with 194 additions and 91 deletions
|
@ -148,11 +148,10 @@ CCollision::SortOutCollisionAfterLoad(void)
|
||||||
void
|
void
|
||||||
CCollision::LoadCollisionScreen(eLevelName level)
|
CCollision::LoadCollisionScreen(eLevelName level)
|
||||||
{
|
{
|
||||||
static Const char *levelNames[4] = {
|
static Const char *levelNames[] = {
|
||||||
"",
|
"",
|
||||||
"IND_ZON",
|
"IND_ZON",
|
||||||
"COM_ZON",
|
"COM_ZON",
|
||||||
"SUB_ZON"
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Why twice?
|
// Why twice?
|
||||||
|
|
|
@ -245,10 +245,16 @@ CGame::InitialiseRenderWare(void)
|
||||||
|
|
||||||
#ifdef LIBRW
|
#ifdef LIBRW
|
||||||
#ifdef PS2_MATFX
|
#ifdef PS2_MATFX
|
||||||
rw::MatFX::modulateEnvMap = true;
|
rw::MatFX::envMapApplyLight = true;
|
||||||
|
rw::MatFX::envMapUseMatColor = true;
|
||||||
|
rw::MatFX::envMapFlipU = true;
|
||||||
#else
|
#else
|
||||||
rw::MatFX::modulateEnvMap = false;
|
rw::MatFX::envMapApplyLight = false;
|
||||||
|
rw::MatFX::envMapUseMatColor = false;
|
||||||
|
rw::MatFX::envMapFlipU = false;
|
||||||
#endif
|
#endif
|
||||||
|
rw::RGBA envcol = { 64, 64, 64, 255 };
|
||||||
|
rw::MatFX::envMapColor = envcol;
|
||||||
#else
|
#else
|
||||||
#ifdef PS2_MATFX
|
#ifdef PS2_MATFX
|
||||||
ReplaceMatFxCallback();
|
ReplaceMatFxCallback();
|
||||||
|
|
|
@ -105,7 +105,7 @@ CPools::CheckPoolsEmpty()
|
||||||
printf("pools have been cleared\n");
|
printf("pools have been cleared\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Thankfully unused, it would break the game!
|
||||||
void
|
void
|
||||||
CPools::MakeSureSlotInObjectPoolIsEmpty(int32 slot)
|
CPools::MakeSureSlotInObjectPoolIsEmpty(int32 slot)
|
||||||
{
|
{
|
||||||
|
|
|
@ -239,6 +239,75 @@ void GetTextureCorners(int32 x, int32 y, CVector2D *out)
|
||||||
out[3].y = RADAR_TILE_SIZE * (y);
|
out[3].y = RADAR_TILE_SIZE * (y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8 CRadar::CalculateBlipAlpha(float dist)
|
||||||
|
{
|
||||||
|
if (FrontEndMenuManager.m_bMenuMapActive)
|
||||||
|
return 255;
|
||||||
|
|
||||||
|
if (dist <= 1.0f)
|
||||||
|
return 255;
|
||||||
|
|
||||||
|
if (dist <= 10.0f)
|
||||||
|
return (128.0f * ((dist - 1.0f) / 9.0f)) + ((1.0f - (dist - 1.0f) / 9.0f) * 255.0f);
|
||||||
|
|
||||||
|
return 128;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CRadar::ChangeBlipBrightness(int32 i, int32 bright)
|
||||||
|
{
|
||||||
|
int index = GetActualBlipArrayIndex(i);
|
||||||
|
if (index != -1)
|
||||||
|
ms_RadarTrace[index].m_bDim = bright != 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CRadar::ChangeBlipColour(int32 i, int32 color)
|
||||||
|
{
|
||||||
|
int index = GetActualBlipArrayIndex(i);
|
||||||
|
if (index != -1)
|
||||||
|
ms_RadarTrace[index].m_nColor = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CRadar::ChangeBlipDisplay(int32 i, eBlipDisplay display)
|
||||||
|
{
|
||||||
|
int index = GetActualBlipArrayIndex(i);
|
||||||
|
if (index != -1)
|
||||||
|
ms_RadarTrace[index].m_eBlipDisplay = display;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CRadar::ChangeBlipScale(int32 i, int32 scale)
|
||||||
|
{
|
||||||
|
int index = GetActualBlipArrayIndex(i);
|
||||||
|
if (index != -1)
|
||||||
|
ms_RadarTrace[index].m_wScale = scale;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CRadar::ClearBlip(int32 i)
|
||||||
|
{
|
||||||
|
int index = GetActualBlipArrayIndex(i);
|
||||||
|
if (index != -1) {
|
||||||
|
SetRadarMarkerState(index, false);
|
||||||
|
ms_RadarTrace[index].m_bInUse = false;
|
||||||
|
ms_RadarTrace[index].m_eBlipType = BLIP_NONE;
|
||||||
|
ms_RadarTrace[index].m_eBlipDisplay = BLIP_DISPLAY_NEITHER;
|
||||||
|
ms_RadarTrace[index].m_eRadarSprite = RADAR_SPRITE_NONE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CRadar::ClearBlipForEntity(eBlipType type, int32 id)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < NUMRADARBLIPS; i++) {
|
||||||
|
if (type == ms_RadarTrace[i].m_eBlipType && id == ms_RadarTrace[i].m_nEntityHandle) {
|
||||||
|
SetRadarMarkerState(i, false);
|
||||||
|
ms_RadarTrace[i].m_bInUse = false;
|
||||||
|
ms_RadarTrace[i].m_eBlipType = BLIP_NONE;
|
||||||
|
ms_RadarTrace[i].m_eBlipDisplay = BLIP_DISPLAY_NEITHER;
|
||||||
|
ms_RadarTrace[i].m_eRadarSprite = RADAR_SPRITE_NONE;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Why not a proper clipping algorithm?
|
||||||
|
#ifdef THIS_IS_STUPID
|
||||||
|
|
||||||
bool IsPointInsideRadar(const CVector2D &point)
|
bool IsPointInsideRadar(const CVector2D &point)
|
||||||
{
|
{
|
||||||
|
@ -319,74 +388,6 @@ int LineRadarBoxCollision(CVector2D &out, const CVector2D &p1, const CVector2D &
|
||||||
return edge;
|
return edge;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 CRadar::CalculateBlipAlpha(float dist)
|
|
||||||
{
|
|
||||||
if (FrontEndMenuManager.m_bMenuMapActive)
|
|
||||||
return 255;
|
|
||||||
|
|
||||||
if (dist <= 1.0f)
|
|
||||||
return 255;
|
|
||||||
|
|
||||||
if (dist <= 10.0f)
|
|
||||||
return (128.0f * ((dist - 1.0f) / 9.0f)) + ((1.0f - (dist - 1.0f) / 9.0f) * 255.0f);
|
|
||||||
|
|
||||||
return 128;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CRadar::ChangeBlipBrightness(int32 i, int32 bright)
|
|
||||||
{
|
|
||||||
int index = GetActualBlipArrayIndex(i);
|
|
||||||
if (index != -1)
|
|
||||||
ms_RadarTrace[index].m_bDim = bright != 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CRadar::ChangeBlipColour(int32 i, int32 color)
|
|
||||||
{
|
|
||||||
int index = GetActualBlipArrayIndex(i);
|
|
||||||
if (index != -1)
|
|
||||||
ms_RadarTrace[index].m_nColor = color;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CRadar::ChangeBlipDisplay(int32 i, eBlipDisplay display)
|
|
||||||
{
|
|
||||||
int index = GetActualBlipArrayIndex(i);
|
|
||||||
if (index != -1)
|
|
||||||
ms_RadarTrace[index].m_eBlipDisplay = display;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CRadar::ChangeBlipScale(int32 i, int32 scale)
|
|
||||||
{
|
|
||||||
int index = GetActualBlipArrayIndex(i);
|
|
||||||
if (index != -1)
|
|
||||||
ms_RadarTrace[index].m_wScale = scale;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CRadar::ClearBlip(int32 i)
|
|
||||||
{
|
|
||||||
int index = GetActualBlipArrayIndex(i);
|
|
||||||
if (index != -1) {
|
|
||||||
SetRadarMarkerState(index, false);
|
|
||||||
ms_RadarTrace[index].m_bInUse = false;
|
|
||||||
ms_RadarTrace[index].m_eBlipType = BLIP_NONE;
|
|
||||||
ms_RadarTrace[index].m_eBlipDisplay = BLIP_DISPLAY_NEITHER;
|
|
||||||
ms_RadarTrace[index].m_eRadarSprite = RADAR_SPRITE_NONE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CRadar::ClearBlipForEntity(eBlipType type, int32 id)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < NUMRADARBLIPS; i++) {
|
|
||||||
if (type == ms_RadarTrace[i].m_eBlipType && id == ms_RadarTrace[i].m_nEntityHandle) {
|
|
||||||
SetRadarMarkerState(i, false);
|
|
||||||
ms_RadarTrace[i].m_bInUse = false;
|
|
||||||
ms_RadarTrace[i].m_eBlipType = BLIP_NONE;
|
|
||||||
ms_RadarTrace[i].m_eBlipDisplay = BLIP_DISPLAY_NEITHER;
|
|
||||||
ms_RadarTrace[i].m_eRadarSprite = RADAR_SPRITE_NONE;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Why not a proper clipping algorithm?
|
|
||||||
int CRadar::ClipRadarPoly(CVector2D *poly, const CVector2D *rect)
|
int CRadar::ClipRadarPoly(CVector2D *poly, const CVector2D *rect)
|
||||||
{
|
{
|
||||||
CVector2D corners[4] = {
|
CVector2D corners[4] = {
|
||||||
|
@ -465,6 +466,50 @@ int CRadar::ClipRadarPoly(CVector2D *poly, const CVector2D *rect)
|
||||||
|
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
|
||||||
|
int
|
||||||
|
ClipPolyPlane(const CVector2D *in, int nin, CVector2D *out, CVector *plane)
|
||||||
|
{
|
||||||
|
int j;
|
||||||
|
int nout;
|
||||||
|
int x1, x2;
|
||||||
|
float d1, d2, t;
|
||||||
|
|
||||||
|
nout = 0;
|
||||||
|
for(j = 0; j < nin; j++){
|
||||||
|
x1 = j;
|
||||||
|
x2 = (j+1) % nin;
|
||||||
|
|
||||||
|
d1 = plane->x*in[x1].x + plane->y*in[x1].y + plane->z;
|
||||||
|
d2 = plane->x*in[x2].x + plane->y*in[x2].y + plane->z;
|
||||||
|
if(d1*d2 < 0.0f){
|
||||||
|
t = d1/(d1 - d2);
|
||||||
|
out[nout++] = in[x1]*(1.0f-t) + in[x2]*t;
|
||||||
|
}
|
||||||
|
if(d2 >= 0.0f)
|
||||||
|
out[nout++] = in[x2];
|
||||||
|
}
|
||||||
|
return nout;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CRadar::ClipRadarPoly(CVector2D *poly, const CVector2D *rect)
|
||||||
|
{
|
||||||
|
CVector planes[4] = {
|
||||||
|
CVector(-1.0f, 0.0f, 1.0f),
|
||||||
|
CVector( 1.0f, 0.0f, 1.0f),
|
||||||
|
CVector(0.0f, -1.0f, 1.0f),
|
||||||
|
CVector(0.0f, 1.0f, 1.0f)
|
||||||
|
};
|
||||||
|
CVector2D tmp[8];
|
||||||
|
int n;
|
||||||
|
if(n = ClipPolyPlane(rect, 4, tmp, &planes[0]), n == 0) return 0;
|
||||||
|
if(n = ClipPolyPlane(tmp, n, poly, &planes[1]), n == 0) return 0;
|
||||||
|
if(n = ClipPolyPlane(poly, n, tmp, &planes[2]), n == 0) return 0;
|
||||||
|
if(n = ClipPolyPlane(tmp, n, poly, &planes[3]), n == 0) return 0;
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
bool CRadar::DisplayThisBlip(int32 counter)
|
bool CRadar::DisplayThisBlip(int32 counter)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1763,7 +1763,13 @@ CStreaming::StreamVehiclesAndPeds(void)
|
||||||
for(i = 0; i < CCarCtrl::TOTAL_CUSTOM_CLASSES; i++){
|
for(i = 0; i < CCarCtrl::TOTAL_CUSTOM_CLASSES; i++){
|
||||||
if(CCarCtrl::NumRequestsOfCarRating[i] > maxReq &&
|
if(CCarCtrl::NumRequestsOfCarRating[i] > maxReq &&
|
||||||
((i == 0 && zone.carThreshold[0] != 0) ||
|
((i == 0 && zone.carThreshold[0] != 0) ||
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
(i < CCarCtrl::NUM_CAR_CLASSES && zone.carThreshold[i] != zone.carThreshold[i-1]) ||
|
||||||
|
(i == CCarCtrl::NUM_CAR_CLASSES && zone.boatThreshold[i - CCarCtrl::NUM_CAR_CLASSES] != 0) ||
|
||||||
|
(i > CCarCtrl::NUM_CAR_CLASSES && i < CCarCtrl::TOTAL_CUSTOM_CLASSES && zone.boatThreshold[i - CCarCtrl::NUM_CAR_CLASSES] != zone.boatThreshold[i - CCarCtrl::NUM_CAR_CLASSES - 1]))) {
|
||||||
|
#else
|
||||||
(i != 0 && zone.carThreshold[i] != zone.carThreshold[i-1]))) {
|
(i != 0 && zone.carThreshold[i] != zone.carThreshold[i-1]))) {
|
||||||
|
#endif
|
||||||
maxReq = CCarCtrl::NumRequestsOfCarRating[i];
|
maxReq = CCarCtrl::NumRequestsOfCarRating[i];
|
||||||
mostRequestedRating = i;
|
mostRequestedRating = i;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1297,10 +1297,12 @@ void
|
||||||
RenderEffects_new(void)
|
RenderEffects_new(void)
|
||||||
{
|
{
|
||||||
PUSH_RENDERGROUP("RenderEffects_new");
|
PUSH_RENDERGROUP("RenderEffects_new");
|
||||||
|
/* // stupid to do this before the whole world is drawn!
|
||||||
CShadows::RenderStaticShadows();
|
CShadows::RenderStaticShadows();
|
||||||
CShadows::RenderStoredShadows();
|
CShadows::RenderStoredShadows();
|
||||||
CSkidmarks::Render();
|
CSkidmarks::Render();
|
||||||
CRubbish::Render();
|
CRubbish::Render();
|
||||||
|
*/
|
||||||
|
|
||||||
// these aren't really effects
|
// these aren't really effects
|
||||||
DefinedState();
|
DefinedState();
|
||||||
|
@ -1323,6 +1325,13 @@ if(gbRenderFadingInEntities)
|
||||||
CRenderer::RenderFadingInEntities();
|
CRenderer::RenderFadingInEntities();
|
||||||
|
|
||||||
// actual effects here
|
// actual effects here
|
||||||
|
|
||||||
|
// from above
|
||||||
|
CShadows::RenderStaticShadows();
|
||||||
|
CShadows::RenderStoredShadows();
|
||||||
|
CSkidmarks::Render();
|
||||||
|
CRubbish::Render();
|
||||||
|
|
||||||
CGlass::Render();
|
CGlass::Render();
|
||||||
// CMattRenderer::ResetRenderStates
|
// CMattRenderer::ResetRenderStates
|
||||||
DefinedState();
|
DefinedState();
|
||||||
|
|
|
@ -1029,6 +1029,11 @@ extern bool gbRenderWorld2;
|
||||||
#ifndef MASTER
|
#ifndef MASTER
|
||||||
DebugMenuAddVarBool8("Render", "Occlusion debug", &bDispayOccDebugStuff, nil);
|
DebugMenuAddVarBool8("Render", "Occlusion debug", &bDispayOccDebugStuff, nil);
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef LIBRW
|
||||||
|
DebugMenuAddVarBool32("Render", "MatFX env map apply light", &rw::MatFX::envMapApplyLight, nil);
|
||||||
|
DebugMenuAddVarBool32("Render", "MatFX env map flip U", &rw::MatFX::envMapFlipU, nil);
|
||||||
|
DebugMenuAddVarBool32("Render", "MatFX env map use matcolor", &rw::MatFX::envMapUseMatColor, nil);
|
||||||
|
#endif
|
||||||
#ifdef EXTENDED_PIPELINES
|
#ifdef EXTENDED_PIPELINES
|
||||||
static const char *worldpipenames[] = { "PSP", "PS2", "Mobile" };
|
static const char *worldpipenames[] = { "PSP", "PS2", "Mobile" };
|
||||||
e = DebugMenuAddVar("Render", "World Rendering", &CustomPipes::WorldPipeSwitch, nil,
|
e = DebugMenuAddVar("Render", "World Rendering", &CustomPipes::WorldPipeSwitch, nil,
|
||||||
|
|
|
@ -358,7 +358,7 @@ CreateVehiclePipe(void)
|
||||||
{
|
{
|
||||||
#include "shaders/obj/neoVehicle_frag.inc"
|
#include "shaders/obj/neoVehicle_frag.inc"
|
||||||
#include "shaders/obj/neoVehicle_vert.inc"
|
#include "shaders/obj/neoVehicle_vert.inc"
|
||||||
const char *vs[] = { shaderDecl, header_vert_src, neoVehicle_vert_src, nil };
|
const char *vs[] = { shaderDecl, "#define DIRECTIONALS\n", header_vert_src, neoVehicle_vert_src, nil };
|
||||||
const char *fs[] = { shaderDecl, header_frag_src, neoVehicle_frag_src, nil };
|
const char *fs[] = { shaderDecl, header_frag_src, neoVehicle_frag_src, nil };
|
||||||
neoVehicleShader = Shader::create(vs, fs);
|
neoVehicleShader = Shader::create(vs, fs);
|
||||||
assert(neoVehicleShader);
|
assert(neoVehicleShader);
|
||||||
|
@ -738,7 +738,7 @@ CreateRimLightPipes(void)
|
||||||
{
|
{
|
||||||
#include "shaders/obj/simple_frag.inc"
|
#include "shaders/obj/simple_frag.inc"
|
||||||
#include "shaders/obj/neoRimSkin_vert.inc"
|
#include "shaders/obj/neoRimSkin_vert.inc"
|
||||||
const char *vs[] = { shaderDecl, header_vert_src, neoRimSkin_vert_src, nil };
|
const char *vs[] = { shaderDecl, "#define DIRECTIONALS\n", header_vert_src, neoRimSkin_vert_src, nil };
|
||||||
const char *fs[] = { shaderDecl, header_frag_src, simple_frag_src, nil };
|
const char *fs[] = { shaderDecl, header_frag_src, simple_frag_src, nil };
|
||||||
neoRimSkinShader = Shader::create(vs, fs);
|
neoRimSkinShader = Shader::create(vs, fs);
|
||||||
assert(neoRimSkinShader);
|
assert(neoRimSkinShader);
|
||||||
|
@ -747,7 +747,7 @@ CreateRimLightPipes(void)
|
||||||
{
|
{
|
||||||
#include "shaders/obj/simple_frag.inc"
|
#include "shaders/obj/simple_frag.inc"
|
||||||
#include "shaders/obj/neoRim_vert.inc"
|
#include "shaders/obj/neoRim_vert.inc"
|
||||||
const char *vs[] = { shaderDecl, header_vert_src, neoRim_vert_src, nil };
|
const char *vs[] = { shaderDecl, "#define DIRECTIONALS\n", header_vert_src, neoRim_vert_src, nil };
|
||||||
const char *fs[] = { shaderDecl, header_frag_src, simple_frag_src, nil };
|
const char *fs[] = { shaderDecl, header_frag_src, simple_frag_src, nil };
|
||||||
neoRimShader = Shader::create(vs, fs);
|
neoRimShader = Shader::create(vs, fs);
|
||||||
assert(neoRimShader);
|
assert(neoRimShader);
|
||||||
|
|
|
@ -51,6 +51,9 @@ CPostFX::InitOnce(void)
|
||||||
void
|
void
|
||||||
CPostFX::Open(RwCamera *cam)
|
CPostFX::Open(RwCamera *cam)
|
||||||
{
|
{
|
||||||
|
if(pFrontBuffer)
|
||||||
|
Close();
|
||||||
|
|
||||||
uint32 width = Pow(2.0f, int32(log2(RwRasterGetWidth (RwCameraGetRaster(cam))))+1);
|
uint32 width = Pow(2.0f, int32(log2(RwRasterGetWidth (RwCameraGetRaster(cam))))+1);
|
||||||
uint32 height = Pow(2.0f, int32(log2(RwRasterGetHeight(RwCameraGetRaster(cam))))+1);
|
uint32 height = Pow(2.0f, int32(log2(RwRasterGetHeight(RwCameraGetRaster(cam))))+1);
|
||||||
uint32 depth = RwRasterGetDepth(RwCameraGetRaster(cam));
|
uint32 depth = RwRasterGetDepth(RwCameraGetRaster(cam));
|
||||||
|
|
|
@ -234,5 +234,8 @@ CStinger::Process()
|
||||||
Remove();
|
Remove();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
if (bIsDeployed)
|
||||||
|
#endif
|
||||||
CheckForBurstTyres();
|
CheckForBurstTyres();
|
||||||
}
|
}
|
|
@ -911,10 +911,9 @@ CPopulation::MoveCarsAndPedsOutOfAbandonedZones()
|
||||||
void
|
void
|
||||||
CPopulation::ConvertAllObjectsToDummyObjects()
|
CPopulation::ConvertAllObjectsToDummyObjects()
|
||||||
{
|
{
|
||||||
int poolSize = CPools::GetObjectPool()->GetSize();
|
uint32 i = CPools::GetObjectPool()->GetSize();
|
||||||
for (int poolIndex = poolSize - 1; poolIndex >= 0; poolIndex--) {
|
while(i--) {
|
||||||
|
CObject *obj = CPools::GetObjectPool()->GetSlot(i);
|
||||||
CObject *obj = CPools::GetObjectPool()->GetSlot(poolIndex);
|
|
||||||
if (obj) {
|
if (obj) {
|
||||||
if (obj->CanBeDeleted())
|
if (obj->CanBeDeleted())
|
||||||
ConvertToDummyObject(obj);
|
ConvertToDummyObject(obj);
|
||||||
|
@ -1488,6 +1487,9 @@ CPopulation::PlaceGangMembersInCircle(ePedType pedType, int pedAmount, CVector c
|
||||||
if (CPedPlacement::IsPositionClearForPed(coors, circleR, -1, 0)) {
|
if (CPedPlacement::IsPositionClearForPed(coors, circleR, -1, 0)) {
|
||||||
int pedIdx = 0;
|
int pedIdx = 0;
|
||||||
CVector leaderPos;
|
CVector leaderPos;
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
bool createLeader = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
for (int i = 0; i < pedAmount; i++) {
|
for (int i = 0; i < pedAmount; i++) {
|
||||||
float angleMult = i + CGeneral::GetRandomNumberInRange(-0.2f, 0.2f);
|
float angleMult = i + CGeneral::GetRandomNumberInRange(-0.2f, 0.2f);
|
||||||
|
@ -1498,8 +1500,10 @@ CPopulation::PlaceGangMembersInCircle(ePedType pedType, int pedAmount, CVector c
|
||||||
float groundZ = CWorld::FindGroundZFor3DCoord(xOffset + coors.x, yOffset + coors.y, coors.z + 1.0, &foundGround) + 1.0f;
|
float groundZ = CWorld::FindGroundZFor3DCoord(xOffset + coors.x, yOffset + coors.y, coors.z + 1.0, &foundGround) + 1.0f;
|
||||||
if (foundGround) {
|
if (foundGround) {
|
||||||
CVector finalPos(coors.x + xOffset, coors.y + yOffset, coors.z > groundZ ? coors.z : groundZ);
|
CVector finalPos(coors.x + xOffset, coors.y + yOffset, coors.z > groundZ ? coors.z : groundZ);
|
||||||
|
#ifndef FIX_BUGS
|
||||||
if (i == 0)
|
const bool createLeader = i == 0;
|
||||||
|
#endif
|
||||||
|
if (createLeader)
|
||||||
leaderPos = finalPos;
|
leaderPos = finalPos;
|
||||||
|
|
||||||
int gangModel = ChooseGangOccupation(pedType - PEDTYPE_GANG1);
|
int gangModel = ChooseGangOccupation(pedType - PEDTYPE_GANG1);
|
||||||
|
@ -1522,9 +1526,9 @@ CPopulation::PlaceGangMembersInCircle(ePedType pedType, int pedAmount, CVector c
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool memberCanSeeLeader = i == 0 ? true : CWorld::GetIsLineOfSightClear(finalPos, leaderPos, true, false, false, false, false, false, false);
|
bool memberCanSeeLeader = createLeader ? true : CWorld::GetIsLineOfSightClear(finalPos, leaderPos, true, false, false, false, false, false, false);
|
||||||
|
|
||||||
bool notTooCloseToLeader = i == 0 ? true : !(Abs(finalPos.z - leaderPos.z) < 1.0f);
|
bool notTooCloseToLeader = createLeader ? true : !(Abs(finalPos.z - leaderPos.z) < 1.0f);
|
||||||
|
|
||||||
if (!foundObstacle && memberCanSeeLeader && notTooCloseToLeader) {
|
if (!foundObstacle && memberCanSeeLeader && notTooCloseToLeader) {
|
||||||
CPed* newPed = AddPed(pedType, gangModel, finalPos);
|
CPed* newPed = AddPed(pedType, gangModel, finalPos);
|
||||||
|
@ -1547,6 +1551,9 @@ CPopulation::PlaceGangMembersInCircle(ePedType pedType, int pedAmount, CVector c
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
createLeader = false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pedIdx >= 3) {
|
if (pedIdx >= 3) {
|
||||||
|
@ -1671,6 +1678,9 @@ CPopulation::PlaceMallPedsAsStationaryGroup(CVector const& coors, int32 group)
|
||||||
if (CPedPlacement::IsPositionClearForPed(coors, circleR, -1, 0)) {
|
if (CPedPlacement::IsPositionClearForPed(coors, circleR, -1, 0)) {
|
||||||
int pedIdx = 0;
|
int pedIdx = 0;
|
||||||
CVector leaderPos;
|
CVector leaderPos;
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
bool createLeader = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
for (int i = 0; i < pedAmount; i++) {
|
for (int i = 0; i < pedAmount; i++) {
|
||||||
float angleMult = i + CGeneral::GetRandomNumberInRange(-0.2f, 0.2f);
|
float angleMult = i + CGeneral::GetRandomNumberInRange(-0.2f, 0.2f);
|
||||||
|
@ -1682,7 +1692,10 @@ CPopulation::PlaceMallPedsAsStationaryGroup(CVector const& coors, int32 group)
|
||||||
if (foundGround) {
|
if (foundGround) {
|
||||||
CVector finalPos(coors.x + xOffset, coors.y + yOffset, coors.z > groundZ ? coors.z : groundZ);
|
CVector finalPos(coors.x + xOffset, coors.y + yOffset, coors.z > groundZ ? coors.z : groundZ);
|
||||||
|
|
||||||
if (i == 0)
|
#ifndef FIX_BUGS
|
||||||
|
const bool createLeader = i == 0;
|
||||||
|
#endif
|
||||||
|
if (createLeader)
|
||||||
leaderPos = finalPos;
|
leaderPos = finalPos;
|
||||||
|
|
||||||
int pedModel = ChooseCivilianOccupation(group);
|
int pedModel = ChooseCivilianOccupation(group);
|
||||||
|
@ -1706,9 +1719,9 @@ CPopulation::PlaceMallPedsAsStationaryGroup(CVector const& coors, int32 group)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool memberCanSeeLeader = i == 0 ? true : CWorld::GetIsLineOfSightClear(finalPos, leaderPos, true, false, false, false, false, false, false);
|
bool memberCanSeeLeader = createLeader ? true : CWorld::GetIsLineOfSightClear(finalPos, leaderPos, true, false, false, false, false, false, false);
|
||||||
|
|
||||||
bool notTooCloseToLeader = i == 0 ? true : !(Abs(finalPos.z - leaderPos.z) < 1.0f);
|
bool notTooCloseToLeader = createLeader ? true : !(Abs(finalPos.z - leaderPos.z) < 1.0f);
|
||||||
|
|
||||||
if (!foundObstacle && memberCanSeeLeader && notTooCloseToLeader) {
|
if (!foundObstacle && memberCanSeeLeader && notTooCloseToLeader) {
|
||||||
CPed *newPed = AddPed(pedModelInfo->m_pedType, pedModel, finalPos);
|
CPed *newPed = AddPed(pedModelInfo->m_pedType, pedModel, finalPos);
|
||||||
|
@ -1729,6 +1742,9 @@ CPopulation::PlaceMallPedsAsStationaryGroup(CVector const& coors, int32 group)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
createLeader = false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pedIdx >= 3) {
|
if (pedIdx >= 3) {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "Timecycle.h"
|
#include "Timecycle.h"
|
||||||
#include "skeleton.h"
|
#include "skeleton.h"
|
||||||
#include "Debug.h"
|
#include "Debug.h"
|
||||||
|
#include "MBlur.h"
|
||||||
#if !defined(FINAL) || defined(DEBUGMENU)
|
#if !defined(FINAL) || defined(DEBUGMENU)
|
||||||
#include "rtcharse.h"
|
#include "rtcharse.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -579,6 +580,12 @@ CameraSize(RwCamera * camera, RwRect * rect,
|
||||||
|
|
||||||
raster->width = zRaster->width = rect->w;
|
raster->width = zRaster->width = rect->w;
|
||||||
raster->height = zRaster->height = rect->h;
|
raster->height = zRaster->height = rect->h;
|
||||||
|
#endif
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
if(CMBlur::BlurOn){
|
||||||
|
CMBlur::MotionBlurClose();
|
||||||
|
CMBlur::MotionBlurOpen(camera);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4810,7 +4810,7 @@ CAutomobile::GetHeightAboveRoad(void)
|
||||||
void
|
void
|
||||||
CAutomobile::PlayCarHorn(void)
|
CAutomobile::PlayCarHorn(void)
|
||||||
{
|
{
|
||||||
int r;
|
uint32 r;
|
||||||
|
|
||||||
if (IsAlarmOn() || m_nCarHornTimer != 0)
|
if (IsAlarmOn() || m_nCarHornTimer != 0)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -2549,7 +2549,7 @@ CBike::GetHeightAboveRoad(void)
|
||||||
void
|
void
|
||||||
CBike::PlayCarHorn(void)
|
CBike::PlayCarHorn(void)
|
||||||
{
|
{
|
||||||
int r;
|
uint32 r;
|
||||||
|
|
||||||
if (IsAlarmOn() || m_nCarHornTimer != 0)
|
if (IsAlarmOn() || m_nCarHornTimer != 0)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1066,7 +1066,11 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource)
|
||||||
|
|
||||||
if ( info->m_nFiringRate >= 50 || !(++counter & 1) )
|
if ( info->m_nFiringRate >= 50 || !(++counter & 1) )
|
||||||
{
|
{
|
||||||
|
#ifdef FIX_BUGS
|
||||||
|
AddGunFlashBigGuns(*fireSource, target);
|
||||||
|
#else
|
||||||
AddGunFlashBigGuns(*fireSource, *fireSource + target);
|
AddGunFlashBigGuns(*fireSource, *fireSource + target);
|
||||||
|
#endif
|
||||||
|
|
||||||
CVector gunshellPos = *fireSource;
|
CVector gunshellPos = *fireSource;
|
||||||
gunshellPos -= CVector(0.65f*ahead.x, 0.65f*ahead.y, 0.0f);
|
gunshellPos -= CVector(0.65f*ahead.x, 0.65f*ahead.y, 0.0f);
|
||||||
|
|
2
vendor/librw
vendored
2
vendor/librw
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 8b2caf8f86b4f793d07fbc6b7d0bd4aafd22162f
|
Subproject commit af20de45226f5152a035866da32517466e81142d
|
Loading…
Reference in a new issue