hg/feature/sse2
Nimetu 11 years ago
commit f8e9123157

@ -8,14 +8,11 @@ IF(CustomMFC_FIND_REQUIRED)
SET(MFC_FIND_REQUIRED TRUE)
ENDIF(CustomMFC_FIND_REQUIRED)
# Try to find MFC using official module, MFC_FOUND is set
FIND_PACKAGE(MFC)
IF(NOT MFC_DIR)
# If MFC have been found, remember their directory
IF(MFC_FOUND AND VC_DIR)
IF(VC_DIR)
SET(MFC_STANDARD_DIR "${VC_DIR}/atlmfc")
ENDIF(MFC_FOUND AND VC_DIR)
ENDIF(VC_DIR)
FIND_PATH(MFC_DIR
include/afxwin.h
@ -45,6 +42,9 @@ IF(MFC_FOUND)
# Set definitions for using MFC in DLL
SET(MFC_DEFINITIONS -D_AFXDLL)
# Set CMake flag to use MFC DLL
SET(CMAKE_MFC_FLAG 2)
ENDIF(MFC_FOUND)
# TODO: create a macro which set MFC_DEFINITIONS, MFC_LIBRARY_DIR and MFC_INCLUDE_DIR for a project

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -488,9 +488,9 @@ void CDriverGL::setUniformParams(TProgram program, CGPUProgramParams &params)
if (index == ~0)
{
const std::string &name = params.getNameByOffset(offset);
nlassert(!name.empty() /* missing both parameter name and index, code error /);
nlassert(!name.empty()); // missing both parameter name and index, code error
uint index = prog->getUniformIndex(name.c_str());
nlassert(index != ~0 /* invalid parameter name /);
nlassert(index != ~0); // invalid parameter name
params.map(index, name);
}

@ -350,7 +350,7 @@ public:
{
i++;
// Set the result
result = atof (filename.c_str () + i);
NLMISC::fromString(filename.substr(i), result);
}
else
{

@ -876,38 +876,32 @@ namespace NLGUI
{
case Hotspot_TL:
return "TL";
break;
case Hotspot_TM:
return "TM";
break;
case Hotspot_TR:
return "TR";
break;
case Hotspot_ML:
return "ML";
break;
case Hotspot_MM:
return "MM";
break;
case Hotspot_MR:
return "MR";
break;
case Hotspot_BL:
return "BL";
break;
case Hotspot_BM:
return "BM";
break;
case Hotspot_BR:
return "BR";
default:
break;
}

@ -139,7 +139,7 @@ bool ReadFloat (const char *propName, float &result, const char *filename, xmlNo
string value;
if (GetPropertyString (value, filename, xmlNode, propName))
{
result = (float)atof (value.c_str ());
NLMISC::fromString(value, result);
return true;
}
return false;

@ -38,7 +38,7 @@ bool ReadFloat (const char *propName, float &result, xmlNodePtr xmlNode)
string value;
if (CIXml::getPropertyString (value, xmlNode, propName))
{
result = (float)atof (value.c_str ());
NLMISC::fromString(value, result);
return true;
}
return false;

@ -517,13 +517,6 @@ void CBufServer::receive( CMemStream& buffer, TSockId* phostid )
*phostid = *((TSockId*)&(buffer.buffer()[buffer.size()-sizeof(TSockId)-1]));
nlassert( buffer.buffer()[buffer.size()-1] == CBufNetBase::User );
// debug features, we number all packet to be sure that they are all sent and received
// \todo remove this debug feature when ok
#ifdef NL_BIG_ENDIAN
uint32 val = NLMISC_BSWAP32(*(uint32*)buffer.buffer());
#else
uint32 val = *(uint32*)buffer.buffer();
#endif
buffer.resize( buffer.size()-sizeof(TSockId)-1 );
// TODO OPTIM remove the nldebug for speed

@ -991,7 +991,7 @@ int main(sint argc, char **argv)
if(argc == 4)
{
weldRadius = (float) atof(argv[3]);
NLMISC::fromString(argv[3], weldRadius);
}
std::string center=getName(argv[1]).c_str();

@ -564,7 +564,7 @@ CCharacter3D::CCharacter3D()
_CurrentSetup.ArmsWidth = _CurrentSetup.LegsWidth = _CurrentSetup.BreastSize = -20.0f;
_PelvisPos.set(0.f,0.f,-20.0f);
_CurPosX = _CurPosY = _CurPosZ = 0.0f;
_CurRotX, _CurRotY, _CurRotZ = 0.0f;
_CurRotX = _CurRotY = _CurRotZ = 0.0f;
_NextBlinkTime = 0;
_CopyAnim=false;
}

@ -163,7 +163,7 @@ void CGroupQuickHelp::setGroupTextSize (CInterfaceGroup *group, bool selected)
{
bool globalColor = selected ? TextColorGlobalColor : _NonSelectedGlobalColor;
bool linkGlobalColor = selected ? LinkColorGlobalColor : _NonSelectedGlobalColor;
uint fontSize = selected ? TextFontSize : _NonSelectedSize;_NonSelectedSize;
uint fontSize = selected ? TextFontSize : _NonSelectedSize;
NLMISC::CRGBA color = selected ? TextColor : _NonSelectedColor;
NLMISC::CRGBA linkColor = selected ? LinkColor : _NonSelectedLinkColor;

@ -997,7 +997,6 @@ bool mainLoop()
// Init GameContextMenu.
GameContextMenu;
GameContextMenu.init("");
// Active inputs

@ -1100,7 +1100,7 @@ void CTimedFXManager::setMaxNumFXInstances(uint maxNumInstances)
FPU_CHECKER
H_AUTO_USE(RZ_TimedFX)
_MaxNumberOfFXInstances = maxNumInstances;
_CandidateFXListTouched;
_CandidateFXListTouched = true;
}
// *******************************************************************************************

@ -371,7 +371,7 @@ local registerFeature = function ()
--------------------
convertToWidgetValue =
function(value)
local result = math.mod(math.floor(180 * value / math.pi), 360)
local result = math.fmod(math.floor(180 * value / math.pi), 360)
if result < 0 then result = 360 + result end
return result
end,

@ -78,7 +78,7 @@ feature.Components.EasterEgg =
function(value)
local angle = value
if angle == nil then angle = 0 end
local result = math.mod(math.floor(180 * angle / math.pi), 360)
local result = math.fmod(math.floor(180 * angle / math.pi), 360)
if result < 0 then result = 360 + result end
return result
end,

@ -635,7 +635,7 @@ function CharTracking:onDraw()
self.LastRefreshTime = nltime.getLocalTime() / 1000
--self:getWindow():find("refreshText").active = false
else
local waitText = i18n.get("uiRAP_WaitChars" .. math.mod(os.time(), 3))
local waitText = i18n.get("uiRAP_WaitChars" .. math.fmod(os.time(), 3))
self:setInfoMessage(waitText)
--local refreshText = self:getWindow():find("refreshText")
--if not self.ListReceived then

@ -613,7 +613,7 @@ function PlayerTracking:onDraw()
local timeInSec = nltime.getLocalTime() / 1000
if self.WaitingList then
local waitText = i18n.get("uiRAP_WaitMsg" .. math.mod(os.time(), 3))
local waitText = i18n.get("uiRAP_WaitMsg" .. math.fmod(os.time(), 3))
if not self.ListReceived then
self:setInfoMessage(waitText)
waitTextColor.A = 127 + 127 * (0.5 + 0.5 * math.cos(6 * timeInSec))

@ -158,6 +158,8 @@ public:
case FLOAT :
fromString((*itt).second, value);
break;
default:
break;
}
}

@ -477,9 +477,12 @@ void CStaticFames::loadStaticFame( const string& filename )
if (sep == string::npos)
sep = s.size();
else
factor = (float) atof( s.substr(sep+1, s.size()-sep-1).c_str());
NLMISC::fromString(s.substr(sep+1, s.size()-sep-1), factor);
// Fames in file are in [-600;600] so don't forget 1000 factor
sint32 fame = (sint32)(atof(s.substr(0,sep).c_str())*1000.f);
sint32 fame;
float fameFloat;
NLMISC::fromString(s.substr(0, sep), fameFloat);
fame = (sint32)(fameFloat * 1000.f);
_FameTable[iFaction*_FameTableSize + jFaction] = fame;
_PropagationFactorTable[iFaction*_FameTableSize + jFaction] = factor;

@ -2401,9 +2401,17 @@ NLMISC_COMMAND(setStartPoint,"Set the start point for a continent","<continent>
CVectorD startPoint;
startPoint.x = atof(args[1].c_str());
startPoint.y = atof(args[2].c_str());
startPoint.z = (args.size() < 4 ? 0.0 : atof(args[3].c_str()));
NLMISC::fromString(args[1], startPoint.x);
NLMISC::fromString(args[2], startPoint.y);
if (args.size() < 4)
{
startPoint.z = 0.0;
}
else
{
NLMISC::fromString(args[3], startPoint.z);
}
StartPoints.insert(multimap<string, CVectorD>::value_type(args[0], startPoint));
@ -2417,10 +2425,10 @@ NLMISC_COMMAND(setBoundingBox, "Set the working bounding box", "<minx> <miny> <m
if (args.size() < 4)
return false;
BoxMin.x = atof(args[0].c_str());
BoxMin.y = atof(args[1].c_str());
BoxMax.x = atof(args[2].c_str());
BoxMax.y = atof(args[3].c_str());
NLMISC::fromString(args[0], BoxMin.x);
NLMISC::fromString(args[1], BoxMin.y);
NLMISC::fromString(args[2], BoxMax.x);
NLMISC::fromString(args[3], BoxMax.y);
return true;
}

@ -2332,7 +2332,7 @@ static void parsePrimDynFaunaZone(const CAIAliasDescriptionNode *aliasNode, cons
y = prim->getPrimVector()->y;
string s;
prim->getPropertyByName("radius", s);
r = float(atof(s.c_str()));
NLMISC::fromString(s, r);
vector<string> *params = &EmptyStringVector;
prim->getPropertyByName("properties", params);
@ -2361,7 +2361,7 @@ static void parsePrimDynNpcZonePlace(const CAIAliasDescriptionNode *aliasNode, c
y = prim->getPrimVector()->y;
string s;
prim->getPropertyByName("radius", s);
r = float(atof(s.c_str()));
NLMISC::fromString(s, r);
vector<string> *params=&EmptyStringVector;
prim->getPropertyByName("properties", params);
@ -2425,19 +2425,19 @@ static void parsePrimRoadTrigger(const CAIAliasDescriptionNode *aliasNode, const
{
t1 = *child->getPrimVector();
child->getPropertyByName("radius", s);
t1r = float(atof(s.c_str()));
NLMISC::fromString(s, t1r);
}
else if (nodeName(child) == "trigger 2")
{
t2 = *child->getPrimVector();
child->getPropertyByName("radius", s);
t2r = float(atof(s.c_str()));
NLMISC::fromString(s, t2r);
}
else if (nodeName(child) == "spawn")
{
sp = *child->getPrimVector();
child->getPropertyByName("radius", s);
spr = float(atof(s.c_str()));
NLMISC::fromString(s, spr);
}
}
}
@ -2468,7 +2468,8 @@ static void parsePrimDynRoad(const CAIAliasDescriptionNode *aliasNode, const IPr
// road dificulty
string s;
prim->getPropertyByName("difficulty", s);
float difficulty = float(atof(s.c_str()));
float difficulty;
NLMISC::fromString(s, difficulty);
uint32 verticalPos;
parseVerticalPos(prim, verticalPos);
@ -3169,7 +3170,7 @@ static void parsePrimOutpostSpawnZone(const CAIAliasDescriptionNode *aliasNode,
y = prim->getPrimVector()->y;
string s;
prim->getPropertyByName("radius", s);
r = float(atof(s.c_str()));
NLMISC::fromString(s, r);
uint32 verticalPos;
parseVerticalPos(prim, verticalPos);
@ -3428,7 +3429,8 @@ static void parsePrimSafeZone(const IPrimitive *prim, const std::string &mapName
float y=(float)(prim->getPrimVector()->y);
string radiusString;
prim->getPropertyByName("radius",radiusString);
float radius=(float)atof(radiusString.c_str());
float radius;
NLMISC::fromString(radiusString, radius);
CAIActions::exec("SAFEZONE", x, y, radius);
}

@ -966,7 +966,7 @@ uint32 CStringManager::translateTitle(const std::string &title, TLanguages lang
{
const std::string colName("name");
const CStringManager::CEntityWords &ew = getEntityWords(language, STRING_MANAGER::title);
std::string rowName = NLMISC::strlwr(title);
std::string rowName = NLMISC::toLower(title);
uint32 stringId;
stringId = ew.getStringId(rowName, colName);

@ -428,7 +428,7 @@ CStringManager::CEntityWords CStringManager::parseEntityWords(const ucstring &st
for (i=1; i<ws.size(); ++i)
{
// on the first col, we uncapitalize the id
ws.setData(i, 0, ucstring(NLMISC::strlwr(ws.getData(i, 0).toString())));
ws.setData(i, 0, ucstring(NLMISC::toLower(ws.getData(i, 0).toString())));
ew._RowInfo.insert(make_pair(ws.getData(i, 0).toString(), i-1));
for (uint j=0; j<ws.ColCount; ++j)
@ -802,7 +802,7 @@ bool CStringManager::parseTag(const CPhrase &phrase, const ucstring &tag, TRepla
nlwarning("Error reading tag property in the tag [%s]", tag.toString().c_str());
return false;
}
spec = NLMISC::strlwr(spec);
spec = NLMISC::toLower(spec);
}
else
spec = "name";
@ -1098,7 +1098,7 @@ bool CStringManager::parseParamList(ucstring::const_iterator &it, ucstring::cons
nlwarning("Error parsing parameter %u type in param list", count);
return false;
}
type = NLMISC::strlwr(type);
type = NLMISC::toLower(type);
NLMISC::CI18N::skipWhiteSpace(it, last);
if (!NLMISC::CI18N::parseLabel(it, last, name))

@ -1835,11 +1835,11 @@ void CMissionData::parseMissionHeader(NLLIGO::IPrimitive *prim)
// _MissionTitle.init(*this, prim, vs);
_MissionDescriptionRaw = getPropertyArray(prim, "mission_description", false, false);
// _MissionDescription.init(*this, prim, vs);
_MonoInstance = strlwr(getProperty(prim, "mono_instance", true, false)) == "true";
_RunOnce = strlwr(getProperty(prim, "run_only_once", true, false)) == "true";
_Replayable = strlwr(getProperty(prim, "replayable", true, false)) == "true";
_MonoInstance = toLower(getProperty(prim, "mono_instance", true, false)) == "true";
_RunOnce = toLower(getProperty(prim, "run_only_once", true, false)) == "true";
_Replayable = toLower(getProperty(prim, "replayable", true, false)) == "true";
_NeedValidation = strlwr(getProperty(prim, "need_validation", true, false)) == "true";
_NeedValidation = toLower(getProperty(prim, "need_validation", true, false)) == "true";
_MissionAutoMenuRaw = getPropertyArray(prim, "phrase_auto_menu", false, false);

@ -19,10 +19,20 @@
exit;
} else {
ini_set( "display_errors", true );
error_reporting( E_ALL );
if (file_exists('../config.php')) {
require( '../config.php' );
} else {
require( '../config.default.php' );
//copy config.default.php to config.php!
if (!file_exists('../config.php')) {
if (!copy('../config.default.php', '../config.php')) {
echo "failed to copy ../config.php ...\n";
echo '<br><a href="'.$_SERVER['REQUEST_URI'].'" >Reload!</a> ';
exit;
}
}
}
//var used to access the DB;
@ -54,7 +64,7 @@
);
GRANT ALL ON `" . $cfg['db']['web']['name'] ."`.* TO `" . $cfg['db']['web']['user'] ."`@localhost;
GRANT ALL ON `" . $cfg['db']['web']['name'] ."`.* TO `" . $cfg['db']['web']['user'] ."`@".$cfg['db']['web']['host'].";
";
$dbw->executeWithoutParams($sql);
@ -460,7 +470,7 @@
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
GRANT ALL ON `" . $cfg['db']['lib']['name'] ."`.* TO `" . $cfg['db']['lib']['user'] ."`@localhost;
GRANT ALL ON `" . $cfg['db']['lib']['name'] ."`.* TO `" . $cfg['db']['lib']['user'] ."`@".$cfg['db']['lib']['host'].";
";
$dbl->executeWithoutParams($sql);
print "The Lib & Web database were correctly installed! <br />";
@ -575,7 +585,7 @@
KEY `GMId` (`GMId`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='contains all users informations for login system' AUTO_INCREMENT=1 ;
GRANT ALL ON `" . $cfg['db']['shard']['name'] ."`.* TO `" . $cfg['db']['shard']['user'] ."`@localhost;
GRANT ALL ON `" . $cfg['db']['shard']['name'] ."`.* TO `" . $cfg['db']['shard']['user'] ."`@".$cfg['db']['shard']['host'].";
";
$dbs->executeWithoutParams($sql);
print "The shard database was correctly installed! <br />";
@ -1358,7 +1368,7 @@
(164, 31, 104, 9),
(165, 31, 103, 9);
GRANT ALL ON `" . $cfg['db']['tool']['name'] ."`.* TO `" . $cfg['db']['tool']['user'] ."`@localhost;
GRANT ALL ON `" . $cfg['db']['tool']['name'] ."`.* TO `" . $cfg['db']['tool']['user'] ."`@".$cfg['db']['tool']['host'].";
";
$dbn->executeWithoutParams($sql);
print "The nel_tool database was correctly installed! <br />";
@ -1384,13 +1394,6 @@
print "There was an error while creating the admin account! ";
}
//copy config.default.php to config.php!
if (!file_exists('../config.php')) {
if (!copy('../config.default.php', '../config.php')) {
echo "failed to copy ../config.php ...\n";
}
}
echo '<br><a href="'.$_SERVER['REQUEST_URI'].'" >Reload!</a> ';
exit;

Loading…
Cancel
Save