Changed: Removed using namespace in *.h

This commit is contained in:
kervala 2010-09-25 16:02:33 +02:00
parent 243b1e7d38
commit 25eabdf305
31 changed files with 232 additions and 92 deletions

View file

@ -1,5 +1,18 @@
// Browse.cpp : implementation file // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
// //
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h" #include "stdafx.h"

View file

@ -1,3 +1,19 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef _PIC_H_ #ifndef _PIC_H_
#define _PIC_H_ #define _PIC_H_

View file

@ -1,3 +1,19 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef _PIC_PRIVATE_H_ #ifndef _PIC_PRIVATE_H_
#define _PIC_PRIVATE_H_ #define _PIC_PRIVATE_H_

View file

@ -1,3 +1,18 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <assert.h> #include <assert.h>

View file

@ -1,4 +1,18 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef _READPIC_H_ #ifndef _READPIC_H_
#define _READPIC_H_ #define _READPIC_H_

View file

@ -1,5 +1,18 @@
// SelectionTerritoire.cpp : implementation file // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
// //
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h" #include "stdafx.h"
#include "resource.h" #include "resource.h"

View file

@ -1,5 +1,18 @@
// View.cpp : implementation file // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
// //
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h" #include "stdafx.h"
#include "resource.h" #include "resource.h"

View file

@ -1,3 +1,19 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_CTView_H__72269322_0419_4F61_BAA3_1B1BB2D3E34E__INCLUDED_) #if !defined(AFX_CTView_H__72269322_0419_4F61_BAA3_1B1BB2D3E34E__INCLUDED_)
#define AFX_CTView_H__72269322_0419_4F61_BAA3_1B1BB2D3E34E__INCLUDED_ #define AFX_CTView_H__72269322_0419_4F61_BAA3_1B1BB2D3E34E__INCLUDED_

View file

@ -1,6 +1,18 @@
#include "afxwin.h" // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
#include "afxcmn.h" // Copyright (C) 2010 Winch Gate Property Limited
#include "afxdlgs.h" //
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef STDAFX_H #ifndef STDAFX_H
#define STDAFX_H #define STDAFX_H

View file

@ -17,6 +17,8 @@
#include "stdpch.h" #include "stdpch.h"
#include "sky_object_sheet.h" #include "sky_object_sheet.h"
using namespace NLMISC;
///////////////////////////////// /////////////////////////////////
// CSkyObjectSheet::CColorInfo // // CSkyObjectSheet::CColorInfo //
///////////////////////////////// /////////////////////////////////

View file

@ -27,8 +27,6 @@
#include <string> #include <string>
using namespace NLMISC;
const uint SKY_MAX_NUM_STAGE = 4; const uint SKY_MAX_NUM_STAGE = 4;
const uint SKY_MAX_NUM_FX_USER_PARAMS = 4; const uint SKY_MAX_NUM_FX_USER_PARAMS = 4;
@ -88,8 +86,8 @@ public:
CColorInfoSheet ParticleEmitters; CColorInfoSheet ParticleEmitters;
CColorInfoSheet ConstantColor[SKY_MAX_NUM_STAGE]; CColorInfoSheet ConstantColor[SKY_MAX_NUM_STAGE];
CColorGradientInfoSheet ColorGradient; CColorGradientInfoSheet ColorGradient;
CUV TexPanner[SKY_MAX_NUM_STAGE]; NLMISC::CUV TexPanner[SKY_MAX_NUM_STAGE];
CUV OffsetFactor[SKY_MAX_NUM_STAGE]; NLMISC::CUV OffsetFactor[SKY_MAX_NUM_STAGE];
std::string FXUserParamBitmap[SKY_MAX_NUM_FX_USER_PARAMS]; std::string FXUserParamBitmap[SKY_MAX_NUM_FX_USER_PARAMS];
// texture scaling : each bitmap gives a scaling factor depending on weather and the hour of the day // texture scaling : each bitmap gives a scaling factor depending on weather and the hour of the day
std::string OffsetUBitmap[SKY_MAX_NUM_STAGE]; std::string OffsetUBitmap[SKY_MAX_NUM_STAGE];

View file

@ -37,6 +37,7 @@ extern NLLIGO::CLigoConfig LigoConfig;
// *************************************************************************** // ***************************************************************************
using namespace std; using namespace std;
using namespace NLMISC;
using namespace NLLIGO; using namespace NLLIGO;
// *************************************************************************** // ***************************************************************************

View file

@ -65,6 +65,7 @@ extern NL3D::UDriver *Driver;
extern NL3D::UScene *Scene; extern NL3D::UScene *Scene;
extern CEntityManager EntitiesMngr; extern CEntityManager EntitiesMngr;
using namespace NLMISC;
using NLMISC::CUV; using NLMISC::CUV;
using NLMISC::CI18N; using NLMISC::CI18N;
using NLMISC::CRGBA; using NLMISC::CRGBA;

