mirror of
https://git.rip/DMCA_FUCKER/re3.git
synced 2024-11-06 05:55:55 +00:00
Merge remote-tracking branch 'origin/miami' into lcs
* origin/miami: more securom fixes move stuff back into class; securom comments More font fixes fix fix CreateInstance virtual overload order escalator fix ProcessWheel bug
This commit is contained in:
commit
94f25a429f
|
@ -1729,7 +1729,7 @@ void CReplay::SaveReplayToHD(void)
|
||||||
CFileMgr::SetDir("");
|
CFileMgr::SetDir("");
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayReplayFromHD(void)
|
void CReplay::PlayReplayFromHD(void)
|
||||||
{
|
{
|
||||||
CFileMgr::SetDirMyDocuments();
|
CFileMgr::SetDirMyDocuments();
|
||||||
int fr = CFileMgr::OpenFile("replay.rep", "rb");
|
int fr = CFileMgr::OpenFile("replay.rep", "rb");
|
||||||
|
@ -1748,17 +1748,17 @@ void PlayReplayFromHD(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int slot;
|
int slot;
|
||||||
for (slot = 0; CFileMgr::Read(fr, (char*)CReplay::Buffers[slot], sizeof(CReplay::Buffers[slot])); slot++)
|
for (slot = 0; CFileMgr::Read(fr, (char*)Buffers[slot], sizeof(Buffers[slot])); slot++)
|
||||||
CReplay::BufferStatus[slot] = CReplay::REPLAYBUFFER_PLAYBACK;
|
BufferStatus[slot] = REPLAYBUFFER_PLAYBACK;
|
||||||
CReplay::BufferStatus[slot - 1] = CReplay::REPLAYBUFFER_RECORD;
|
BufferStatus[slot - 1] = REPLAYBUFFER_RECORD;
|
||||||
while (slot < CReplay::NUM_REPLAYBUFFERS)
|
while (slot < NUM_REPLAYBUFFERS)
|
||||||
CReplay::BufferStatus[slot++] = CReplay::REPLAYBUFFER_UNUSED;
|
BufferStatus[slot++] = REPLAYBUFFER_UNUSED;
|
||||||
CFileMgr::CloseFile(fr);
|
CFileMgr::CloseFile(fr);
|
||||||
CFileMgr::SetDir("");
|
CFileMgr::SetDir("");
|
||||||
CReplay::TriggerPlayback(CReplay::REPLAYCAMMODE_ASSTORED, 0.0f, 0.0f, 0.0f, false);
|
TriggerPlayback(REPLAYCAMMODE_ASSTORED, 0.0f, 0.0f, 0.0f, false);
|
||||||
CReplay::bPlayingBackFromFile = true;
|
bPlayingBackFromFile = true;
|
||||||
CReplay::bAllowLookAroundCam = true;
|
bAllowLookAroundCam = true;
|
||||||
CReplay::StreamAllNecessaryCarsAndPeds();
|
StreamAllNecessaryCarsAndPeds();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CReplay::StreamAllNecessaryCarsAndPeds(void)
|
void CReplay::StreamAllNecessaryCarsAndPeds(void)
|
||||||
|
|
|
@ -64,8 +64,6 @@ struct CStoredDetailedAnimationState
|
||||||
uint8 aGroupId2[NUM_PARTIAL_ANIMS_IN_REPLAY];
|
uint8 aGroupId2[NUM_PARTIAL_ANIMS_IN_REPLAY];
|
||||||
};
|
};
|
||||||
|
|
||||||
void PlayReplayFromHD(void);
|
|
||||||
|
|
||||||
#ifdef GTA_REPLAY
|
#ifdef GTA_REPLAY
|
||||||
#define REPLAY_STUB
|
#define REPLAY_STUB
|
||||||
#else
|
#else
|
||||||
|
@ -410,12 +408,10 @@ private:
|
||||||
static void EmptyAllPools(void);
|
static void EmptyAllPools(void);
|
||||||
static void MarkEverythingAsNew(void);
|
static void MarkEverythingAsNew(void);
|
||||||
static void SaveReplayToHD(void);
|
static void SaveReplayToHD(void);
|
||||||
|
static void PlayReplayFromHD(void); // out of class in III PC and later because of SecuROM
|
||||||
static void FindFirstFocusCoordinate(CVector *coord);
|
static void FindFirstFocusCoordinate(CVector *coord);
|
||||||
static void ProcessLookAroundCam(void);
|
static void ProcessLookAroundCam(void);
|
||||||
static size_t FindSizeOfPacket(uint8);
|
static size_t FindSizeOfPacket(uint8);
|
||||||
static void GoToNextBlock(void);
|
static void GoToNextBlock(void);
|
||||||
|
|
||||||
/* Absolute nonsense, but how could this function end up being outside of class? */
|
|
||||||
friend void PlayReplayFromHD(void);
|
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
|
@ -462,7 +462,7 @@ bool CGame::Initialise(const char* datFile)
|
||||||
TestModelIndices();
|
TestModelIndices();
|
||||||
|
|
||||||
LoadingScreen("Loading the Game", "Setup water", nil);
|
LoadingScreen("Loading the Game", "Setup water", nil);
|
||||||
WaterLevelInitialise("DATA\\WATER.DAT");
|
CWaterLevel::Initialise("DATA\\WATER.DAT");
|
||||||
TheConsole.Init();
|
TheConsole.Init();
|
||||||
CDraw::SetFOV(120.0f);
|
CDraw::SetFOV(120.0f);
|
||||||
CDraw::ms_fLODDistance = 500.0f;
|
CDraw::ms_fLODDistance = 500.0f;
|
||||||
|
|
|
@ -274,13 +274,13 @@ CFont::Initialise(void)
|
||||||
SetScale(1.0f, 1.0f);
|
SetScale(1.0f, 1.0f);
|
||||||
SetSlantRefPoint(SCREEN_WIDTH, 0.0f);
|
SetSlantRefPoint(SCREEN_WIDTH, 0.0f);
|
||||||
SetSlant(0.0f);
|
SetSlant(0.0f);
|
||||||
SetColor(CRGBA(0xFF, 0xFF, 0xFF, 0));
|
SetColor(CRGBA(255, 255, 255, 0));
|
||||||
SetJustifyOff();
|
SetJustifyOff();
|
||||||
SetCentreOff();
|
SetCentreOff();
|
||||||
SetWrapx(SCREEN_WIDTH);
|
SetWrapx(SCREEN_WIDTH);
|
||||||
SetCentreSize(SCREEN_WIDTH);
|
SetCentreSize(SCREEN_WIDTH);
|
||||||
SetBackgroundOff();
|
SetBackgroundOff();
|
||||||
SetBackgroundColor(CRGBA(0x80, 0x80, 0x80, 0x80));
|
SetBackgroundColor(CRGBA(128, 128, 128, 128));
|
||||||
SetBackGroundOnlyTextOff();
|
SetBackGroundOnlyTextOff();
|
||||||
SetPropOn();
|
SetPropOn();
|
||||||
SetFontStyle(FONT_BANK);
|
SetFontStyle(FONT_BANK);
|
||||||
|
@ -614,10 +614,10 @@ CFont::PrintString(float xstart, float ystart, wchar *s)
|
||||||
x = xstart;
|
x = xstart;
|
||||||
#ifdef MORE_LANGUAGES
|
#ifdef MORE_LANGUAGES
|
||||||
if (IsJapaneseFont())
|
if (IsJapaneseFont())
|
||||||
y += 32.0f * CFont::Details.scaleY / 2.75f + 2.0f * CFont::Details.scaleY;
|
y += 32.0f * Details.scaleY / 2.75f + 2.0f * Details.scaleY;
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
y += 32.0f * CFont::Details.scaleY * 0.5f + 2.0f * CFont::Details.scaleY;
|
y += 32.0f * Details.scaleY * 0.5f + 2.0f * Details.scaleY;
|
||||||
start = s;
|
start = s;
|
||||||
}else
|
}else
|
||||||
break;
|
break;
|
||||||
|
@ -653,7 +653,7 @@ CFont::PrintString(float xstart, float ystart, wchar *s)
|
||||||
else
|
else
|
||||||
x = 0.0f;
|
x = 0.0f;
|
||||||
|
|
||||||
y += 32.0f * CFont::Details.scaleY / 2.75f + 2.0f * CFont::Details.scaleY;
|
y += 32.0f * Details.scaleY / 2.75f + 2.0f * Details.scaleY;
|
||||||
numSpaces = 0;
|
numSpaces = 0;
|
||||||
first = true;
|
first = true;
|
||||||
lineLength = 0.0f;
|
lineLength = 0.0f;
|
||||||
|
@ -676,7 +676,7 @@ CFont::PrintString(float xstart, float ystart, wchar *s)
|
||||||
x = xstart;
|
x = xstart;
|
||||||
else
|
else
|
||||||
x = 0.0f;
|
x = 0.0f;
|
||||||
y += 32.0f * CFont::Details.scaleY / 2.75f + 2.0f * CFont::Details.scaleY;
|
y += 32.0f * Details.scaleY / 2.75f + 2.0f * Details.scaleY;
|
||||||
numSpaces = 0;
|
numSpaces = 0;
|
||||||
first = true;
|
first = true;
|
||||||
lineLength = 0.0f;
|
lineLength = 0.0f;
|
||||||
|
@ -753,10 +753,10 @@ CFont::GetNumberLines(float xstart, float ystart, wchar *s)
|
||||||
// Why even?
|
// Why even?
|
||||||
#ifdef MORE_LANGUAGES
|
#ifdef MORE_LANGUAGES
|
||||||
if (IsJapanese())
|
if (IsJapanese())
|
||||||
y += 32.0f * CFont::Details.scaleY / 2.75f + 2.0f * CFont::Details.scaleY;
|
y += 32.0f * Details.scaleY / 2.75f + 2.0f * Details.scaleY;
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
y += 32.0f * CFont::Details.scaleY * 0.5f + 2.0f * CFont::Details.scaleY;
|
y += 32.0f * Details.scaleY * 0.5f + 2.0f * Details.scaleY;
|
||||||
}else{
|
}else{
|
||||||
// still space in current line
|
// still space in current line
|
||||||
t = GetNextSpace(s);
|
t = GetNextSpace(s);
|
||||||
|
@ -827,7 +827,7 @@ CFont::GetTextRect(CRect *rect, float xstart, float ystart, wchar *s)
|
||||||
else
|
else
|
||||||
x = xstart;
|
x = xstart;
|
||||||
numLines++;
|
numLines++;
|
||||||
y += 32.0f * CFont::Details.scaleY * 0.5f + 2.0f * CFont::Details.scaleY;
|
y += 32.0f * Details.scaleY * 0.5f + 2.0f * Details.scaleY;
|
||||||
}else{
|
}else{
|
||||||
// still space in current line
|
// still space in current line
|
||||||
t = GetNextSpace(s);
|
t = GetNextSpace(s);
|
||||||
|
@ -855,11 +855,11 @@ CFont::GetTextRect(CRect *rect, float xstart, float ystart, wchar *s)
|
||||||
rect->right = xstart + maxlength/2 + 4.0f;
|
rect->right = xstart + maxlength/2 + 4.0f;
|
||||||
#ifdef MORE_LANGUAGES
|
#ifdef MORE_LANGUAGES
|
||||||
if (IsJapaneseFont()) {
|
if (IsJapaneseFont()) {
|
||||||
rect->bottom = (32.0f * CFont::Details.scaleY / 2.75f + 2.0f * CFont::Details.scaleY) * numLines + ystart + (4.0f / 2.75f);
|
rect->bottom = (32.0f * Details.scaleY / 2.75f + 2.0f * Details.scaleY) * numLines + ystart + (4.0f / 2.75f);
|
||||||
rect->top = ystart - (4.0f / 2.75f);
|
rect->top = ystart - (4.0f / 2.75f);
|
||||||
} else {
|
} else {
|
||||||
#endif
|
#endif
|
||||||
rect->bottom = (32.0f * CFont::Details.scaleY * 0.5f + 2.0f * CFont::Details.scaleY) * numLines + ystart + 2.0f;
|
rect->bottom = (32.0f * Details.scaleY * 0.5f + 2.0f * Details.scaleY) * numLines + ystart + 2.0f;
|
||||||
rect->top = ystart - 2.0f;
|
rect->top = ystart - 2.0f;
|
||||||
#ifdef MORE_LANGUAGES
|
#ifdef MORE_LANGUAGES
|
||||||
}
|
}
|
||||||
|
@ -869,11 +869,11 @@ CFont::GetTextRect(CRect *rect, float xstart, float ystart, wchar *s)
|
||||||
rect->right = xstart + Details.centreSize*0.5f + 4.0f;
|
rect->right = xstart + Details.centreSize*0.5f + 4.0f;
|
||||||
#ifdef MORE_LANGUAGES
|
#ifdef MORE_LANGUAGES
|
||||||
if (IsJapaneseFont()) {
|
if (IsJapaneseFont()) {
|
||||||
rect->bottom = (32.0f * CFont::Details.scaleY / 2.75f + 2.0f * CFont::Details.scaleY) * numLines + ystart + (4.0f / 2.75f);
|
rect->bottom = (32.0f * Details.scaleY / 2.75f + 2.0f * Details.scaleY) * numLines + ystart + (4.0f / 2.75f);
|
||||||
rect->top = ystart - (4.0f / 2.75f);
|
rect->top = ystart - (4.0f / 2.75f);
|
||||||
} else {
|
} else {
|
||||||
#endif
|
#endif
|
||||||
rect->bottom = (32.0f * CFont::Details.scaleY * 0.5f + 2.0f * CFont::Details.scaleY) * numLines + ystart + 2.0f;
|
rect->bottom = (32.0f * Details.scaleY * 0.5f + 2.0f * Details.scaleY) * numLines + ystart + 2.0f;
|
||||||
rect->top = ystart - 2.0f;
|
rect->top = ystart - 2.0f;
|
||||||
#ifdef MORE_LANGUAGES
|
#ifdef MORE_LANGUAGES
|
||||||
}
|
}
|
||||||
|
@ -886,10 +886,10 @@ CFont::GetTextRect(CRect *rect, float xstart, float ystart, wchar *s)
|
||||||
rect->bottom = ystart - 4.0f + 4.0f;
|
rect->bottom = ystart - 4.0f + 4.0f;
|
||||||
#ifdef MORE_LANGUAGES
|
#ifdef MORE_LANGUAGES
|
||||||
if (IsJapaneseFont())
|
if (IsJapaneseFont())
|
||||||
rect->top = (32.0f * CFont::Details.scaleY / 2.75f + 2.0f * CFont::Details.scaleY) * numLines + ystart + 2.0f + (4.0f / 2.75f);
|
rect->top = (32.0f * Details.scaleY / 2.75f + 2.0f * Details.scaleY) * numLines + ystart + 2.0f + (4.0f / 2.75f);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
rect->top = (32.0f * CFont::Details.scaleY * 0.5f + 2.0f * CFont::Details.scaleY) * numLines + ystart + 2.0f + 2.0f;
|
rect->top = (32.0f * Details.scaleY * 0.5f + 2.0f * Details.scaleY) * numLines + ystart + 2.0f + 2.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1315,27 +1315,89 @@ CFont::ParseToken(wchar *s)
|
||||||
case 'n':
|
case 'n':
|
||||||
NewLine = 1;
|
NewLine = 1;
|
||||||
break;
|
break;
|
||||||
case 'b': SetColor(CRGBA(27, 89, 130, 255)); Details.anonymous_23 = true; break;
|
case 'b':
|
||||||
|
Details.color.r = 27;
|
||||||
|
Details.color.g = 89;
|
||||||
|
Details.color.b = 130;
|
||||||
|
Details.anonymous_23 = true;
|
||||||
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
Details.bFlash = !Details.bFlash;
|
Details.bFlash = !Details.bFlash;
|
||||||
if (!Details.bFlash)
|
if (!Details.bFlash)
|
||||||
Details.color.a = 255;
|
Details.color.a = 255;
|
||||||
break;
|
break;
|
||||||
case 'g': SetColor(CRGBA(255, 150, 225, 255)); Details.anonymous_23 = true; break;
|
case 'g':
|
||||||
case 'h': SetColor(CRGBA(225, 225, 225, 255)); Details.anonymous_23 = true; break;
|
Details.color.r = 255;
|
||||||
case 'l': SetColor(CRGBA(0, 0, 0, 255)); Details.anonymous_23 = true; break;
|
Details.color.g = 150;
|
||||||
case 'o': SetColor(CRGBA(229, 125, 126, 255)); Details.anonymous_23 = true; break;
|
Details.color.b = 225;
|
||||||
case 'p': SetColor(CRGBA(168, 110, 252, 255)); Details.anonymous_23 = true; break;
|
Details.anonymous_23 = true;
|
||||||
case 'q': SetColor(CRGBA(199, 144, 203, 255)); Details.anonymous_23 = true; break;
|
break;
|
||||||
case 'r': SetColor(CRGBA(255, 150, 225, 255)); Details.anonymous_23 = true; break;
|
case 'h':
|
||||||
case 't': SetColor(CRGBA(86, 212, 146, 255)); Details.anonymous_23 = true; break;
|
Details.color.r = 225;
|
||||||
case 'w': SetColor(CRGBA(175, 175, 175, 255)); Details.anonymous_23 = true; break;
|
Details.color.g = 225;
|
||||||
|
Details.color.b = 225;
|
||||||
|
Details.anonymous_23 = true;
|
||||||
|
break;
|
||||||
|
case 'l':
|
||||||
|
Details.color.r = 0;
|
||||||
|
Details.color.g = 0;
|
||||||
|
Details.color.b = 0;
|
||||||
|
Details.anonymous_23 = true;
|
||||||
|
break;
|
||||||
|
case 'o':
|
||||||
|
Details.color.r = 229;
|
||||||
|
Details.color.g = 125;
|
||||||
|
Details.color.b = 126;
|
||||||
|
Details.anonymous_23 = true;
|
||||||
|
break;
|
||||||
|
case 'p':
|
||||||
|
Details.color.r = 168;
|
||||||
|
Details.color.g = 110;
|
||||||
|
Details.color.b = 252;
|
||||||
|
Details.anonymous_23 = true;
|
||||||
|
break;
|
||||||
|
case 'q':
|
||||||
|
Details.color.r = 199;
|
||||||
|
Details.color.g = 144;
|
||||||
|
Details.color.b = 203;
|
||||||
|
Details.anonymous_23 = true;
|
||||||
|
break;
|
||||||
|
case 'r':
|
||||||
|
Details.color.r = 255;
|
||||||
|
Details.color.g = 150;
|
||||||
|
Details.color.b = 225;
|
||||||
|
Details.anonymous_23 = true;
|
||||||
|
break;
|
||||||
|
case 't':
|
||||||
|
Details.color.r = 86;
|
||||||
|
Details.color.g = 212;
|
||||||
|
Details.color.b = 146;
|
||||||
|
Details.anonymous_23 = true;
|
||||||
|
break;
|
||||||
|
case 'w':
|
||||||
|
Details.color.r = 175;
|
||||||
|
Details.color.g = 175;
|
||||||
|
Details.color.b = 175;
|
||||||
|
Details.anonymous_23 = true;
|
||||||
|
break;
|
||||||
|
case 'x':
|
||||||
#ifdef FIX_BUGS
|
#ifdef FIX_BUGS
|
||||||
case 'x': SetColor(CRGBA(0, 255, 255, 255)); Details.anonymous_23 = true; break;
|
Details.color.r = 0;
|
||||||
|
Details.color.g = 255;
|
||||||
|
Details.color.b = 255;
|
||||||
#else
|
#else
|
||||||
case 'x': SetColor(CRGBA(132, 146, 197, 255)); Details.anonymous_23 = true; break;
|
Details.color.r = 132;
|
||||||
|
Details.color.g = 146;
|
||||||
|
Details.color.b = 197;
|
||||||
#endif
|
#endif
|
||||||
case 'y': SetColor(CRGBA(255, 227, 79, 255)); Details.anonymous_23 = true; break;
|
Details.anonymous_23 = true;
|
||||||
|
break;
|
||||||
|
case 'y':
|
||||||
|
Details.color.r = 255;
|
||||||
|
Details.color.g = 227;
|
||||||
|
Details.color.b = 79;
|
||||||
|
Details.anonymous_23 = true;
|
||||||
|
break;
|
||||||
#ifdef BUTTON_ICONS
|
#ifdef BUTTON_ICONS
|
||||||
case 'U': PS2Symbol = BUTTON_UP; break;
|
case 'U': PS2Symbol = BUTTON_UP; break;
|
||||||
case 'D': PS2Symbol = BUTTON_DOWN; break;
|
case 'D': PS2Symbol = BUTTON_DOWN; break;
|
||||||
|
@ -1542,7 +1604,7 @@ CFont::RenderFontBuffer()
|
||||||
if (RenderState.bFontHalfTexture)
|
if (RenderState.bFontHalfTexture)
|
||||||
c = FindNewCharacter(c);
|
c = FindNewCharacter(c);
|
||||||
else if (c > 155)
|
else if (c > 155)
|
||||||
c = 0;
|
c = '\0';
|
||||||
|
|
||||||
if (RenderState.slant != 0.0f)
|
if (RenderState.slant != 0.0f)
|
||||||
textPosY = (RenderState.slantRefX - textPosX) * RenderState.slant + RenderState.slantRefY;
|
textPosY = (RenderState.slantRefX - textPosX) * RenderState.slant + RenderState.slantRefY;
|
||||||
|
@ -1556,7 +1618,7 @@ CFont::RenderFontBuffer()
|
||||||
// PS2 uses different chars for some symbols
|
// PS2 uses different chars for some symbols
|
||||||
if (!RenderState.bFontHalfTexture && c == 30) c = 61; // wanted star
|
if (!RenderState.bFontHalfTexture && c == 30) c = 61; // wanted star
|
||||||
#endif
|
#endif
|
||||||
textPosX += RenderState.scaleX * (RenderState.proportional ? Size[RenderState.style][c] : Size[RenderState.style][209]);
|
textPosX += RenderState.scaleX * GetCharacterWidth(c);
|
||||||
if (c == '\0')
|
if (c == '\0')
|
||||||
textPosX += RenderState.fExtraSpace;
|
textPosX += RenderState.fExtraSpace;
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,9 +113,9 @@ float fMinWaterAlphaMult = -30.0f;
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WaterLevelInitialise(Const char *pWaterDat)
|
CWaterLevel::Initialise(Const char *pWaterDat)
|
||||||
{
|
{
|
||||||
CWaterLevel::ms_nNoOfWaterLevels = 0;
|
ms_nNoOfWaterLevels = 0;
|
||||||
|
|
||||||
#ifdef MASTER
|
#ifdef MASTER
|
||||||
int32 hFile = -1;
|
int32 hFile = -1;
|
||||||
|
@ -131,11 +131,11 @@ WaterLevelInitialise(Const char *pWaterDat)
|
||||||
|
|
||||||
if (hFile > 0)
|
if (hFile > 0)
|
||||||
{
|
{
|
||||||
CFileMgr::Read(hFile, (char *)&CWaterLevel::ms_nNoOfWaterLevels, sizeof(CWaterLevel::ms_nNoOfWaterLevels));
|
CFileMgr::Read(hFile, (char *)&ms_nNoOfWaterLevels, sizeof(ms_nNoOfWaterLevels));
|
||||||
CFileMgr::Read(hFile, (char *)CWaterLevel::ms_aWaterZs, sizeof(CWaterLevel::ms_aWaterZs));
|
CFileMgr::Read(hFile, (char *)ms_aWaterZs, sizeof(ms_aWaterZs));
|
||||||
CFileMgr::Read(hFile, (char *)CWaterLevel::ms_aWaterRects, sizeof(CWaterLevel::ms_aWaterRects));
|
CFileMgr::Read(hFile, (char *)ms_aWaterRects, sizeof(ms_aWaterRects));
|
||||||
CFileMgr::Read(hFile, (char *)CWaterLevel::aWaterBlockList, sizeof(CWaterLevel::aWaterBlockList));
|
CFileMgr::Read(hFile, (char *)aWaterBlockList, sizeof(aWaterBlockList));
|
||||||
CFileMgr::Read(hFile, (char *)CWaterLevel::aWaterFineBlockList, sizeof(CWaterLevel::aWaterFineBlockList));
|
CFileMgr::Read(hFile, (char *)aWaterFineBlockList, sizeof(aWaterFineBlockList));
|
||||||
CFileMgr::CloseFile(hFile);
|
CFileMgr::CloseFile(hFile);
|
||||||
}
|
}
|
||||||
#ifndef MASTER
|
#ifndef MASTER
|
||||||
|
@ -157,7 +157,7 @@ WaterLevelInitialise(Const char *pWaterDat)
|
||||||
{
|
{
|
||||||
float z, l, b, r, t;
|
float z, l, b, r, t;
|
||||||
sscanf(line, "%f %f %f %f %f", &z, &l, &b, &r, &t);
|
sscanf(line, "%f %f %f %f %f", &z, &l, &b, &r, &t);
|
||||||
CWaterLevel::AddWaterLevel(l, b, r, t, z);
|
AddWaterLevel(l, b, r, t, z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,17 +167,17 @@ WaterLevelInitialise(Const char *pWaterDat)
|
||||||
{
|
{
|
||||||
for (int32 y = 0; y < MAX_SMALL_SECTORS; y++)
|
for (int32 y = 0; y < MAX_SMALL_SECTORS; y++)
|
||||||
{
|
{
|
||||||
CWaterLevel::aWaterFineBlockList[x][y] = NO_WATER;
|
aWaterFineBlockList[x][y] = NO_WATER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// rasterize water rects read from file
|
// rasterize water rects read from file
|
||||||
for (int32 i = 0; i < CWaterLevel::ms_nNoOfWaterLevels; i++)
|
for (int32 i = 0; i < ms_nNoOfWaterLevels; i++)
|
||||||
{
|
{
|
||||||
int32 l = WATER_HUGE_X(CWaterLevel::ms_aWaterRects[i].left + WATER_X_OFFSET);
|
int32 l = WATER_HUGE_X(ms_aWaterRects[i].left + WATER_X_OFFSET);
|
||||||
int32 r = WATER_HUGE_X(CWaterLevel::ms_aWaterRects[i].right + WATER_X_OFFSET) + 1.0f;
|
int32 r = WATER_HUGE_X(ms_aWaterRects[i].right + WATER_X_OFFSET) + 1.0f;
|
||||||
int32 t = WATER_HUGE_Y(CWaterLevel::ms_aWaterRects[i].top);
|
int32 t = WATER_HUGE_Y(ms_aWaterRects[i].top);
|
||||||
int32 b = WATER_HUGE_Y(CWaterLevel::ms_aWaterRects[i].bottom) + 1.0f;
|
int32 b = WATER_HUGE_Y(ms_aWaterRects[i].bottom) + 1.0f;
|
||||||
|
|
||||||
l = clamp(l, 0, MAX_SMALL_SECTORS - 1);
|
l = clamp(l, 0, MAX_SMALL_SECTORS - 1);
|
||||||
r = clamp(r, 0, MAX_SMALL_SECTORS - 1);
|
r = clamp(r, 0, MAX_SMALL_SECTORS - 1);
|
||||||
|
@ -188,7 +188,7 @@ WaterLevelInitialise(Const char *pWaterDat)
|
||||||
{
|
{
|
||||||
for (int32 y = t; y <= b; y++)
|
for (int32 y = t; y <= b; y++)
|
||||||
{
|
{
|
||||||
CWaterLevel::aWaterFineBlockList[x][y] = i;
|
aWaterFineBlockList[x][y] = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -209,10 +209,10 @@ WaterLevelInitialise(Const char *pWaterDat)
|
||||||
{
|
{
|
||||||
for (int32 j = 0; j <= 8; j++)
|
for (int32 j = 0; j <= 8; j++)
|
||||||
{
|
{
|
||||||
CVector worldPos = CVector(worldX + i * (SMALL_SECTOR_SIZE / 8), worldY + j * (SMALL_SECTOR_SIZE / 8), CWaterLevel::ms_aWaterZs[CWaterLevel::aWaterFineBlockList[x][y]]);
|
CVector worldPos = CVector(worldX + i * (SMALL_SECTOR_SIZE / 8), worldY + j * (SMALL_SECTOR_SIZE / 8), ms_aWaterZs[aWaterFineBlockList[x][y]]);
|
||||||
|
|
||||||
if ((worldPos.x > WORLD_MIN_X && worldPos.x < WORLD_MAX_X) && (worldPos.y > WORLD_MIN_Y && worldPos.y < WORLD_MAX_Y) &&
|
if ((worldPos.x > WORLD_MIN_X && worldPos.x < WORLD_MAX_X) && (worldPos.y > WORLD_MIN_Y && worldPos.y < WORLD_MAX_Y) &&
|
||||||
(!CWaterLevel::WaterLevelAccordingToRectangles(worldPos.x, worldPos.y) || CWaterLevel::TestVisibilityForFineWaterBlocks(worldPos)))
|
(!WaterLevelAccordingToRectangles(worldPos.x, worldPos.y) || TestVisibilityForFineWaterBlocks(worldPos)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// at least one point in the tile wasn't blocked, so don't remove water
|
// at least one point in the tile wasn't blocked, so don't remove water
|
||||||
|
@ -222,37 +222,37 @@ WaterLevelInitialise(Const char *pWaterDat)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i < 1000)
|
if (i < 1000)
|
||||||
CWaterLevel::aWaterFineBlockList[x][y] = NO_WATER;
|
aWaterFineBlockList[x][y] = NO_WATER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CWaterLevel::RemoveIsolatedWater();
|
RemoveIsolatedWater();
|
||||||
|
|
||||||
// calculate coarse tiles from fine tiles
|
// calculate coarse tiles from fine tiles
|
||||||
for (int32 x = 0; x < MAX_LARGE_SECTORS; x++)
|
for (int32 x = 0; x < MAX_LARGE_SECTORS; x++)
|
||||||
{
|
{
|
||||||
for (int32 y = 0; y < MAX_LARGE_SECTORS; y++)
|
for (int32 y = 0; y < MAX_LARGE_SECTORS; y++)
|
||||||
{
|
{
|
||||||
if (CWaterLevel::aWaterFineBlockList[x * 2][y * 2] >= 0)
|
if (aWaterFineBlockList[x * 2][y * 2] >= 0)
|
||||||
{
|
{
|
||||||
CWaterLevel::aWaterBlockList[x][y] = CWaterLevel::aWaterFineBlockList[x * 2][y * 2];
|
aWaterBlockList[x][y] = aWaterFineBlockList[x * 2][y * 2];
|
||||||
}
|
}
|
||||||
else if (CWaterLevel::aWaterFineBlockList[x * 2 + 1][y * 2] >= 0)
|
else if (aWaterFineBlockList[x * 2 + 1][y * 2] >= 0)
|
||||||
{
|
{
|
||||||
CWaterLevel::aWaterBlockList[x][y] = CWaterLevel::aWaterFineBlockList[x * 2 + 1][y * 2];
|
aWaterBlockList[x][y] = aWaterFineBlockList[x * 2 + 1][y * 2];
|
||||||
}
|
}
|
||||||
else if (CWaterLevel::aWaterFineBlockList[x * 2][y * 2 + 1] >= 0)
|
else if (aWaterFineBlockList[x * 2][y * 2 + 1] >= 0)
|
||||||
{
|
{
|
||||||
CWaterLevel::aWaterBlockList[x][y] = CWaterLevel::aWaterFineBlockList[x * 2][y * 2 + 1];
|
aWaterBlockList[x][y] = aWaterFineBlockList[x * 2][y * 2 + 1];
|
||||||
}
|
}
|
||||||
else if (CWaterLevel::aWaterFineBlockList[x * 2 + 1][y * 2 + 1] >= 0)
|
else if (aWaterFineBlockList[x * 2 + 1][y * 2 + 1] >= 0)
|
||||||
{
|
{
|
||||||
CWaterLevel::aWaterBlockList[x][y] = CWaterLevel::aWaterFineBlockList[x * 2 + 1][y * 2 + 1];
|
aWaterBlockList[x][y] = aWaterFineBlockList[x * 2 + 1][y * 2 + 1];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CWaterLevel::aWaterBlockList[x][y] = NO_WATER;
|
aWaterBlockList[x][y] = NO_WATER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -261,11 +261,11 @@ WaterLevelInitialise(Const char *pWaterDat)
|
||||||
|
|
||||||
if (hFile > 0)
|
if (hFile > 0)
|
||||||
{
|
{
|
||||||
CFileMgr::Write(hFile, (char *)&CWaterLevel::ms_nNoOfWaterLevels, sizeof(CWaterLevel::ms_nNoOfWaterLevels));
|
CFileMgr::Write(hFile, (char *)&ms_nNoOfWaterLevels, sizeof(ms_nNoOfWaterLevels));
|
||||||
CFileMgr::Write(hFile, (char *)CWaterLevel::ms_aWaterZs, sizeof(CWaterLevel::ms_aWaterZs));
|
CFileMgr::Write(hFile, (char *)ms_aWaterZs, sizeof(ms_aWaterZs));
|
||||||
CFileMgr::Write(hFile, (char *)CWaterLevel::ms_aWaterRects, sizeof(CWaterLevel::ms_aWaterRects));
|
CFileMgr::Write(hFile, (char *)ms_aWaterRects, sizeof(ms_aWaterRects));
|
||||||
CFileMgr::Write(hFile, (char *)CWaterLevel::aWaterBlockList, sizeof(CWaterLevel::aWaterBlockList));
|
CFileMgr::Write(hFile, (char *)aWaterBlockList, sizeof(aWaterBlockList));
|
||||||
CFileMgr::Write(hFile, (char *)CWaterLevel::aWaterFineBlockList, sizeof(CWaterLevel::aWaterFineBlockList));
|
CFileMgr::Write(hFile, (char *)aWaterFineBlockList, sizeof(aWaterFineBlockList));
|
||||||
|
|
||||||
CFileMgr::CloseFile(hFile);
|
CFileMgr::CloseFile(hFile);
|
||||||
}
|
}
|
||||||
|
@ -300,7 +300,7 @@ WaterLevelInitialise(Const char *pWaterDat)
|
||||||
|
|
||||||
CTxdStore::PopCurrentTxd();
|
CTxdStore::PopCurrentTxd();
|
||||||
|
|
||||||
CWaterLevel::CreateWavyAtomic();
|
CreateWavyAtomic();
|
||||||
|
|
||||||
printf("Done Initing waterlevels\n");
|
printf("Done Initing waterlevels\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,6 +116,7 @@ public:
|
||||||
static RpAtomic *ms_pWavyAtomic;
|
static RpAtomic *ms_pWavyAtomic;
|
||||||
static RpAtomic *ms_pMaskAtomic;
|
static RpAtomic *ms_pMaskAtomic;
|
||||||
|
|
||||||
|
static void Initialise(Const char *pWaterDat); // out of class in III PC and later because of SecuROM
|
||||||
static void Shutdown();
|
static void Shutdown();
|
||||||
|
|
||||||
static void CreateWavyAtomic();
|
static void CreateWavyAtomic();
|
||||||
|
@ -181,5 +182,3 @@ public:
|
||||||
static void HandleBeachToysStuff(void);
|
static void HandleBeachToysStuff(void);
|
||||||
static CEntity *CreateBeachToy(CVector const &vec, eBeachToy beachtoy);
|
static CEntity *CreateBeachToy(CVector const &vec, eBeachToy beachtoy);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern void WaterLevelInitialise(Const char *datFile);
|
|
|
@ -88,7 +88,7 @@ public:
|
||||||
static bool IsThisCarBeingCarriedByAnyCrane(CVehicle* pVehicle);
|
static bool IsThisCarBeingCarriedByAnyCrane(CVehicle* pVehicle);
|
||||||
static bool IsThisCarBeingTargettedByAnyCrane(CVehicle* pVehicle);
|
static bool IsThisCarBeingTargettedByAnyCrane(CVehicle* pVehicle);
|
||||||
static void Save(uint8* buf, uint32* size);
|
static void Save(uint8* buf, uint32* size);
|
||||||
static void Load(uint8* buf, uint32 size); // on mobile it's CranesLoad outside of the class
|
static void Load(uint8* buf, uint32 size); // out of class in III PC and later because of SecuROM
|
||||||
|
|
||||||
static uint32 CarsCollectedMilitaryCrane;
|
static uint32 CarsCollectedMilitaryCrane;
|
||||||
static int32 NumCranes;
|
static int32 NumCranes;
|
||||||
|
|
|
@ -762,7 +762,7 @@ CHeli::InitHelis(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
CHeli*
|
CHeli*
|
||||||
GenerateHeli(bool catalina)
|
CHeli::GenerateHeli(bool catalina)
|
||||||
{
|
{
|
||||||
CHeli *heli;
|
CHeli *heli;
|
||||||
CVector heliPos;
|
CVector heliPos;
|
||||||
|
@ -800,7 +800,7 @@ GenerateHeli(bool catalina)
|
||||||
id++;
|
id++;
|
||||||
found = true;
|
found = true;
|
||||||
for(i = 0; i < 4; i++)
|
for(i = 0; i < 4; i++)
|
||||||
if(CHeli::pHelis[i] && CHeli::pHelis[i]->m_nHeliId == id)
|
if(pHelis[i] && pHelis[i]->m_nHeliId == id)
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
heli->m_nHeliId = id;
|
heli->m_nHeliId = id;
|
||||||
|
|
|
@ -83,13 +83,14 @@ public:
|
||||||
bool SendDownSwat(void);
|
bool SendDownSwat(void);
|
||||||
|
|
||||||
static void InitHelis(void);
|
static void InitHelis(void);
|
||||||
|
static CHeli *GenerateHeli(bool catalina); // out of class in III PC and later because of SecuROM
|
||||||
static void UpdateHelis(void);
|
static void UpdateHelis(void);
|
||||||
static void SpecialHeliPreRender(void);
|
static void SpecialHeliPreRender(void);
|
||||||
static bool TestRocketCollision(CVector *coors);
|
static bool TestRocketCollision(CVector *coors);
|
||||||
static bool TestBulletCollision(CVector *line0, CVector *line1, CVector *bulletPos, int32 damage);
|
static bool TestBulletCollision(CVector *line0, CVector *line1, CVector *bulletPos, int32 damage);
|
||||||
static bool TestSniperCollision(CVector *line0, CVector *line1);
|
static bool TestSniperCollision(CVector *line0, CVector *line1);
|
||||||
|
|
||||||
static void StartCatalinaFlyBy(void);
|
static void StartCatalinaFlyBy(void); // out of class in III PC and later because of SecuROM
|
||||||
static void RemoveCatalinaHeli(void);
|
static void RemoveCatalinaHeli(void);
|
||||||
static CHeli *FindPointerToCatalinasHeli(void);
|
static CHeli *FindPointerToCatalinasHeli(void);
|
||||||
static void CatalinaTakeOff(void);
|
static void CatalinaTakeOff(void);
|
||||||
|
|
Loading…
Reference in a new issue