mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-27 01:26:30 +00:00
Fix thunder update
This commit is contained in:
parent
af0568e131
commit
2177ed554a
3 changed files with 24 additions and 11 deletions
|
@ -430,6 +430,9 @@ void displayDebug()
|
|||
TextContext->printfAt(1.f, line, "TEST WEATHER FUNCTION");
|
||||
line += lineStep;
|
||||
}
|
||||
// thunder
|
||||
TextContext->printfAt(1.f, line, "Thunder level : %.02f", WeatherManager.getThunderLevel());
|
||||
line += lineStep;
|
||||
// season
|
||||
TextContext->printfAt(1.f, line, "Season : %s", EGSPD::CSeason::toString(CurrSeason).c_str());
|
||||
line += lineStep;
|
||||
|
|
|
@ -132,7 +132,7 @@ void CWeatherManagerClient::update(uint64 day, float hour, const CWeatherContext
|
|||
// build current weather state
|
||||
EGSPD::CSeason::TSeason season = CRyzomTime::getSeasonByDay((uint32)day);
|
||||
//
|
||||
manualUpdate(day, hour, wc, weatherValue, season);
|
||||
manualUpdateImpl(day, hour, wc, weatherValue, season);
|
||||
_LastEvalHour = hour;
|
||||
_LastEvalDay = day;
|
||||
}
|
||||
|
@ -147,25 +147,29 @@ void CWeatherManagerClient::update(uint64 day, float hour, const CWeatherContext
|
|||
// build current weather state
|
||||
EGSPD::CSeason::TSeason season = CRyzomTime::getSeasonByDay((uint32)day);
|
||||
//
|
||||
manualUpdate(day, hour, wc, weatherValue, season, camMat, continent);
|
||||
manualUpdateImpl(day, hour, wc, weatherValue, season, camMat, continent);
|
||||
_LastEvalHour = hour;
|
||||
_LastEvalDay = day;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//================================================================================================
|
||||
void CWeatherManagerClient::manualUpdate(uint64 day, float hour, const CWeatherContext &wc, float weatherValue, EGSPD::CSeason::TSeason season, const NLMISC::CMatrix &camMat, const CContinent &continent)
|
||||
{
|
||||
manualUpdateImpl(day, hour, wc, weatherValue, season, camMat, continent);
|
||||
_LastEvalHour = hour;
|
||||
_LastEvalDay = day;
|
||||
}
|
||||
|
||||
//================================================================================================
|
||||
void CWeatherManagerClient::manualUpdateImpl(uint64 day, float hour, const CWeatherContext &wc, float weatherValue, EGSPD::CSeason::TSeason season, const NLMISC::CMatrix &camMat, const CContinent &continent)
|
||||
{
|
||||
H_AUTO_USE(RZ_WeatherManagerClient)
|
||||
if (!wc.WF) return;
|
||||
manualUpdate(day, hour, wc, weatherValue, season);
|
||||
manualUpdateImpl(day, hour, wc, weatherValue, season);
|
||||
setupFXs(camMat, wc.GR, continent);
|
||||
setupWind(&(wc.WF[season]));
|
||||
float scaledWeatherValue = weatherValue * (wc.WF[season].getNumWeatherSetups() - 1);
|
||||
updateThunder(day, hour, wc, true, scaledWeatherValue, season);
|
||||
_LastEvalHour = hour;
|
||||
_LastEvalDay = day;
|
||||
|
||||
// Sound stuff
|
||||
if (SoundMngr != 0)
|
||||
|
@ -250,9 +254,16 @@ void CWeatherManagerClient::manualUpdate(uint64 day, float hour, const CWeatherC
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//================================================================================================
|
||||
void CWeatherManagerClient::manualUpdate(uint64 day, float hour, const CWeatherContext &wc, float weatherValue, EGSPD::CSeason::TSeason season)
|
||||
{
|
||||
manualUpdateImpl(day, hour, wc, weatherValue, season);
|
||||
_LastEvalHour = hour;
|
||||
_LastEvalDay = day;
|
||||
}
|
||||
|
||||
//================================================================================================
|
||||
void CWeatherManagerClient::manualUpdateImpl(uint64 day, float hour, const CWeatherContext &wc, float weatherValue, EGSPD::CSeason::TSeason season)
|
||||
{
|
||||
H_AUTO_USE(RZ_WeatherManagerClient)
|
||||
if (!wc.WF) return;
|
||||
|
@ -269,11 +280,8 @@ void CWeatherManagerClient::manualUpdate(uint64 day, float hour, const CWeatherC
|
|||
// blend client specific part
|
||||
CWeatherStateClient::blend(_CurrWeatherStateClient, safe_cast<const CWeatherSetupClient *>(floorSetup)->WeatherStateClient, safe_cast<const CWeatherSetupClient *>(ceilSetup)->WeatherStateClient, blendFactor);
|
||||
}
|
||||
_LastEvalHour = hour;
|
||||
_LastEvalDay = day;
|
||||
}
|
||||
|
||||
|
||||
//================================================================================================
|
||||
void CWeatherManagerClient::setupWind(const CWeatherFunction *wf)
|
||||
{
|
||||
|
|
|
@ -105,6 +105,8 @@ protected:
|
|||
// from CWeatherManager
|
||||
virtual void setupLoaded(CWeatherSetup *setup);
|
||||
private:
|
||||
void manualUpdateImpl(uint64 day, float hour, const CWeatherContext &wc, float weatherValue, EGSPD::CSeason::TSeason season);
|
||||
void manualUpdateImpl(uint64 day, float hour, const CWeatherContext &wc, float weatherValue, EGSPD::CSeason::TSeason season, const NLMISC::CMatrix &camMat, const class CContinent &continent);
|
||||
typedef std::map<std::string, CPrecipitation> TPrecipitationMap;
|
||||
// A vector of precipitation pointers
|
||||
typedef std::vector<CPrecipitation *> TPrecipitationVect;
|
||||
|
|
Loading…
Reference in a new issue