mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-12-27 02:50:53 +00:00
Merge with develop
This commit is contained in:
parent
bb28b25e71
commit
1e8d28759a
17 changed files with 291 additions and 240 deletions
|
@ -1,5 +1,3 @@
|
|||
PROJECT(NeL CXX C)
|
||||
|
||||
IF(WITH_STATIC_DRIVERS)
|
||||
ADD_DEFINITIONS(-DNL_STATIC)
|
||||
ENDIF()
|
||||
|
@ -17,7 +15,6 @@ IF(WITH_3D)
|
|||
IF(WITH_NEL_CEGUI)
|
||||
FIND_PACKAGE(CEGUI)
|
||||
ENDIF()
|
||||
|
||||
ENDIF()
|
||||
|
||||
IF(WITH_SOUND)
|
||||
|
|
|
@ -289,7 +289,7 @@ bool CForm::insertParent (uint before, const std::string &filename, CForm *paren
|
|||
else
|
||||
{
|
||||
// Output an error
|
||||
warning (false, "insertParent", "Can't insert parent form (%s) that has not the same DFN.", filename);
|
||||
warning (false, "insertParent", "Can't insert parent form (%s) that has not the same DFN.", filename.c_str());
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -171,7 +171,7 @@ CFormDfn *CFormLoader::loadFormDfn (const std::string &filename, bool forceLoad)
|
|||
else
|
||||
{
|
||||
// Output error
|
||||
warning (false, "loadFormDfn", "Can't open the form file (%s).", filename);
|
||||
warning (false, "loadFormDfn", "Can't open the form file (%s).", filename.c_str());
|
||||
|
||||
// Delete the formDfn
|
||||
delete formDfn;
|
||||
|
@ -182,7 +182,7 @@ CFormDfn *CFormLoader::loadFormDfn (const std::string &filename, bool forceLoad)
|
|||
catch (const Exception &e)
|
||||
{
|
||||
// Output error
|
||||
warning (false, "loadFormDfn", "Error while loading the form (%s): %s", filename, e.what());
|
||||
warning (false, "loadFormDfn", "Error while loading the form (%s): %s", filename.c_str(), e.what());
|
||||
|
||||
// Delete the formDfn
|
||||
delete formDfn;
|
||||
|
@ -257,7 +257,7 @@ UForm *CFormLoader::loadForm (const std::string &filename)
|
|||
else
|
||||
{
|
||||
// Output error
|
||||
warning (false, "loadForm", "Can't open the form file (%s).", filename);
|
||||
warning (false, "loadForm", "Can't open the form file (%s).", filename.c_str());
|
||||
|
||||
// Delete the form
|
||||
delete form;
|
||||
|
@ -279,7 +279,7 @@ UForm *CFormLoader::loadForm (const std::string &filename)
|
|||
catch (const Exception &e)
|
||||
{
|
||||
// Output error
|
||||
warning (false, "loadForm", "Error while loading the form (%s): %s", filename, e.what());
|
||||
warning (false, "loadForm", "Error while loading the form (%s): %s", filename.c_str(), e.what());
|
||||
|
||||
// Delete the form
|
||||
delete form;
|
||||
|
@ -317,7 +317,7 @@ void CFormLoader::warning (bool exception, const std::string &function, const ch
|
|||
va_end( args );
|
||||
|
||||
// Set the warning
|
||||
NLGEORGES::warning (exception, "(CFormLoader::%s) : %s", function, buffer);
|
||||
NLGEORGES::warning (exception, "(CFormLoader::%s) : %s", function.c_str(), buffer);
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
|
|
@ -1800,7 +1800,7 @@ namespace NLGUI
|
|||
addLine(arg1, ls.toString(2), ls.toString(3), ls.toString(4));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
int CGroupSubMenu::luaAddIconLine(CLuaState &ls)
|
||||
{
|
||||
|
@ -1816,7 +1816,7 @@ namespace NLGUI
|
|||
addLine(arg1, ls.toString(2), ls.toString(3), ls.toString(4), string(), ls.toString(5));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
int CGroupSubMenu::luaAddLineAtIndex(CLuaState &ls)
|
||||
{
|
||||
|
|
|
@ -100,8 +100,8 @@ namespace NLGUI
|
|||
_PointerMiddleDownY = _PointerY;
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
void CViewPointerBase::setPointerRightDown (bool pd)
|
||||
{
|
||||
_PointerRightDown = pd;
|
||||
|
@ -147,7 +147,7 @@ namespace NLGUI
|
|||
{
|
||||
x = _PointerDownX;
|
||||
y = _PointerDownY;
|
||||
|
||||
|
||||
return _PointerDown;
|
||||
}
|
||||
|
||||
|
@ -156,7 +156,7 @@ namespace NLGUI
|
|||
{
|
||||
x = _PointerMiddleDownX;
|
||||
y = _PointerMiddleDownY;
|
||||
|
||||
|
||||
return _PointerMiddleDown;
|
||||
}
|
||||
|
||||
|
@ -165,7 +165,7 @@ namespace NLGUI
|
|||
{
|
||||
x = _PointerRightDownX;
|
||||
y = _PointerRightDownY;
|
||||
|
||||
|
||||
return _PointerRightDown;
|
||||
}
|
||||
|
||||
|
|
|
@ -828,17 +828,18 @@ void CUnifiedNetwork::addService(const string &name, const vector<CInetAddress>
|
|||
for (uint i = 0; i < addr.size(); i++)
|
||||
{
|
||||
// first we have to look if we have a network that can established the connection
|
||||
|
||||
|
||||
uint j = 0;
|
||||
|
||||
// it's loopback ip address, it's ok
|
||||
if (!addr[i].isLoopbackIPAddress())
|
||||
{
|
||||
// it's loopback ip address, it's ok
|
||||
for (j = 0; j < laddr.size (); j++)
|
||||
{
|
||||
if (laddr[j].internalNetAddress () == addr[i].internalNetAddress ())
|
||||
{
|
||||
break; // it's ok, we can try
|
||||
// it's ok, we can try
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1272,7 +1273,8 @@ uint8 CUnifiedNetwork::findConnectionId (TServiceId sid, uint8 nid)
|
|||
uint8 connectionId = _IdCnx[sid.get()].DefaultNetwork;
|
||||
|
||||
if (nid == 0xFF)
|
||||
{ // default network
|
||||
{
|
||||
// default network
|
||||
//nldebug ("HNETL5: nid %hu, will use the default connection %hu", (uint16)nid, (uint16)connectionId);
|
||||
}
|
||||
else if (nid >= _IdCnx[sid.get()].NetworkConnectionAssociations.size())
|
||||
|
@ -1293,7 +1295,6 @@ uint8 CUnifiedNetwork::findConnectionId (TServiceId sid, uint8 nid)
|
|||
|
||||
if (connectionId >= _IdCnx[sid.get()].Connections.size() || !_IdCnx[sid.get()].Connections[connectionId].valid() || !_IdCnx[sid.get()].Connections[connectionId].CbNetBase->connected())
|
||||
{
|
||||
|
||||
if (nid != 0xFF)
|
||||
{
|
||||
// not a default network. There's a problem with the selected connectionID, so try to find a valid one
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<lua file="webig.lua" />
|
||||
<lua file="json.lua" />
|
||||
<lua file="sceneedit.lua" />
|
||||
|
||||
|
||||
<!-- //////////// STYLE : webigchat_desc /////////// -->
|
||||
<style style="webigchat_desc" type="text" fontsize="12" justification="dont_clip_word" color="0 0 0 255" global_color="false" multi_line="true" multi_line_space="0" line_maxw="320" multi_line_maxw_only="true" />
|
||||
<!-- //////////// STYLE : webigchat_option /////////// -->
|
||||
|
|
|
@ -559,7 +559,7 @@ void checkUnderCursor()
|
|||
selectedInstance.getMaterial(j).setShininess( 1000.0f );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
selectedInstanceURL = instref.ContextURL;
|
||||
if (instref.ContextText.empty())
|
||||
{
|
||||
|
|
|
@ -536,11 +536,11 @@ CShapeInstanceReference CEntityManager::createInstance(const string& shape, cons
|
|||
if (!Scene) return nullinstref;
|
||||
|
||||
UInstance instance = Scene->createInstance(shape);
|
||||
|
||||
|
||||
if(!instance.empty())
|
||||
{
|
||||
UMovePrimitive *primitive = NULL;
|
||||
|
||||
|
||||
if (PACS && haveCollisions)
|
||||
{
|
||||
primitive = PACS->addCollisionablePrimitive(dynamicWI, 1);
|
||||
|
@ -732,9 +732,8 @@ bool CEntityManager::instancesRemoved()
|
|||
return instRemoved;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool CEntityManager::setupInstance(uint32 idx, const vector<string> &keys, const vector<string> &values) {
|
||||
bool CEntityManager::setupInstance(uint32 idx, const vector<string> &keys, const vector<string> &values)
|
||||
{
|
||||
if (!Scene || idx >= _ShapeInstances.size() || _ShapeInstances[idx].Deleted)
|
||||
return false;
|
||||
|
||||
|
@ -881,6 +880,8 @@ bool CEntityManager::setupInstance(uint32 idx, const vector<string> &keys, const
|
|||
primitive->setObstacle(active);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -920,7 +921,7 @@ CShapeInstanceReference CEntityManager::getShapeInstanceUnderPos(float x, float
|
|||
_ShapeInstances[i].Instance.getShapeAABBox(bbox);
|
||||
CVector bbox_min;
|
||||
CVector bbox_max;
|
||||
|
||||
|
||||
if (bbox.getCenter() == CVector::Null)
|
||||
{
|
||||
bbox_min = CVector(-0.5f, -0.5f, -0.5f);
|
||||
|
@ -931,9 +932,9 @@ CShapeInstanceReference CEntityManager::getShapeInstanceUnderPos(float x, float
|
|||
bbox_min = bbox.getMin();
|
||||
bbox_max = bbox.getMax();
|
||||
}
|
||||
|
||||
|
||||
bbox.setMinMax((bbox_min*_ShapeInstances[i].Instance.getScale().x)+_ShapeInstances[i].Instance.getPos(), (bbox_max*_ShapeInstances[i].Instance.getScale().x)+_ShapeInstances[i].Instance.getPos());
|
||||
|
||||
|
||||
if(bbox.intersect(pos, pos+dir*100.0f))
|
||||
{
|
||||
float dist = (bbox.getCenter()-pos).norm();
|
||||
|
|
|
@ -271,7 +271,7 @@ void HandleSystemCursorCapture(const CEvent &event)
|
|||
{
|
||||
CEventMouseDown &em = (CEventMouseDown &) event;
|
||||
DownMouseButtons |= em.Button & (leftButton | middleButton | rightButton);
|
||||
|
||||
|
||||
CViewPointer *cursor = static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() );
|
||||
if (cursor)
|
||||
{
|
||||
|
@ -279,7 +279,7 @@ void HandleSystemCursorCapture(const CEvent &event)
|
|||
cursor->setPointerMiddleDown(em.Button == middleButton);
|
||||
cursor->setPointerRightDown(em.Button == rightButton);
|
||||
}
|
||||
|
||||
|
||||
Driver->setCapture(true);
|
||||
}
|
||||
|
||||
|
|
|
@ -2586,7 +2586,7 @@ class CAHAddShape : public IActionHandler
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (transparency.empty())
|
||||
::makeInstanceTransparent(instance, 255, false);
|
||||
else
|
||||
|
@ -2654,7 +2654,6 @@ class CAHAddShape : public IActionHandler
|
|||
};
|
||||
REGISTER_ACTION_HANDLER (CAHAddShape, "add_shape");
|
||||
|
||||
|
||||
class CAHRemoveShapes : public IActionHandler
|
||||
{
|
||||
virtual void execute (CCtrlBase * /* pCaller */, const string &Params)
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -219,7 +219,7 @@ private:
|
|||
static int getMouseRightDown(CLuaState &ls);
|
||||
static int getShapeIdAt(CLuaState &ls);
|
||||
static int setupShape(CLuaState &ls);
|
||||
static void setMouseCursor(const std::string texture);
|
||||
static void setMouseCursor(const std::string &texture);
|
||||
// open the window to do a tell to 'player', if 'msg' is not empty, then the message will be sent immediatly
|
||||
// else, current command of the chat window will be replaced with tell 'player'
|
||||
static void tell(const ucstring &player, const ucstring &msg);
|
||||
|
|
|
@ -484,19 +484,19 @@ bool CTool::computeNearestValidSurfaceFromHeightMap(float x, float y, NLMISC::CV
|
|||
|
||||
const CScenarioEntryPoints::CCompleteIsland *islandDesc = getEditor().getIslandCollision().getCurrIslandDesc();
|
||||
if (!islandDesc) return false;
|
||||
|
||||
|
||||
sint mapX = (sint) (x - islandDesc->XMin);
|
||||
sint mapY = (sint) (y - islandDesc->YMin);
|
||||
|
||||
|
||||
if (mapX < 0 || mapY < 0 || mapX >= (islandDesc->XMax - islandDesc->XMin) || mapY >= (islandDesc->YMax - islandDesc->YMin)) return false;
|
||||
sint hmZ = heightMap(mapX, mapY);
|
||||
if (hmZ >= 0x7ffe) return false; // not an accessible pos
|
||||
|
||||
|
||||
if (!isIslandValidPos(heightMap, *islandDesc, x + 0.5f, y) ||
|
||||
!isIslandValidPos(heightMap, *islandDesc, x - 0.5f, y) ||
|
||||
!isIslandValidPos(heightMap, *islandDesc, x, y + 0.5f) ||
|
||||
!isIslandValidPos(heightMap, *islandDesc, x, y - 0.5f)) return false;
|
||||
|
||||
|
||||
float z = 1.f + 2.f * hmZ;
|
||||
// this is a possibly valid position
|
||||
// compute nearest surface from here, and see if not far from the intersection
|
||||
|
@ -515,7 +515,7 @@ bool CTool::computeNearestValidSurfaceFromHeightMap(float x, float y, NLMISC::CV
|
|||
inter1Found = inter1Found && normal1.z >= minAngleSin;
|
||||
inter2Found = inter2Found && normal2.z >= minAngleSin;
|
||||
if (!inter1Found && !inter2Found) return false;
|
||||
|
||||
|
||||
if (inter1Found && inter2Found)
|
||||
{
|
||||
// because z in heightmap in usually a 'ceil' of real height, tends to favor surface below
|
||||
|
@ -797,7 +797,7 @@ bool CTool::isMouseCaptured()
|
|||
}
|
||||
|
||||
// *********************************************************************************************************
|
||||
void CTool::setMouseCursor(const char *cursorTexture)
|
||||
void CTool::setMouseCursor(const std::string &cursorTexture)
|
||||
{
|
||||
//H_AUTO(R2_CTool_setMouseCursor)
|
||||
CViewPointer *cursor = static_cast< CViewPointer* >( CWidgetManager::getInstance()->getPointer() );
|
||||
|
|
|
@ -224,8 +224,7 @@ public:
|
|||
// Get mouse y position
|
||||
static sint32 getMouseY();
|
||||
// Set the current mouse cursor
|
||||
static void setMouseCursor(const char *cursorTexture);
|
||||
static void setMouseCursor(const std::string &cursorTexture) { setMouseCursor(cursorTexture.c_str()); }
|
||||
static void setMouseCursor(const std::string &cursorTexture);
|
||||
/** Compute a view vector (with its direction z set to 1) from coordinate of the mouse on screen
|
||||
* If the mouse is on the island map, then a vector looking down from heights will be returned
|
||||
*/
|
||||
|
|
|
@ -414,21 +414,21 @@ void CToolChoosePos::updateBeforeRender()
|
|||
{
|
||||
if (_MultiPos && isShiftDown() && !_MultiPosLocked)
|
||||
{
|
||||
setMouseCursor(_CursValidMulti.c_str());
|
||||
setMouseCursor(_CursValidMulti);
|
||||
}
|
||||
else
|
||||
{
|
||||
setMouseCursor(_CursValid.c_str());
|
||||
setMouseCursor(_CursValid);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setMouseCursor(_CursInvalid.c_str());
|
||||
setMouseCursor(_CursInvalid);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setMouseCursor(_CursValid.c_str());
|
||||
setMouseCursor(_CursValid);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -596,7 +596,7 @@ void CToolCreateEntity::updateBeforeRender()
|
|||
}
|
||||
CGroupMap *worldMap = getWorldMap();
|
||||
if (worldMap) worldMap->setSelectionAxis(_ValidArray);
|
||||
setMouseCursor(_ValidArray ? _CursValid.c_str() : _CursInvalid.c_str());
|
||||
setMouseCursor(_ValidArray ? _CursValid : _CursInvalid);
|
||||
}
|
||||
|
||||
// ***************************************************************
|
||||
|
|
Loading…
Reference in a new issue