View file

@ -119,6 +119,8 @@
#include "../bg_downloader_access.h" #include "../bg_downloader_access.h"
using namespace NLMISC;
extern CClientChatManager ChatMngr; extern CClientChatManager ChatMngr;
extern CContinentManager ContinentMngr; extern CContinentManager ContinentMngr;
extern CStringMapper *_UIStringMapper; extern CStringMapper *_UIStringMapper;

View file

@ -112,6 +112,7 @@
#endif #endif
const uint32 UI_CACHE_SERIAL_CHECK = (uint32) 'IUG_'; const uint32 UI_CACHE_SERIAL_CHECK = (uint32) 'IUG_';
using namespace NLMISC;
void saveXMLTree(COFile &f, xmlNodePtr node) void saveXMLTree(COFile &f, xmlNodePtr node)
{ {

View file

@ -86,7 +86,7 @@ private:
CInstanceMapDeco _MapDeco; CInstanceMapDeco _MapDeco;
bool _VisualSnapToGroundDone; bool _VisualSnapToGroundDone;
float _LastCamDist; float _LastCamDist;
CMatrix _BBoxMatrix; NLMISC::CMatrix _BBoxMatrix;
NL3D::UVisualCollisionEntity *_VisualCollisionEntity; NL3D::UVisualCollisionEntity *_VisualCollisionEntity;
private: private:
void drawBBox(NLMISC::CRGBA color) const; void drawBBox(NLMISC::CRGBA color) const;

View file

@ -53,6 +53,7 @@
#include "../../entities.h" #include "../../entities.h"
using namespace NLMISC;
using namespace R2; using namespace R2;

View file

@ -20,6 +20,8 @@
#include "../user_entity.h" #include "../user_entity.h"
#include "../time_client.h" #include "../time_client.h"
using namespace NLMISC;
namespace R2 namespace R2
{ {

View file

@ -30,6 +30,8 @@
#include "displayer_visual_entity.h" #include "displayer_visual_entity.h"
using namespace NLMISC;
namespace R2 namespace R2
{ {

View file

@ -27,6 +27,8 @@
// //
#include "game_share/scenario_entry_points.h" #include "game_share/scenario_entry_points.h"
using namespace NLMISC;
namespace R2 namespace R2
{ {

View file

@ -44,7 +44,7 @@ public:
void setDisplayedInstance(CInstance *instance, bool orientable); void setDisplayedInstance(CInstance *instance, bool orientable);
bool isAddedToMap() const { return _AddedToMap; } bool isAddedToMap() const { return _AddedToMap; }
CVector2f getWorldPos() const; NLMISC::CVector2f getWorldPos() const;
/** Set the texture to use when the view in the world map is zoomed-in enough /** Set the texture to use when the view in the world map is zoomed-in enough
* When empty, no close view display is done * When empty, no close view display is done

View file

@ -50,7 +50,7 @@ public:
CToolChoosePos(sint ghostSlot, CToolChoosePos(sint ghostSlot,
const std::string &cursValid = "curs_create.tga", const std::string &cursValid = "curs_create.tga",
const std::string &cursInvalid = "curs_stop.tga", const std::string &cursInvalid = "curs_stop.tga",
const std::vector<CPolygon2D> &polyList = std::vector<CPolygon2D>(), const std::vector<NLMISC::CPolygon2D> &polyList = std::vector<NLMISC::CPolygon2D>(),
const CPrimLook &polyValidLook = CPrimLook(), const CPrimLook &polyValidLook = CPrimLook(),
const CPrimLook &polyInvalidLook = CPrimLook() const CPrimLook &polyInvalidLook = CPrimLook()
); );

View file

@ -42,7 +42,7 @@ public:
const std::string &toolName, const std::string &toolName,
const std::string &cursValid = "curs_create.tga", const std::string &cursValid = "curs_create.tga",
const std::string &cursInvalid = "curs_stop.tga", const std::string &cursInvalid = "curs_stop.tga",
const std::vector<CPolygon2D> &polyList = std::vector<CPolygon2D>(), const std::vector<NLMISC::CPolygon2D> &polyList = std::vector<NLMISC::CPolygon2D>(),
const CPrimLook &polyValidLook = CPrimLook(), const CPrimLook &polyValidLook = CPrimLook(),
const CPrimLook &polyInvalidLook = CPrimLook() const CPrimLook &polyInvalidLook = CPrimLook()
); );

View file

@ -95,7 +95,7 @@ private:
bool checkRoomLeft(); bool checkRoomLeft();
void displayNoMoreRoomLeftMsg(); void displayNoMoreRoomLeftMsg();
// for closed polygon only : test if the current shape is valid (e.g not intersecting, with at least 3 points) // for closed polygon only : test if the current shape is valid (e.g not intersecting, with at least 3 points)
bool isValidPolyShape(bool ignoreLast, std::list<CPolygon> &splitPoly) const; bool isValidPolyShape(bool ignoreLast, std::list<NLMISC::CPolygon> &splitPoly) const;
bool testAccessibleEdges(bool ignoreLast); bool testAccessibleEdges(bool ignoreLast);
void doUpdateBeforeRender(); void doUpdateBeforeRender();
}; };

View file

@ -85,8 +85,8 @@ private:
// retrieve a bitmap from its name, find it in the map if it has already been built, or load it and add it otherwise // retrieve a bitmap from its name, find it in the map if it has already been built, or load it and add it otherwise
NLMISC::CBitmap *buildSharedBitmap(const std::string &filename, NLMISC::CBitmap *buildSharedBitmap(const std::string &filename,
std::map<std::string, CBitmap *> &bitmapByName, std::map<std::string, NLMISC::CBitmap *> &bitmapByName,
std::vector<CBitmap *> &builtBitmaps, std::vector<NLMISC::CBitmap *> &builtBitmaps,
bool &alreadyBuilt bool &alreadyBuilt
); );

View file

@ -43,7 +43,7 @@ public:
class CColorInfo class CColorInfo
{ {
public: public:
CBitmap *Map; // color computed from a map depending on hour & weather (NULL if color is unseted) NLMISC::CBitmap *Map; // color computed from a map depending on hour & weather (NULL if color is unseted)
TSkyColorMode Mode; // how the color is to be used TSkyColorMode Mode; // how the color is to be used
public: public:
CColorInfo() : Map(NULL) {} CColorInfo() : Map(NULL) {}
@ -52,10 +52,10 @@ public:
* \param buildBitmap list of used bitmap (to be completed if required bitmap id not in "bitmapByName") * \param buildBitmap list of used bitmap (to be completed if required bitmap id not in "bitmapByName")
*/ */
void init(const CSkyObjectSheet::CColorInfoSheet &ci, void init(const CSkyObjectSheet::CColorInfoSheet &ci,
std::map<std::string, CBitmap *> &bitmapByName, std::map<std::string, NLMISC::CBitmap *> &bitmapByName,
std::vector<CBitmap *> &buildBitmap); std::vector<NLMISC::CBitmap *> &buildBitmap);
// compute color depending on hour & weather & fog color // compute color depending on hour & weather & fog color
CRGBA computeColor(float dayPart, float weatherLevel, CRGBA fogColor); NLMISC::CRGBA computeColor(float dayPart, float weatherLevel, NLMISC::CRGBA fogColor);
}; };
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// tells how a color gradient is computed in the shape (-> sky dome gradient) // // tells how a color gradient is computed in the shape (-> sky dome gradient) //
@ -69,10 +69,10 @@ public:
* for intermediary weather values, the two nearest bitmap are blended to get the value of the gradient * for intermediary weather values, the two nearest bitmap are blended to get the value of the gradient
*/ */
std::vector<CBitmap *> WeatherToGradient; std::vector<NLMISC::CBitmap *> WeatherToGradient;
CBitmap Slice0[2]; // 2 column for slice 0 NLMISC::CBitmap Slice0[2]; // 2 column for slice 0
CBitmap Slice1[2]; // 2 columns for slice 1 NLMISC::CBitmap Slice1[2]; // 2 columns for slice 1
CBitmap Final; NLMISC::CBitmap Final;
public: public:
// ctor // ctor
CColorGradientInfo() : TargetTextureStage(0) {} CColorGradientInfo() : TargetTextureStage(0) {}
@ -82,9 +82,9 @@ public:
* \param buildBitmap list of used bitmap (to be completed if required bitmaps are not in "bitmapByName") * \param buildBitmap list of used bitmap (to be completed if required bitmaps are not in "bitmapByName")
*/ */
void init(const CSkyObjectSheet::CColorGradientInfoSheet &cgi, void init(const CSkyObjectSheet::CColorGradientInfoSheet &cgi,
std::map<std::string, CBitmap *> &bitmapByName, std::map<std::string, NLMISC::CBitmap *> &bitmapByName,
std::vector<CBitmap *> &buildBitmap); std::vector<NLMISC::CBitmap *> &buildBitmap);
void setup(NL3D::UInstance instance, float dayPart, float weatherLevel, CBitmap &gradientCache, CBitmap &gradientCacheBlurred); void setup(NL3D::UInstance instance, float dayPart, float weatherLevel, NLMISC::CBitmap &gradientCache, NLMISC::CBitmap &gradientCacheBlurred);
}; };
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -97,19 +97,19 @@ public:
CColorGradientInfo ColorGradient; CColorGradientInfo ColorGradient;
TSkyRefColor RefColor; // tells which color info is used to test if object is visible (when alpha is 0, the object must be hidden) TSkyRefColor RefColor; // tells which color info is used to test if object is visible (when alpha is 0, the object must be hidden)
// cache last colors // cache last colors
CRGBA LastDiffuseColor; NLMISC::CRGBA LastDiffuseColor;
CRGBA LastParticleEmittersColor; NLMISC::CRGBA LastParticleEmittersColor;
CRGBA LastConstantColor[SKY_MAX_NUM_STAGE]; NLMISC::CRGBA LastConstantColor[SKY_MAX_NUM_STAGE];
// cache last gradient // cache last gradient
CBitmap GradientCache; NLMISC::CBitmap GradientCache;
CBitmap GradientCacheBlurred; NLMISC::CBitmap GradientCacheBlurred;
CUV TexPanner[SKY_MAX_NUM_STAGE]; NLMISC::CUV TexPanner[SKY_MAX_NUM_STAGE];
CUV OffsetFactor[SKY_MAX_NUM_STAGE]; NLMISC::CUV OffsetFactor[SKY_MAX_NUM_STAGE];
CBitmap *FXUserParams[SKY_MAX_NUM_FX_USER_PARAMS]; NLMISC::CBitmap *FXUserParams[SKY_MAX_NUM_FX_USER_PARAMS];
// texture scaling depending on weather and time // texture scaling depending on weather and time
CBitmap *OffsetUBitmap[SKY_MAX_NUM_STAGE]; NLMISC::CBitmap *OffsetUBitmap[SKY_MAX_NUM_STAGE];
CBitmap *OffsetVBitmap[SKY_MAX_NUM_STAGE]; NLMISC::CBitmap *OffsetVBitmap[SKY_MAX_NUM_STAGE];
std::string Name; std::string Name;
bool Active; bool Active;
@ -149,8 +149,8 @@ public:
*/ */
void init(const CSkyObjectSheet::CVersionSheet &sheet, void init(const CSkyObjectSheet::CVersionSheet &sheet,
NL3D::UInstance instance, NL3D::UInstance instance,
std::map<std::string, CBitmap *> &bitmapByName, std::map<std::string, NLMISC::CBitmap *> &bitmapByName,
std::vector<CBitmap *> &builtBitmaps, std::vector<NLMISC::CBitmap *> &builtBitmaps,
bool visibleInMainScene, bool visibleInMainScene,
bool visibleInEnvMap bool visibleInEnvMap
); );
@ -158,7 +158,7 @@ public:
* \param duskSetup true if the setup os for the dusk (dawn otherwise) * \param duskSetup true if the setup os for the dusk (dawn otherwise)
* \return true if the object is visible * \return true if the object is visible
*/ */
bool setup(const CClientDate &date, const CClientDate &animationDate, float numHoursInDay, float weatherLevel, CRGBA fogColor, bool envMapScene); bool setup(const CClientDate &date, const CClientDate &animationDate, float numHoursInDay, float weatherLevel, NLMISC::CRGBA fogColor, bool envMapScene);
}; };

View file

@ -394,9 +394,9 @@ public:
} }
// get Pair state // get Pair state
TPairState& getPairState(TCLEntityId e); TPairState& getPairState(CLFECOMMON::TCLEntityId e);
// get Pair state // get Pair state
const TPairState& getPairState(TCLEntityId e) const; const TPairState& getPairState(CLFECOMMON::TCLEntityId e) const;
/// User identifier /// User identifier
TUid Uid; TUid Uid;

View file

@ -67,28 +67,28 @@ class CClientHost;
class CVisionProvider; class CVisionProvider;
void fillSHEET( TOutBox& outbox, TPropIndex ); void fillSHEET( TOutBox& outbox, CLFECOMMON::TPropIndex );
void fillBEHAVIOUR( TOutBox& outbox, TPropIndex ); void fillBEHAVIOUR( TOutBox& outbox, CLFECOMMON::TPropIndex );
void fillNAME_STRING_ID( TOutBox& outbox, TPropIndex ); void fillNAME_STRING_ID( TOutBox& outbox, CLFECOMMON::TPropIndex );
void fillTARGET_LIST( TOutBox& outbox, TPropIndex ); void fillTARGET_LIST( TOutBox& outbox, CLFECOMMON::TPropIndex );
void fillVISUAL_FX( TOutBox& outbox, TPropIndex ); void fillVISUAL_FX( TOutBox& outbox, CLFECOMMON::TPropIndex );
void fillBARS( TOutBox& outbox, TPropIndex ); void fillBARS( TOutBox& outbox, CLFECOMMON::TPropIndex );
void fillVisualPropertyABC( TOutBox& outbox, TPropIndex ); void fillVisualPropertyABC( TOutBox& outbox, CLFECOMMON::TPropIndex );
void fillCONTEXTUAL( TOutBox& outbox, TPropIndex propIndex ); void fillCONTEXTUAL( TOutBox& outbox, CLFECOMMON::TPropIndex propIndex );
void fillMODE( TOutBox& outbox, TPropIndex ); void fillMODE( TOutBox& outbox, CLFECOMMON::TPropIndex );
void fillGUILD_SYMBOL( TOutBox& outbox, TPropIndex ); void fillGUILD_SYMBOL( TOutBox& outbox, CLFECOMMON::TPropIndex );
void fillGUILD_NAME_ID( TOutBox& outbox, TPropIndex ); void fillGUILD_NAME_ID( TOutBox& outbox, CLFECOMMON::TPropIndex );
void fillEVENT_FACTION_ID( TOutBox& outbox, TPropIndex ); void fillEVENT_FACTION_ID( TOutBox& outbox, CLFECOMMON::TPropIndex );
void fillPVP_MODE( TOutBox& outbox, TPropIndex ); void fillPVP_MODE( TOutBox& outbox, CLFECOMMON::TPropIndex );
void fillPVP_CLAN( TOutBox& outbox, TPropIndex ); void fillPVP_CLAN( TOutBox& outbox, CLFECOMMON::TPropIndex );
void fillOWNER_PEOPLE( TOutBox& outbox, TPropIndex ); void fillOWNER_PEOPLE( TOutBox& outbox, CLFECOMMON::TPropIndex );
void fillOUTPOST_INFOS( TOutBox& outbox, TPropIndex ); void fillOUTPOST_INFOS( TOutBox& outbox, CLFECOMMON::TPropIndex );
void fillRowProperty( TOutBox& outbox, TPropIndex propIndex ); void fillRowProperty( TOutBox& outbox, CLFECOMMON::TPropIndex propIndex );
class CDistancePrioritizer; class CDistancePrioritizer;
typedef void (*TFillFunc) (TOutBox&, TPropIndex); typedef void (*TFillFunc) (TOutBox&, CLFECOMMON::TPropIndex);
/* /*
* Visual property tree node * Visual property tree node
@ -236,7 +236,7 @@ public:
} }
} }
#define INIT_FLAT_VP_TREE( vpname ) FlatVPTree[ PROPERTY_##vpname ] = (TVPNodeServer*)(discreetRoot->get##vpname##node()) #define INIT_FLAT_VP_TREE( vpname ) FlatVPTree[ CLFECOMMON::PROPERTY_##vpname ] = (TVPNodeServer*)(discreetRoot->get##vpname##node())
#define SET_FILLFUNC( name ) INIT_FLAT_VP_TREE(name); ((TVPNodeServer*)(discreetRoot->get##name##node()))->FillFunc = fill##name #define SET_FILLFUNC( name ) INIT_FLAT_VP_TREE(name); ((TVPNodeServer*)(discreetRoot->get##name##node()))->FillFunc = fill##name
#define SET_FILLFUNC2( nameProp, nameFunc ) INIT_FLAT_VP_TREE(nameProp); ((TVPNodeServer*)(discreetRoot->get##nameProp##node()))->FillFunc = fill##nameFunc #define SET_FILLFUNC2( nameProp, nameFunc ) INIT_FLAT_VP_TREE(nameProp); ((TVPNodeServer*)(discreetRoot->get##nameProp##node()))->FillFunc = fill##nameFunc
@ -247,20 +247,20 @@ public:
TVPNodeBase *discreetRoot = VPB->VPB; TVPNodeBase *discreetRoot = VPB->VPB;
// setup position a orientation manually // setup position a orientation manually
FlatVPTree[ PROPERTY_POSITION ] = (TVPNodeServer*)VPA; FlatVPTree[ CLFECOMMON::PROPERTY_POSITION ] = (TVPNodeServer*)VPA;
FlatVPTree[ PROPERTY_POSX ] = FlatVPTree[ PROPERTY_POSITION ]; FlatVPTree[ CLFECOMMON::PROPERTY_POSX ] = FlatVPTree[ CLFECOMMON::PROPERTY_POSITION ];
FlatVPTree[ PROPERTY_POSY ] = FlatVPTree[ PROPERTY_POSITION ]; FlatVPTree[ CLFECOMMON::PROPERTY_POSY ] = FlatVPTree[ CLFECOMMON::PROPERTY_POSITION ];
FlatVPTree[ PROPERTY_POSZ ] = FlatVPTree[ PROPERTY_POSITION ]; FlatVPTree[ CLFECOMMON::PROPERTY_POSZ ] = FlatVPTree[ CLFECOMMON::PROPERTY_POSITION ];
FlatVPTree[ PROPERTY_ORIENTATION ] = (TVPNodeServer*)(VPB->VPA); FlatVPTree[ CLFECOMMON::PROPERTY_ORIENTATION ] = (TVPNodeServer*)(VPB->VPA);
SET_FILLFUNC( SHEET ); SET_FILLFUNC( SHEET );
SET_FILLFUNC( BEHAVIOUR ); SET_FILLFUNC( BEHAVIOUR );
SET_FILLFUNC( NAME_STRING_ID ); SET_FILLFUNC( NAME_STRING_ID );
SET_FILLFUNC( TARGET_LIST ); SET_FILLFUNC( TARGET_LIST );
FlatVPTree[ PROPERTY_TARGET_LIST_0 ] = FlatVPTree[ PROPERTY_TARGET_LIST ]; FlatVPTree[ CLFECOMMON::PROPERTY_TARGET_LIST_0 ] = FlatVPTree[ CLFECOMMON::PROPERTY_TARGET_LIST ];
FlatVPTree[ PROPERTY_TARGET_LIST_1 ] = FlatVPTree[ PROPERTY_TARGET_LIST ]; FlatVPTree[ CLFECOMMON::PROPERTY_TARGET_LIST_1 ] = FlatVPTree[ CLFECOMMON::PROPERTY_TARGET_LIST ];
FlatVPTree[ PROPERTY_TARGET_LIST_2 ] = FlatVPTree[ PROPERTY_TARGET_LIST ]; FlatVPTree[ CLFECOMMON::PROPERTY_TARGET_LIST_2 ] = FlatVPTree[ CLFECOMMON::PROPERTY_TARGET_LIST ];
FlatVPTree[ PROPERTY_TARGET_LIST_3 ] = FlatVPTree[ PROPERTY_TARGET_LIST ]; FlatVPTree[ CLFECOMMON::PROPERTY_TARGET_LIST_3 ] = FlatVPTree[ CLFECOMMON::PROPERTY_TARGET_LIST ];
SET_FILLFUNC( VISUAL_FX ); SET_FILLFUNC( VISUAL_FX );
SET_FILLFUNC( CONTEXTUAL ); SET_FILLFUNC( CONTEXTUAL );
SET_FILLFUNC( MODE ); SET_FILLFUNC( MODE );
@ -546,7 +546,7 @@ public:
* Test the criterion for discreet properties + initialized * Test the criterion for discreet properties + initialized
*/ */
template <class T> template <class T>
bool discreetPropertyHasChanged(const CPropertyHistory::CPropertyEntry& entry, const CMirrorPropValueRO<T>& currentValue, TPropIndex propIndex, T* ) const bool discreetPropertyHasChanged(const CPropertyHistory::CPropertyEntry& entry, const CMirrorPropValueRO<T>& currentValue, CLFECOMMON::TPropIndex propIndex, T* ) const
{ {
// Although the client should already know the sheet id of the controlled player, let's send it // Although the client should already know the sheet id of the controlled player, let's send it
//if ( (propIndex==PROPERTY_SHEET) && (TVPNodeServer::PrioContext.Slot == 0) ) //if ( (propIndex==PROPERTY_SHEET) && (TVPNodeServer::PrioContext.Slot == 0) )
@ -585,7 +585,7 @@ public:
/* /*
* Test the criterion + initialized: overload for row properties (specialization syntax is too much different among compilers) * Test the criterion + initialized: overload for row properties (specialization syntax is too much different among compilers)
*/ */
bool discreetPropertyHasChanged(const CPropertyHistory::CPropertyEntry& entry, const CMirrorPropValueRO<TEntityIndex>& currentValue, TPropIndex propIndex, TDataSetRow* ) const bool discreetPropertyHasChanged(const CPropertyHistory::CPropertyEntry& entry, const CMirrorPropValueRO<TEntityIndex>& currentValue, CLFECOMMON::TPropIndex propIndex, TDataSetRow* ) const
{ {
if (entry.HasValue) if (entry.HasValue)
{ {
@ -678,7 +678,7 @@ public:
* Test the criterion for target list + initialized * Test the criterion for target list + initialized
*/ */
template <class T> template <class T>
bool targetListHasChanged(const CPropertyHistory::CPropertyEntry& entry, TPropIndex propIndex, T* ) const bool targetListHasChanged(const CPropertyHistory::CPropertyEntry& entry, CLFECOMMON::TPropIndex propIndex, T* ) const
{ {
// Although the client should already know the sheet id of the controlled player, let's send it // Although the client should already know the sheet id of the controlled player, let's send it
//if ( (propIndex==PROPERTY_SHEET) && (TVPNodeServer::PrioContext.Slot == 0) ) //if ( (propIndex==PROPERTY_SHEET) && (TVPNodeServer::PrioContext.Slot == 0) )
@ -731,7 +731,7 @@ private:
CHistory *_History; CHistory *_History;
/// Distance threshold /// Distance threshold
CLFECOMMON::TCoord _DistThresholdTable [NB_VISUAL_PROPERTIES]; CLFECOMMON::TCoord _DistThresholdTable [CLFECOMMON::NB_VISUAL_PROPERTIES];
uint32 _DistanceDeltaRatio; uint32 _DistanceDeltaRatio;
}; };

View file

@ -23,6 +23,7 @@
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;
using namespace CLFECOMMON;
const TDataSetIndex LAST_VISION_CHANGE = LAST_CHANGED; const TDataSetIndex LAST_VISION_CHANGE = LAST_CHANGED;

View file

@ -41,8 +41,6 @@ inline uint32 asUInt32<TDataSetRow> (const TDataSetRow& obj)
return obj.getIndex(); return obj.getIndex();
} }
using namespace CLFECOMMON;
extern bool verboseVision; extern bool verboseVision;
extern NLMISC::CLog *TmpDebugLogger; extern NLMISC::CLog *TmpDebugLogger;
@ -89,13 +87,13 @@ typedef std::set< CLFECOMMON::TCLEntityId > TSetOfRemovedEntities;
struct CEntity struct CEntity
{ {
/// Cache for property initialized /// Cache for property initialized
bool PropInitialized[NB_VISUAL_PROPERTIES]; bool PropInitialized[CLFECOMMON::NB_VISUAL_PROPERTIES];
/// Property X direct access + previous value /// Property X direct access + previous value
CMirrorPropValueROCF<TCoord> X; CMirrorPropValueROCF<CLFECOMMON::TCoord> X;
/// Property Y direct access + previous value /// Property Y direct access + previous value
CMirrorPropValueROCF<TCoord> Y; CMirrorPropValueROCF<CLFECOMMON::TCoord> Y;
#ifdef STORE_MIRROR_VP_IN_CLASS #ifdef STORE_MIRROR_VP_IN_CLASS
CMirrorPropValueRO<TYPE_SHEET> VP_SHEET; CMirrorPropValueRO<TYPE_SHEET> VP_SHEET;
@ -192,7 +190,7 @@ struct CEntity
} }
/// Return the current cached state without checking the value /// Return the current cached state without checking the value
bool propIsInitializedState( TPropIndex propIndex ) const bool propIsInitializedState( CLFECOMMON::TPropIndex propIndex ) const
{ {
return PropInitialized[propIndex]; return PropInitialized[propIndex];
} }
@ -201,7 +199,7 @@ struct CEntity
* For positions, use positionIsInitialized() instead. * For positions, use positionIsInitialized() instead.
*/ */
template <class T> template <class T>
bool propertyIsInitialized( TPropIndex propIndex, TPropertyIndex dsPropertyIndex, const TEntityIndex& entityIndex, T* pt ) bool propertyIsInitialized( CLFECOMMON::TPropIndex propIndex, TPropertyIndex dsPropertyIndex, const TEntityIndex& entityIndex, T* pt )
{ {
return PropInitialized[propIndex] || checkPropertyInitialized( propIndex, dsPropertyIndex, entityIndex, pt ); return PropInitialized[propIndex] || checkPropertyInitialized( propIndex, dsPropertyIndex, entityIndex, pt );
} }
@ -209,18 +207,18 @@ struct CEntity
/// Return if the position of the current processed entity is initialized /// Return if the position of the current processed entity is initialized
bool positionIsInitialized( const TEntityIndex& entityIndex ) bool positionIsInitialized( const TEntityIndex& entityIndex )
{ {
return PropInitialized[PROPERTY_POSITION] || checkPositionInitialized( entityIndex ); return PropInitialized[CLFECOMMON::PROPERTY_POSITION] || checkPositionInitialized( entityIndex );
} }
/// Return if the position of the current processed entity is initialized /// Return if the position of the current processed entity is initialized
bool positionIsInitialized() bool positionIsInitialized()
{ {
return PropInitialized[PROPERTY_POSITION] || checkPositionInitialized(); return PropInitialized[CLFECOMMON::PROPERTY_POSITION] || checkPositionInitialized();
} }
/// Helper for propertyIsInitialized() /// Helper for propertyIsInitialized()
template <class T> template <class T>
bool checkPropertyInitialized( TPropIndex propIndex, TPropertyIndex dsPropertyIndex, const TEntityIndex& entityIndex, T* ) bool checkPropertyInitialized( CLFECOMMON::TPropIndex propIndex, TPropertyIndex dsPropertyIndex, const TEntityIndex& entityIndex, T* )
{ {
CMirrorPropValueRO<T> value( *DataSet, entityIndex, dsPropertyIndex ); CMirrorPropValueRO<T> value( *DataSet, entityIndex, dsPropertyIndex );
return PropInitialized[propIndex] = ( value() != 0 ); return PropInitialized[propIndex] = ( value() != 0 );
@ -236,7 +234,7 @@ struct CEntity
} }
/// Helper for propertyIsInitialized(): overload for row properties (specialization syntax is too much different among compilers) /// Helper for propertyIsInitialized(): overload for row properties (specialization syntax is too much different among compilers)
bool checkPropertyInitialized( TPropIndex propIndex, TPropertyIndex dsPropertyIndex, const TEntityIndex& entityIndex, TDataSetRow* ) bool checkPropertyInitialized( CLFECOMMON::TPropIndex propIndex, TPropertyIndex dsPropertyIndex, const TEntityIndex& entityIndex, TDataSetRow* )
{ {
CMirrorPropValueRO<TDataSetRow> value( *DataSet, entityIndex, dsPropertyIndex ); CMirrorPropValueRO<TDataSetRow> value( *DataSet, entityIndex, dsPropertyIndex );
return PropInitialized[propIndex] = ( asUInt32<TDataSetRow>(value()) != 0 ); return PropInitialized[propIndex] = ( asUInt32<TDataSetRow>(value()) != 0 );
@ -254,7 +252,7 @@ struct CEntity
/// Helper for positionIsInitialized() /// Helper for positionIsInitialized()
bool checkPositionInitialized( const TEntityIndex& entityIndex ) bool checkPositionInitialized( const TEntityIndex& entityIndex )
{ {
return PropInitialized[PROPERTY_POSITION] = (X() != 0 || Y() != 0); return PropInitialized[CLFECOMMON::PROPERTY_POSITION] = (X() != 0 || Y() != 0);
/* /*
if ( ! ((X() == 0) && (Y() == 0)) ) // not local pos because can be 0 0 if ( ! ((X() == 0) && (Y() == 0)) ) // not local pos because can be 0 0
{ {
@ -272,7 +270,7 @@ struct CEntity
/// Helper for positionIsInitialized() /// Helper for positionIsInitialized()
bool checkPositionInitialized() bool checkPositionInitialized()
{ {
return PropInitialized[PROPERTY_POSITION] = (X() != 0 || Y() != 0); return PropInitialized[CLFECOMMON::PROPERTY_POSITION] = (X() != 0 || Y() != 0);
} }
@ -355,7 +353,7 @@ struct CEntity
//H_AFTER(YMileage) //H_AFTER(YMileage)
} }
void displayProperties( const TEntityIndex& entityIndex, NLMISC::CLog *log=NLMISC::InfoLog, TClientId optClientId=INVALID_CLIENT, CLFECOMMON::TCLEntityId optSlot=INVALID_SLOT ) const; void displayProperties( const TEntityIndex& entityIndex, NLMISC::CLog *log=NLMISC::InfoLog, TClientId optClientId=INVALID_CLIENT, CLFECOMMON::TCLEntityId optSlot=CLFECOMMON::INVALID_SLOT ) const;
static void fillVisualPropertiesFromMirror( uint64 properties[], const TEntityIndex& entityIndex ); static void fillVisualPropertiesFromMirror( uint64 properties[], const TEntityIndex& entityIndex );
}; };
@ -404,7 +402,7 @@ public:
} }
/// Convert a visual property index into a dataset property index (access to a static array) /// Convert a visual property index into a dataset property index (access to a static array)
static TPropertyIndex propertyIndexInDataSetToVisualPropIndex( TPropIndex vPropIndex ) static TPropertyIndex propertyIndexInDataSetToVisualPropIndex( CLFECOMMON::TPropIndex vPropIndex )
{ {
return _VisualPropIndexToDataSet[vPropIndex]; return _VisualPropIndexToDataSet[vPropIndex];
} }
@ -430,7 +428,7 @@ public:
protected: protected:
/// Set the mapping and return the dataset property index /// Set the mapping and return the dataset property index
TPropertyIndex mapVisualPropIndex( const std::string& propName, TPropIndex vPropIndex ); TPropertyIndex mapVisualPropIndex( const std::string& propName, CLFECOMMON::TPropIndex vPropIndex );
/// Return the property index at startup /// Return the property index at startup
TPropertyIndex getPropertyIndex( const std::string& propName ) const; TPropertyIndex getPropertyIndex( const std::string& propName ) const;

View file

@ -26,6 +26,7 @@
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;
using namespace NLNET; using namespace NLNET;
using namespace CLFECOMMON;
extern CGenericXmlMsgHeaderManager GenericXmlMsgHeaderMngr; extern CGenericXmlMsgHeaderManager GenericXmlMsgHeaderMngr;