Changed: #825 Remove all warnings when compiling Ryzom
This commit is contained in:
parent
5cd98b6e45
commit
4027e82360
19 changed files with 85 additions and 67 deletions
|
@ -697,6 +697,7 @@ public:
|
||||||
virtual bool addLinearFloatKey(const UKeyLinearFloat &key)
|
virtual bool addLinearFloatKey(const UKeyLinearFloat &key)
|
||||||
{
|
{
|
||||||
CKeyFloat k;
|
CKeyFloat k;
|
||||||
|
k.OODeltaTime= 0.f;
|
||||||
k.Value= key.Value;
|
k.Value= key.Value;
|
||||||
addKey(k, key.Time);
|
addKey(k, key.Time);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -238,11 +238,11 @@ namespace STRING_MANAGER
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool findCol(ucstring colName, uint &colIndex)
|
bool findCol(const ucstring &colName, uint &colIndex)
|
||||||
{
|
{
|
||||||
if (Data.empty())
|
if (Data.empty())
|
||||||
return false;
|
return false;
|
||||||
TWorksheet::TRow::iterator it = std::find(Data[0].begin(), Data[0].end(), ucstring(colName));
|
TWorksheet::TRow::iterator it = std::find(Data[0].begin(), Data[0].end(), colName);
|
||||||
if (it == Data[0].end())
|
if (it == Data[0].end())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -530,7 +530,7 @@ void handleReceivedPong (CClient *client, sint64 pongTime)
|
||||||
// init the UDP connection
|
// init the UDP connection
|
||||||
if (client == NULL)
|
if (client == NULL)
|
||||||
{
|
{
|
||||||
uint32 session;
|
uint32 session = 0;
|
||||||
msgin.serial (session);
|
msgin.serial (session);
|
||||||
|
|
||||||
// Find a new udp connection, find the linked
|
// Find a new udp connection, find the linked
|
||||||
|
@ -568,13 +568,13 @@ void handleReceivedPong (CClient *client, sint64 pongTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read the message
|
// Read the message
|
||||||
sint64 pingTime;
|
sint64 pingTime = 0;
|
||||||
msgin.serial(pingTime);
|
msgin.serial(pingTime);
|
||||||
|
|
||||||
uint32 pongNumber;
|
uint32 pongNumber = 0;
|
||||||
msgin.serial(pongNumber);
|
msgin.serial(pongNumber);
|
||||||
|
|
||||||
uint32 blockNumber;
|
uint32 blockNumber = 0;
|
||||||
msgin.serial(blockNumber);
|
msgin.serial(blockNumber);
|
||||||
|
|
||||||
// nlinfo ("receive a pong from %s pongnb %d %"NL_I64"d", CurrentInMsg->AddrFrom.asString().c_str(), pongNumber, pongTime - pingTime);
|
// nlinfo ("receive a pong from %s pongnb %d %"NL_I64"d", CurrentInMsg->AddrFrom.asString().c_str(), pongNumber, pongTime - pingTime);
|
||||||
|
|
|
@ -36,7 +36,7 @@ using namespace NLMISC;
|
||||||
|
|
||||||
namespace NLSOUND {
|
namespace NLSOUND {
|
||||||
|
|
||||||
CSampleBankManager::CSampleBankManager(CAudioMixerUser *audioMixer) : m_AudioMixer(audioMixer), m_LoadedSize(NULL)
|
CSampleBankManager::CSampleBankManager(CAudioMixerUser *audioMixer) : m_AudioMixer(audioMixer), m_LoadedSize(0)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -970,7 +970,7 @@ int main(int /* argc */, char ** /* argv */)
|
||||||
initViewerConfig("zviewer.cfg");
|
initViewerConfig("zviewer.cfg");
|
||||||
|
|
||||||
// Init NELU
|
// Init NELU
|
||||||
NL3D::CNELU::init(ViewerCfg.Width, ViewerCfg.Height, CViewport(), ViewerCfg.Depth, ViewerCfg.Windowed, NULL, false, false);
|
NL3D::CNELU::init(ViewerCfg.Width, ViewerCfg.Height, CViewport(), ViewerCfg.Depth, ViewerCfg.Windowed, EmptyWindow, false, false);
|
||||||
NL3D::CNELU::Driver->setWindowTitle(ucstring("NeL ZViewer"));
|
NL3D::CNELU::Driver->setWindowTitle(ucstring("NeL ZViewer"));
|
||||||
NL3D::CNELU::Camera->setTransformMode(ITransformable::DirectMatrix);
|
NL3D::CNELU::Camera->setTransformMode(ITransformable::DirectMatrix);
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ extern const char *CDBBankNames[INVALID_CDB_BANK+1];
|
||||||
// reset all static data
|
// reset all static data
|
||||||
void CCDBNodeBranch::reset()
|
void CCDBNodeBranch::reset()
|
||||||
{
|
{
|
||||||
for ( uint b=0; b!=INVALID_CDB_BANK; ++b )
|
for ( uint b=0; b<NB_CDB_BANKS; ++b )
|
||||||
_CDBBankToUnifiedIndexMapping[b].clear();
|
_CDBBankToUnifiedIndexMapping[b].clear();
|
||||||
_UnifiedIndexToBank.clear();
|
_UnifiedIndexToBank.clear();
|
||||||
_CDBLastUnifiedIndex = 0;
|
_CDBLastUnifiedIndex = 0;
|
||||||
|
|
|
@ -4521,6 +4521,10 @@ void CCharacterCL::applyBehaviourFlyingHPs(const CBehaviourContext &bc, const MB
|
||||||
else
|
else
|
||||||
deltaHPColor = ClientCfg.SystemInfoParams["dg"].Color;
|
deltaHPColor = ClientCfg.SystemInfoParams["dg"].Color;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
deltaHPColor = CRGBA(127,127,127);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -8333,7 +8337,7 @@ ADD_METHOD(void CCharacterCL::displayDebug(float x, float &y, float lineStep)) /
|
||||||
TextContext->printfAt(x, y, "(Walk)Run Factor: %f", runFactor());
|
TextContext->printfAt(x, y, "(Walk)Run Factor: %f", runFactor());
|
||||||
y += lineStep;
|
y += lineStep;
|
||||||
// Display the current animation name(id)(offset)(nbloop) pour le channel MOVE.
|
// Display the current animation name(id)(offset)(nbloop) pour le channel MOVE.
|
||||||
TextContext->printfAt(x, y, "Current Animation: %s(%u)(%f)(%u loops)", animId(MOVE)==-1?"[NONE]":currentAnimationName().c_str(), animId(MOVE), animOffset(MOVE), _NbLoopAnim);
|
TextContext->printfAt(x, y, "Current Animation: %s(%u)(%lf)(%u loops)", animId(MOVE)==std::numeric_limits<uint>::max()?"[NONE]":currentAnimationName().c_str(), animId(MOVE), animOffset(MOVE), _NbLoopAnim);
|
||||||
y += lineStep;
|
y += lineStep;
|
||||||
// First Pos
|
// First Pos
|
||||||
if(_First_Pos)
|
if(_First_Pos)
|
||||||
|
|
|
@ -1811,13 +1811,13 @@ string getTarget(CCtrlBase * /* ctrl */, const string &targetName)
|
||||||
if (!elem)
|
if (!elem)
|
||||||
{
|
{
|
||||||
nlwarning("<CInterfaceExpr::getprop> : Element is NULL");
|
nlwarning("<CInterfaceExpr::getprop> : Element is NULL");
|
||||||
return false;
|
return "";
|
||||||
}
|
}
|
||||||
const CReflectedProperty *pRP = CReflectSystem ::getProperty(elem->getReflectedClassName(), rTI.PropertyName);
|
const CReflectedProperty *pRP = CReflectSystem ::getProperty(elem->getReflectedClassName(), rTI.PropertyName);
|
||||||
|
|
||||||
if (pRP->Type == CReflectedProperty::String)
|
if (pRP->Type == CReflectedProperty::String)
|
||||||
return ((elem->*(pRP->GetMethod.GetString))());
|
return ((elem->*(pRP->GetMethod.GetString))());
|
||||||
return string("");
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -106,7 +106,7 @@ public:
|
||||||
void setOpened(bool opened) { Opened = opened; }
|
void setOpened(bool opened) { Opened = opened; }
|
||||||
bool getOpened() const { return Opened; }
|
bool getOpened() const { return Opened; }
|
||||||
void setText(const ucstring &text) { Text = text; }
|
void setText(const ucstring &text) { Text = text; }
|
||||||
ucstring getText() const { return Text; }
|
const ucstring& getText() const { return Text; }
|
||||||
sint32 getFontSize() const { return FontSize; }
|
sint32 getFontSize() const { return FontSize; }
|
||||||
void setFontSize(sint32 value) { FontSize = value; }
|
void setFontSize(sint32 value) { FontSize = value; }
|
||||||
sint32 getYDecal() const { return YDecal; }
|
sint32 getYDecal() const { return YDecal; }
|
||||||
|
|
|
@ -78,7 +78,7 @@ bool CInterfaceOptions::parse (xmlNodePtr cur)
|
||||||
CXMLAutoPtr ptr, val;
|
CXMLAutoPtr ptr, val;
|
||||||
ptr = xmlGetProp (cur, (xmlChar*)"name");
|
ptr = xmlGetProp (cur, (xmlChar*)"name");
|
||||||
val = xmlGetProp (cur, (xmlChar*)"value");
|
val = xmlGetProp (cur, (xmlChar*)"value");
|
||||||
if ((ptr == NULL) || (val == NULL))
|
if (!ptr || !val)
|
||||||
{
|
{
|
||||||
nlinfo("param with no name or no value");
|
nlinfo("param with no name or no value");
|
||||||
ok = false;
|
ok = false;
|
||||||
|
@ -321,7 +321,7 @@ bool COptionsList::parse (xmlNodePtr cur)
|
||||||
{
|
{
|
||||||
CXMLAutoPtr ptr, val;
|
CXMLAutoPtr ptr, val;
|
||||||
val = xmlGetProp (cur, (xmlChar*)"value");
|
val = xmlGetProp (cur, (xmlChar*)"value");
|
||||||
if (val == NULL)
|
if (!val)
|
||||||
{
|
{
|
||||||
nlinfo("param with no name or no value");
|
nlinfo("param with no name or no value");
|
||||||
ok = false;
|
ok = false;
|
||||||
|
|
|
@ -78,9 +78,9 @@ void CPlayerTrade::restoreItem(CDBCtrlSheet *exchangeSlot)
|
||||||
|
|
||||||
// *** If not an AMMO, try to 'auto-stack', as server does
|
// *** If not an AMMO, try to 'auto-stack', as server does
|
||||||
bool canAutoStack= false;
|
bool canAutoStack= false;
|
||||||
uint32 autoStackSheetId;
|
uint32 autoStackSheetId = 0;
|
||||||
sint32 autoStackQuality;
|
sint32 autoStackQuality = 0;
|
||||||
sint32 autoStackMaxQuantity;
|
sint32 autoStackMaxQuantity = 0;
|
||||||
const CItemSheet *itemSheet= exchangeSlot->asItemSheet();
|
const CItemSheet *itemSheet= exchangeSlot->asItemSheet();
|
||||||
// NB: cannot auto stack ammo because their full props (dammage etc...) are not sent to client
|
// NB: cannot auto stack ammo because their full props (dammage etc...) are not sent to client
|
||||||
if(itemSheet)
|
if(itemSheet)
|
||||||
|
|
|
@ -442,7 +442,7 @@ bool CLightCycleManager::isInDayInterval(float startHour, float endHour, float d
|
||||||
float CLightCycleManager::getLightLevel(float hour) const
|
float CLightCycleManager::getLightLevel(float hour) const
|
||||||
{
|
{
|
||||||
H_AUTO_USE(RZ_LightCycleManager)
|
H_AUTO_USE(RZ_LightCycleManager)
|
||||||
float lightValue;
|
float lightValue = 0.f;
|
||||||
if (isInDayInterval(_Desc.NightTransitionStartHour, _Desc.NightTransitionEndHour, _Desc.NumHours, hour, lightValue))
|
if (isInDayInterval(_Desc.NightTransitionStartHour, _Desc.NightTransitionEndHour, _Desc.NumHours, hour, lightValue))
|
||||||
return lightValue;
|
return lightValue;
|
||||||
if (isInDayInterval(_Desc.DawnTransitionStartHour, _Desc.DawnTransitionEndHour, _Desc.NumHours, hour, lightValue))
|
if (isInDayInterval(_Desc.DawnTransitionStartHour, _Desc.DawnTransitionEndHour, _Desc.NumHours, hour, lightValue))
|
||||||
|
|
|
@ -1206,15 +1206,15 @@ void CStringManagerClient::initI18NSpecialWords(const std::string &languageCode)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Get the women name index if possible.
|
// Get the women name index if possible.
|
||||||
uint womenNameColIndex;
|
uint womenNameColIndex = std::numeric_limits<uint>::max();
|
||||||
if( !ws.findCol(womenNameColIdent, womenNameColIndex) )
|
if( !ws.findCol(womenNameColIdent, womenNameColIndex) )
|
||||||
womenNameColIndex= std::numeric_limits<uint>::max();
|
womenNameColIndex= std::numeric_limits<uint>::max();
|
||||||
|
|
||||||
// Get the description index if possible.
|
// Get the description index if possible.
|
||||||
uint descColIndex;
|
uint descColIndex = std::numeric_limits<uint>::max();
|
||||||
if( !ws.findCol(descColIdent, descColIndex) )
|
if( !ws.findCol(descColIdent, descColIndex) )
|
||||||
descColIndex= std::numeric_limits<uint>::max();
|
descColIndex= std::numeric_limits<uint>::max();
|
||||||
uint descColIndex2;
|
uint descColIndex2 = std::numeric_limits<uint>::max();
|
||||||
if( !ws.findCol(descColIdent2, descColIndex2) )
|
if( !ws.findCol(descColIdent2, descColIndex2) )
|
||||||
descColIndex2= std::numeric_limits<uint>::max();
|
descColIndex2= std::numeric_limits<uint>::max();
|
||||||
|
|
||||||
|
|
|
@ -1137,12 +1137,12 @@ namespace CHARSYNC
|
||||||
|
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
ucstring getFullName() const
|
const ucstring& getFullName() const
|
||||||
{
|
{
|
||||||
return _FullName;
|
return _FullName;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setFullName(ucstring value)
|
void setFullName(const ucstring &value)
|
||||||
{
|
{
|
||||||
|
|
||||||
_FullName = value;
|
_FullName = value;
|
||||||
|
|
|
@ -218,24 +218,27 @@ private:
|
||||||
|
|
||||||
void CDirectionLayer::serial(NLMISC::IStream& f)
|
void CDirectionLayer::serial(NLMISC::IStream& f)
|
||||||
{
|
{
|
||||||
uint i;
|
uint i, j;
|
||||||
for (i=0; i<9; ++i)
|
for (i=0; i<3; ++i)
|
||||||
|
{
|
||||||
|
for (j=0; j<3; ++j)
|
||||||
{
|
{
|
||||||
if (f.isReading())
|
if (f.isReading())
|
||||||
{
|
{
|
||||||
delete Grid[0][i];
|
delete Grid[i][j];
|
||||||
Grid[0][i] = NULL;
|
Grid[i][j] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool present = (Grid[0][i] != NULL);
|
bool present = (Grid[i][j] != NULL);
|
||||||
f.serial(present);
|
f.serial(present);
|
||||||
|
|
||||||
if (present)
|
if (present)
|
||||||
{
|
{
|
||||||
if (f.isReading())
|
if (f.isReading())
|
||||||
Grid[0][i] = I16x16Layer::load(f);
|
Grid[i][j] = I16x16Layer::load(f);
|
||||||
else
|
else
|
||||||
I16x16Layer::save(f, Grid[0][i]);
|
I16x16Layer::save(f, Grid[i][j]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1360,7 +1363,7 @@ void CWorldMap::countCells(uint &compute, uint &white, uint &simple, uint &multi
|
||||||
const uint32 startMasterTopo=startTopoNode.getMasterTopo(possibleFlag);
|
const uint32 startMasterTopo=startTopoNode.getMasterTopo(possibleFlag);
|
||||||
const uint32 endMasterTopo=endTopoNode.getMasterTopo(possibleFlag);
|
const uint32 endMasterTopo=endTopoNode.getMasterTopo(possibleFlag);
|
||||||
if ( (startMasterTopo^endMasterTopo)!=0
|
if ( (startMasterTopo^endMasterTopo)!=0
|
||||||
|| startMasterTopo==~0) // if not same masterTopo or invalid masterTopo then bypass ..
|
|| startMasterTopo == std::numeric_limits<uint32>::max()) // if not same masterTopo or invalid masterTopo then bypass ..
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
res.set(possibleFlag, startMasterTopo);
|
res.set(possibleFlag, startMasterTopo);
|
||||||
|
@ -1489,14 +1492,14 @@ bool CWorldMap::findAStarPath(CWorldPosition const& start, CWorldPosition const&
|
||||||
++nbHeapSteps;
|
++nbHeapSteps;
|
||||||
|
|
||||||
// Get best node (popping it)
|
// Get best node (popping it)
|
||||||
father = ~0; // :TODO: Remove that useless statement (since do while first loop ALWAYS overwrite it)
|
father = std::numeric_limits<uint>::max(); // :TODO: Remove that useless statement (since do while first loop ALWAYS overwrite it)
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
father = heap.pop();
|
father = heap.pop();
|
||||||
}
|
}
|
||||||
while (!nodes[father].isOpened() && !heap.empty());
|
while (!nodes[father].isOpened() && !heap.empty());
|
||||||
|
|
||||||
if (father==~0)
|
if (father == std::numeric_limits<uint>::max())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Mark current node as closed
|
// Mark current node as closed
|
||||||
|
@ -2238,7 +2241,7 @@ bool CWorldMap::setWorldPosition(sint32 z, CWorldPosition &wpos, const CAIVector
|
||||||
|
|
||||||
sint32 minDistZ = INT_MAX;
|
sint32 minDistZ = INT_MAX;
|
||||||
CSlot bestSlot;
|
CSlot bestSlot;
|
||||||
sint32 bestZ;
|
sint32 bestZ = 0;
|
||||||
// Find best slot
|
// Find best slot
|
||||||
for (uint32 s=0; s<3; ++s)
|
for (uint32 s=0; s<3; ++s)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1173,9 +1173,10 @@ private:
|
||||||
inline
|
inline
|
||||||
CDirectionLayer::CDirectionLayer()
|
CDirectionLayer::CDirectionLayer()
|
||||||
{
|
{
|
||||||
uint i;
|
uint i, j;
|
||||||
for (i=0; i<9; ++i)
|
for (i=0; i<3; ++i)
|
||||||
Grid[0][i] = NULL;
|
for (j=0; j<3; ++j)
|
||||||
|
Grid[i][j] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
|
@ -1205,39 +1206,42 @@ void CDirectionLayer::dump()
|
||||||
if (gridDirectionLayer)
|
if (gridDirectionLayer)
|
||||||
motion = gridDirectionLayer->getDirection(y,x);
|
motion = gridDirectionLayer->getDirection(y,x);
|
||||||
|
|
||||||
|
char c = ' ';
|
||||||
|
|
||||||
switch (motion.getVal())
|
switch (motion.getVal())
|
||||||
{
|
{
|
||||||
case CDirection::N:
|
case CDirection::N:
|
||||||
output[y+i*16][x+j*16] = '^';
|
c = '^';
|
||||||
break;
|
break;
|
||||||
case CDirection::S:
|
case CDirection::S:
|
||||||
output[y+i*16][x+j*16] = 'v';
|
c = 'v';
|
||||||
break;
|
break;
|
||||||
case CDirection::E:
|
case CDirection::E:
|
||||||
output[y+i*16][x+j*16] = '>';
|
c = '>';
|
||||||
break;
|
break;
|
||||||
case CDirection::W:
|
case CDirection::W:
|
||||||
output[y+i*16][x+j*16] = '<';
|
c = '<';
|
||||||
break;
|
break;
|
||||||
case CDirection::NE:
|
case CDirection::NE:
|
||||||
output[y+i*16][x+j*16] = '7';
|
c = '7';
|
||||||
break;
|
break;
|
||||||
case CDirection::SW:
|
case CDirection::SW:
|
||||||
output[y+i*16][x+j*16] = 'L';
|
c = 'L';
|
||||||
break;
|
break;
|
||||||
case CDirection::NW:
|
case CDirection::NW:
|
||||||
output[y+i*16][x+j*16] = 'r';
|
c = 'r';
|
||||||
break;
|
break;
|
||||||
case CDirection::SE:
|
case CDirection::SE:
|
||||||
output[y+i*16][x+j*16] = '\\';
|
c = '\\';
|
||||||
break;
|
|
||||||
case 255:
|
|
||||||
output[y+i*16][x+j*16] = ' ';
|
|
||||||
break;
|
break;
|
||||||
|
// case 255:
|
||||||
|
// c = ' ';
|
||||||
|
// break;
|
||||||
default:
|
default:
|
||||||
output[y+i*16][x+j*16] = 'o';
|
c = 'o';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
output[y+i*16][x+j*16] = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
char op[256];
|
char op[256];
|
||||||
|
|
|
@ -2694,7 +2694,7 @@ void CGameItem::addHp( double hpGain )
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
// changes the custom text of an item
|
// changes the custom text of an item
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
void CGameItem::setCustomText(ucstring val)
|
void CGameItem::setCustomText(const ucstring &val)
|
||||||
{
|
{
|
||||||
_CustomText = val;
|
_CustomText = val;
|
||||||
// getInventory()->onItemChanged(getInventorySlot(), INVENTORIES::TItemChangeFlags(INVENTORIES::itc_custom_text));
|
// getInventory()->onItemChanged(getInventorySlot(), INVENTORIES::TItemChangeFlags(INVENTORIES::itc_custom_text));
|
||||||
|
|
|
@ -702,9 +702,9 @@ public :
|
||||||
const CItemCraftParameters * getCraftParameters() const { return _CraftParameters; }
|
const CItemCraftParameters * getCraftParameters() const { return _CraftParameters; }
|
||||||
|
|
||||||
/// get custom string (for scroll-like items)
|
/// get custom string (for scroll-like items)
|
||||||
ucstring getCustomText() const { return _CustomText; }
|
const ucstring& getCustomText() const { return _CustomText; }
|
||||||
/// set custom string (for scroll-like items)
|
/// set custom string (for scroll-like items)
|
||||||
void setCustomText(ucstring val);
|
void setCustomText(const ucstring &val);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class CFaberPhrase;
|
friend class CFaberPhrase;
|
||||||
|
|
|
@ -44,37 +44,43 @@ void normalisePackageDescriptionFileName(std::string& fileName)
|
||||||
|
|
||||||
void GeneratePatch(const std::string& srcFileName,const std::string& destFileName,const std::string& patchFileName)
|
void GeneratePatch(const std::string& srcFileName,const std::string& destFileName,const std::string& patchFileName)
|
||||||
{
|
{
|
||||||
std::string cmd="xdelta.exe delta";
|
std::string cmd="xdelta delta";
|
||||||
cmd+=" "+srcFileName+" "+destFileName+" "+patchFileName;
|
cmd+=" "+srcFileName+" "+destFileName+" "+patchFileName;
|
||||||
nlinfo("executing system command: %s",cmd.c_str());
|
nlinfo("executing system command: %s",cmd.c_str());
|
||||||
#ifdef NL_OS_WINDOWS
|
#ifdef NL_OS_WINDOWS
|
||||||
_spawnlp(_P_WAIT, "xdelta.exe","xdelta.exe","delta",srcFileName.c_str(),destFileName.c_str(),patchFileName.c_str(),NULL);
|
_spawnlp(_P_WAIT, "xdelta.exe","xdelta.exe","delta",srcFileName.c_str(),destFileName.c_str(),patchFileName.c_str(),NULL);
|
||||||
#else // NL_OS_WINDOWS
|
#else // NL_OS_WINDOWS
|
||||||
system (cmd.c_str());
|
sint error = system (cmd.c_str());
|
||||||
|
if (error)
|
||||||
|
nlwarning("'%s' failed with error code %d", cmd.c_str(), error);
|
||||||
#endif // NL_OS_WINDOWS
|
#endif // NL_OS_WINDOWS
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApplyPatch(const std::string& srcFileName,const std::string& destFileName,const std::string& patchFileName=std::string())
|
void ApplyPatch(const std::string& srcFileName,const std::string& destFileName,const std::string& patchFileName=std::string())
|
||||||
{
|
{
|
||||||
std::string cmd="xdelta.exe patch";
|
std::string cmd="xdelta patch";
|
||||||
cmd+=" "+patchFileName+" "+srcFileName+" "+destFileName;
|
cmd+=" "+patchFileName+" "+srcFileName+" "+destFileName;
|
||||||
nlinfo("executing system command: %s",cmd.c_str());
|
nlinfo("executing system command: %s",cmd.c_str());
|
||||||
#ifdef NL_OS_WINDOWS
|
#ifdef NL_OS_WINDOWS
|
||||||
_spawnlp(_P_WAIT, "xdelta.exe","xdelta.exe","patch",patchFileName.c_str(),srcFileName.c_str(),destFileName.c_str(),NULL);
|
_spawnlp(_P_WAIT, "xdelta.exe","xdelta.exe","patch",patchFileName.c_str(),srcFileName.c_str(),destFileName.c_str(),NULL);
|
||||||
#else // NL_OS_WINDOWS
|
#else // NL_OS_WINDOWS
|
||||||
system (cmd.c_str());
|
sint error = system (cmd.c_str());
|
||||||
|
if (error)
|
||||||
|
nlwarning("'%s' failed with error code %d", cmd.c_str(), error);
|
||||||
#endif // NL_OS_WINDOWS
|
#endif // NL_OS_WINDOWS
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenerateLZMA(const std::string sourceFile, const std::string &outputFile)
|
void GenerateLZMA(const std::string sourceFile, const std::string &outputFile)
|
||||||
{
|
{
|
||||||
std::string cmd="lzma.exe e ";
|
std::string cmd="lzma e ";
|
||||||
cmd+=" "+sourceFile+" "+outputFile;
|
cmd+=" "+sourceFile+" "+outputFile;
|
||||||
nlinfo("executing system command: %s",cmd.c_str());
|
nlinfo("executing system command: %s",cmd.c_str());
|
||||||
#ifdef NL_OS_WINDOWS
|
#ifdef NL_OS_WINDOWS
|
||||||
_spawnlp(_P_WAIT, "lzma.exe","lzma.exe", "e", sourceFile.c_str(), outputFile.c_str(), NULL);
|
_spawnlp(_P_WAIT, "lzma.exe","lzma.exe", "e", sourceFile.c_str(), outputFile.c_str(), NULL);
|
||||||
#else // NL_OS_WINDOWS
|
#else // NL_OS_WINDOWS
|
||||||
system (cmd.c_str());
|
sint error = system (cmd.c_str());
|
||||||
|
if (error)
|
||||||
|
nlwarning("'%s' failed with error code %d", cmd.c_str(), error);
|
||||||
#endif // NL_OS_WINDOWS
|
#endif // NL_OS_WINDOWS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue