Merge with develop

This commit is contained in:
kaetemi 2016-03-10 12:09:18 +01:00
commit 4a581d89fa
15 changed files with 121 additions and 87 deletions

View file

@ -1203,6 +1203,7 @@ sint CDriverGL::getTotalVideoMemory() const
{
H_AUTO_OGL(CDriverGL_getTotalVideoMemory);
#ifndef USE_OPENGLES
if (_Extensions.NVXGPUMemoryInfo)
{
GLint memoryInKiB = 0;
@ -1306,6 +1307,10 @@ sint CDriverGL::getTotalVideoMemory() const
}
#endif
#else
// TODO: implement for OpenGL ES
#endif
return -1;
}

View file

@ -293,7 +293,7 @@ std::string CI18N::getSystemLanguageCode ()
}
else
{
nlerror("Unable to convert CFStringRef to string");
nlwarning("Unable to convert CFStringRef to string");
}
delete [] tmp;
@ -306,13 +306,22 @@ std::string CI18N::getSystemLanguageCode ()
CFRelease(langCF);
}
if (!lang.empty())
{
// fix language code if country is specified
std::string::size_type pos = lang.find('-');
if (pos != std::string::npos)
lang = lang.substr(0, pos);
// only keep language code if supported by NeL
if (!lang.empty() && isLanguageCodeSupported(lang))
if (isLanguageCodeSupported(lang))
{
s_cachedSystemLanguage = lang;
break;
}
}
}
// don't need languages array anymore
CFRelease(langs);

View file

@ -1,4 +1,4 @@
fyrosLastNames = {"Abyan", "Abybus", "Abycaan", "Abycabus", "Abycacaon", "Abycacus", "Abycadix", "Abycadon", "Abycados", "Abycaion"
fyrosFirstNames = {"Abyan", "Abybus", "Abycaan", "Abycabus", "Abycacaon", "Abycacus", "Abycadix", "Abycadon", "Abycados", "Abycaion"
, "Abycakos", "Abycala", "Abycalaus", "Abycalion", "Abycallo", "Abycalus", "Abycamus", "Abycan", "Abycanix", "Abycaon", "Abycaps"
, "Abycarius", "Abycaron", "Abycaros", "Abycarus", "Abycaseus", "Abycasse", "Abycatheus", "Abycathus", "Abycatis", "Abycaton", "Abycaxius"
, "Abycus", "Abydix", "Abydon", "Abydos", "Abygrian", "Abygribus", "Abygricaon", "Abygricus", "Abygridix", "Abygridon", "Abygridos"
@ -286,7 +286,7 @@ fyrosLastNames = {"Abyan", "Abybus", "Abycaan", "Abycabus", "Abycacaon", "Abycac
, "Zenathus", "Zenatis", "Zenaton", "Zenaxius", "Zenbus", "Zencaon", "Zencus", "Zendix", "Zendon", "Zendos", "Zenion", "Zenix", "Zenkos", "Zenla", "Zenlaus", "Zenlion", "Zenllo", "Zenlus", "Zenmus", "Zenn", "Zennix", "Zenps", "Zenrius", "Zenron", "Zenros", "Zenrus", "Zenseus", "Zensse", "Zentheus"
, "Zenthus", "Zentis", "Zenton", "Zenxius", "Zeperian", "Zeperibus", "Zepericaon", "Zepericus", "Zeperidix", "Zeperidon", "Zeperidos", "Zeperiion", "Zeperikos", "Zeperila", "Zeperilaus", "Zeperilion", "Zeperillo", "Zeperilus", "Zeperimus", "Zeperin", "Zeperinix", "Zeperips", "Zeperirius", "Zeperiron", "Zeperiros", "Zeperirus", "Zeperiseus", "Zeperisse", "Zeperitheus", "Zeperithus", "Zeperitis", "Zeperiton", "Zeperixius", "Zephaan", "Zephabus", "Zephacaon", "Zephacus", "Zephadix", "Zephadon", "Zephados", "Zephaion", "Zephakos", "Zephala", "Zephalaus", "Zephalion", "Zephallo", "Zephalus", "Zephamus", "Zephan", "Zephanix", "Zephaps", "Zepharius", "Zepharon", "Zepharos", "Zepharus", "Zephaseus", "Zephasse", "Zephatheus", "Zephathus", "Zephatis", "Zephaton", "Zephaxius", "Zephoan", "Zephobus", "Zephocaon", "Zephocus", "Zephodix", "Zephodon", "Zephodos", "Zephoion", "Zephokos", "Zephola", "Zepholaus", "Zepholion", "Zephollo", "Zepholus", "Zephomus", "Zephon", "Zephonix", "Zephops", "Zephorius", "Zephoron", "Zephoros", "Zephorus", "Zephoseus", "Zephosse", "Zephotheus", "Zephothus", "Zephotis", "Zephoton", "Zephoxius", "Zephyan", "Zephybus", "Zephycaon", "Zephycus", "Zephydix", "Zephydon", "Zephydos", "Zephyion", "Zephykos", "Zephyla", "Zephylaus", "Zephylion", "Zephyllo", "Zephylus", "Zephymus", "Zephyn", "Zephynix", "Zephyps", "Zephyrius", "Zephyron", "Zephyros", "Zephyrus", "Zephyseus", "Zephysse", "Zephytheus", "Zephythus", "Zephytis", "Zephyton", "Zephyxius", "Zeps", "Zeraan", "Zerabus", "Zeracaon", "Zeracus", "Zeradix", "Zeradon", "Zerados", "Zeraion", "Zerakos", "Zerala", "Zeralaus", "Zeralion", "Zerallo", "Zeralus", "Zeramus", "Zeran", "Zeranix", "Zeraps", "Zerarius", "Zeraron", "Zeraros", "Zerarus", "Zeraseus", "Zerasse", "Zeratheus", "Zerathus", "Zeratis", "Zeraton", "Zeraxius", "Zerian", "Zeribus", "Zericaon", "Zericus", "Zeridix", "Zeridon", "Zeridos", "Zeriion", "Zerikos", "Zerila", "Zerilaus", "Zerilion", "Zerillo", "Zerilus", "Zerimus", "Zerin", "Zerinix", "Zerips", "Zeririus", "Zeriron", "Zeriros", "Zerirus", "Zeriseus", "Zerisse", "Zeritheus", "Zerithus", "Zeritis", "Zeriton", "Zerius", "Zerixius", "Zeron", "Zeros", "Zerus", "Zeryaan", "Zeryabus", "Zeryacaon", "Zeryacus", "Zeryadix", "Zeryadon", "Zeryados", "Zeryaion", "Zeryakos", "Zeryala", "Zeryalaus", "Zeryalion", "Zeryallo", "Zeryalus", "Zeryamus", "Zeryan", "Zeryanix", "Zeryaps", "Zeryarius", "Zeryaron", "Zeryaros", "Zeryarus", "Zeryaseus", "Zeryasse", "Zeryatheus", "Zeryathus", "Zeryatis", "Zeryaton", "Zeryaxius", "Zeseus", "Zesse", "Zessean", "Zessebus", "Zessecaon", "Zessecus", "Zessedix", "Zessedon", "Zessedos", "Zesseion", "Zessekos", "Zessela", "Zesselaus", "Zesselion", "Zessello", "Zesselus", "Zessemus", "Zessen", "Zessenix", "Zesseps", "Zesserius", "Zesseron", "Zesseros", "Zesserus", "Zesseseus", "Zessesse", "Zessetheus", "Zessethus", "Zessetis", "Zesseton", "Zessexius", "Zetheus", "Zethus", "Zetis", "Zeton", "Zexius"}
fyrosFirstNames = {"Abyan", "Abybus", "Abycaon", "Abycus", "Abydix", "Abydon", "Abydos", "Abyion", "Abykos", "Abyla", "Abylaus", "Abylion"
fyrosLastNames = {"Abyan", "Abybus", "Abycaon", "Abycus", "Abydix", "Abydon", "Abydos", "Abyion", "Abykos", "Abyla", "Abylaus", "Abylion"
, "Abyllo", "Abylus", "Abymus", "Abyn", "Abynix", "Abyps", "Abyrius", "Abyron", "Abyros", "Abyrus", "Abyseus", "Abysse", "Abytheus", "Abythus"
, "Abytis", "Abyton", "Abyxius", "Aean", "Aebus", "Aecaon", "Aecus", "Aedix", "Aedon", "Aedos", "Aeion", "Aekos", "Aela", "Aelaus", "Aelion"
, "Aello", "Aelus", "Aemus", "Aen", "Aenix", "Aeps", "Aerius", "Aeron", "Aeros", "Aerus", "Aeseus", "Aesse", "Aetheus", "Aethus", "Aetis"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -19,80 +19,80 @@ end
-- tryker: given name 4500, FirstName 4335
-- Fyros
function outgame:getFyrosLastName()
local nbFyrosLastNames = 0;
for _ in pairs(fyrosLastNames) do nbFyrosLastNames = nbFyrosLastNames + 1 end
return fyrosLastNames[math.random(nbFyrosLastNames)]
end
function outgame:getFyrosFirstName()
local nbFyrosFirstNames = 0;
for _ in pairs(fyrosFirstNames) do nbFyrosFirstNames = nbFyrosFirstNames + 1 end
return fyrosFirstNames[math.random(nbFyrosFirstNames)]
end
function outgame:getFyrosLastName()
local nbFyrosLastNames = 0;
for _ in pairs(fyrosLastNames) do nbFyrosLastNames = nbFyrosLastNames + 1 end
return fyrosLastNames[math.random(nbFyrosLastNames)]
end
-- Matis
function outgame:getMatisLastName(sex)
function outgame:getMatisFirstName(sex)
local dbNameSex = getDbProp("UI:TEMP:NAME_SEX");
if sex ~= nil then
dbNameSex = sex;
end
local LastName = ""
local FirstName = ""
if tonumber( dbNameSex )== 1 then
local nbMatisMaleLastNames = 0;
for _ in pairs(matisMaleLastNames) do nbMatisMaleLastNames = nbMatisMaleLastNames + 1 end
LastName = matisMaleLastNames[math.random(nbMatisMaleLastNames)];
local nbMatisMaleFirstNames = 0;
for _ in pairs(matisMaleFirstNames) do nbMatisMaleFirstNames = nbMatisMaleFirstNames + 1 end
FirstName = matisMaleFirstNames[math.random(nbMatisMaleFirstNames)];
else
local nbMatisFemaleLastNames = 0;
for _ in pairs(matisFemaleLastNames) do nbMatisFemaleLastNames = nbMatisFemaleLastNames + 1 end
LastName = matisFemaleLastNames[math.random(nbMatisFemaleLastNames)];
local nbMatisFemaleFirstNames = 0;
for _ in pairs(matisFemaleFirstNames) do nbMatisFemaleFirstNames = nbMatisFemaleFirstNames + 1 end
FirstName = matisFemaleFirstNames[math.random(nbMatisFemaleFirstNames)];
end
return LastName;
return FirstName;
end
function outgame:getMatisFirstName()
function outgame:getMatisLastName()
local nbMatisFirstNames = 0;
for _ in pairs(matisFirstNames) do nbMatisFirstNames = nbMatisFirstNames + 1 end
local nbMatisLastNames = 0;
for _ in pairs(matisLastNames) do nbMatisLastNames = nbMatisLastNames + 1 end
return matisFirstNames[math.random(nbMatisFirstNames)]
return matisLastNames[math.random(nbMatisLastNames)]
end
-- Tryker
function outgame:getTrykerLastName()
local nbTrykerLastNames = 0;
for _ in pairs(trykerLastNames) do nbTrykerLastNames = nbTrykerLastNames + 1 end
return trykerLastNames[math.random(nbTrykerLastNames)]
end
function outgame:getTrykerFirstName()
local nbTrykerFirstNames = 0;
for _ in pairs(trykerFirstNames) do nbTrykerFirstNames = nbTrykerFirstNames + 1 end
return trykerFirstNames[math.random(nbTrykerFirstNames)]
end
function outgame:getTrykerLastName()
local nbTrykerLastNames = 0;
for _ in pairs(trykerLastNames) do nbTrykerLastNames = nbTrykerLastNames + 1 end
return trykerLastNames[math.random(nbTrykerLastNames)]
end
-- Zoraï
function outgame:getZoraiLastName()
local nbLastNamesOne = 0;
for _ in pairs(zoraiLastNamesOne) do nbLastNamesOne = nbLastNamesOne + 1 end
local lastNameOne = zoraiLastNamesOne[math.random(nbLastNamesOne)];
local nbLastNamesTwo = 0;
for _ in pairs(zoraiLastNamesTwo) do nbLastNamesTwo = nbLastNamesTwo + 1 end
local lastNameTwo = zoraiLastNamesTwo[math.random(nbLastNamesTwo)];
return lastNameOne .. "-" .. lastNameTwo
end
function outgame:getZoraiFirstName()
local nbFirstNames = 0;
for _ in pairs(zoraiFirstNames) do nbFirstNames = nbFirstNames + 1 end
local nbFirstNamesOne = 0;
for _ in pairs(zoraiFirstNamesOne) do nbFirstNamesOne = nbFirstNamesOne + 1 end
local FirstNameOne = zoraiFirstNamesOne[math.random(nbFirstNamesOne)];
return zoraiFirstNames[math.random(nbFirstNames)]
local nbFirstNamesTwo = 0;
for _ in pairs(zoraiFirstNamesTwo) do nbFirstNamesTwo = nbFirstNamesTwo + 1 end
local FirstNameTwo = zoraiFirstNamesTwo[math.random(nbFirstNamesTwo)];
return FirstNameOne .. "-" .. FirstNameTwo
end
function outgame:getZoraiLastName()
local nbLastNames = 0;
for _ in pairs(zoraiLastNames) do nbLastNames = nbLastNames + 1 end
return zoraiLastNames[math.random(nbLastNames)]
end
function outgame:procGenerateName()
@ -114,25 +114,25 @@ function outgame:procGenerateName()
lastName = self:getFyrosLastName()
firstName = self:getFyrosFirstName()
fullnameResult = lastName .. " " .. firstName
nameResult = lastName
nameResult = firstName
elseif tonumber( dbNameRace ) == 2 then
-- Matis
lastName = self:getMatisLastName()
firstName = self:getMatisFirstName()
fullnameResult = lastName .. " " .. firstName
nameResult = lastName
nameResult = firstName
elseif tonumber( dbNameRace ) == 3 then
-- Tryker
lastName = self:getTrykerLastName()
firstName = self:getTrykerFirstName()
fullnameResult = firstName .. " " .. lastName
nameResult = lastName
nameResult = firstName
elseif tonumber( dbNameRace ) == 4 then
-- Zorai
lastName = self:getZoraiLastName()
firstName = self:getZoraiFirstName()
fullnameResult = firstName .. " " .. lastName
nameResult = lastName
nameResult = firstName
elseif tonumber( dbNameRace ) == 5 then
-- Maraudeurs
-- lastName
@ -170,7 +170,7 @@ function outgame:procGenerateName()
end
fullnameResult = lastName .. " " .. firstName
nameResult = lastName
nameResult = firstName
end
uiNameFull.hardtext = fullnameResult;

View file

@ -1245,10 +1245,10 @@ void CFarTP::sendReady()
else
{
// Set season
RT.updateRyzomClock(NetMngr.getCurrentServerTick(), ryzomGetLocalTime() * 0.001);
RT.updateRyzomClock(NetMngr.getCurrentServerTick());
DayNightCycleHour = (float)RT.getRyzomTime();
CurrSeason = RT.getRyzomSeason();
RT.updateRyzomClock(NetMngr.getCurrentServerTick(), ryzomGetLocalTime() * 0.001);
RT.updateRyzomClock(NetMngr.getCurrentServerTick());
DayNightCycleHour = (float)RT.getRyzomTime();
ManualSeasonValue = RT.getRyzomSeason();

View file

@ -797,10 +797,10 @@ void initMainLoop()
{
// setup good day / season before ig are added.
RT.updateRyzomClock(NetMngr.getCurrentServerTick(), ryzomGetLocalTime() * 0.001);
RT.updateRyzomClock(NetMngr.getCurrentServerTick());
updateDayNightCycleHour();
StartupSeason = CurrSeason = RT.getRyzomSeason();
RT.updateRyzomClock(NetMngr.getCurrentServerTick(), ryzomGetLocalTime() * 0.001);
RT.updateRyzomClock(NetMngr.getCurrentServerTick());
updateDayNightCycleHour();
ManualSeasonValue = RT.getRyzomSeason();

View file

@ -1340,7 +1340,7 @@ bool mainLoop()
if (!ClientCfg.Local)
{
if(NetMngr.getCurrentServerTick() > LastGameCycle)
RT.updateRyzomClock(NetMngr.getCurrentServerTick(), ryzomGetLocalTime() * 0.001);
RT.updateRyzomClock(NetMngr.getCurrentServerTick());
}
else if (ClientCfg.SimulateServerTick)
{
@ -1348,7 +1348,7 @@ bool mainLoop()
uint numTicks = (uint) floor(SimulatedServerDate * 10);
SimulatedServerTick += numTicks;
SimulatedServerDate = (float)((double)SimulatedServerDate - (double) numTicks * 0.1);
RT.updateRyzomClock((uint32)SimulatedServerTick, ryzomGetLocalTime() * 0.001);
RT.updateRyzomClock((uint32)SimulatedServerTick);
}
@ -2092,14 +2092,14 @@ bool mainLoop()
if (Actions.valide ("inc_hour"))
{
RT.increaseTickOffset( (uint32)(2000 * displayHourDelta) );
RT.updateRyzomClock(NetMngr.getCurrentServerTick(), ryzomGetLocalTime() * 0.001);
RT.updateRyzomClock(NetMngr.getCurrentServerTick());
}
// Ctrl-L decrease hour
if (Actions.valide ("dec_hour"))
{
RT.decreaseTickOffset( (uint32)(2000 * displayHourDelta) );
RT.updateRyzomClock(NetMngr.getCurrentServerTick(), ryzomGetLocalTime() * 0.001);
RT.updateRyzomClock(NetMngr.getCurrentServerTick());
CTimedFXManager::getInstance().setDate(CClientDate(RT.getRyzomDay(), (float) RT.getRyzomTime()));
if (IGCallbacks)
{

View file

@ -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;

View file

@ -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)
{

View file

@ -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;

View file

@ -83,4 +83,19 @@ namespace WEEKDAY
}; // WEEKDAY
void CRyzomTime::updateRyzomClock(uint32 gameCyle)
{
static const uint32 ticksPerDay = (RYZOM_DAY_IN_HOUR * RYZOM_HOURS_IN_TICKS);
static const float ticksPerHour = (float)RYZOM_HOURS_IN_TICKS;
uint32 totalTicks = gameCyle + _TickOffset;
uint32 days = totalTicks / ticksPerDay;
uint32 dayCycle = totalTicks - (days * ticksPerDay);
days -= RYZOM_START_SPRING;
float hours = (float)dayCycle / ticksPerHour;
_RyzomDay = days;
_RyzomTime = hours;
}
/* end of file */

View file

@ -135,18 +135,11 @@ public:
{
_RyzomDay = 0;
_RyzomTime = 0.f;
_LocalTime = 0.0;
_TickOffset = 0;
}
// Update ryzom clock when tick occurs, local time must be given if localUpdateRyzomClock() and getLocalRyzomTime() is used
void updateRyzomClock( uint32 gameCyle, double localTime = 0 )
{
float hours = ( gameCyle + _TickOffset ) / float(RYZOM_HOURS_IN_TICKS);
_RyzomDay = ( (uint)hours / RYZOM_DAY_IN_HOUR ) - RYZOM_START_SPRING;
_RyzomTime = (float) fmod( hours, (float)RYZOM_DAY_IN_HOUR );
_LocalTime = localTime;
}
void updateRyzomClock(uint32 gameCyle);
// get ryzom time (synchronized with server)
inline float getRyzomTime() const { return _RyzomTime; }
@ -202,7 +195,6 @@ private:
uint32 _RyzomDay;
float _RyzomTime;
double _LocalTime;
uint32 _TickOffset;
};