Merge with develop

This commit is contained in:
kervala 2016-12-04 17:32:34 +01:00
parent 916f1b008b
commit 18ca67b199
330 changed files with 1952 additions and 1703 deletions

View file

@ -19,6 +19,8 @@
#include "nel/misc/types_nl.h" #include "nel/misc/types_nl.h"
#include "nel/misc/bit_set.h" #include "nel/misc/bit_set.h"
#include "nel/misc/smart_ptr.h"
#include <string> #include <string>
#include <vector> #include <vector>
#include <map> #include <map>

View file

@ -21,13 +21,17 @@
#include "nel/misc/types_nl.h" #include "nel/misc/types_nl.h"
#include "nel/misc/smart_ptr.h" #include "nel/misc/smart_ptr.h"
#include "nel/3d/animatable.h" #include "nel/3d/animatable.h"
#include "nel/3d/track.h" #include "nel/3d/track.h"
#include <map> #include <map>
namespace NL3D namespace NL3D
{ {
class CScene;
// *************************************************************************** // ***************************************************************************
/** /**
* An animated lightmap * An animated lightmap

View file

@ -88,7 +88,7 @@ private:
public: public:
std::string MeshName; std::string MeshName;
public: public:
CMeshLoad (const std::string &meshName, IShape **ppShp, IDriver *pDriver, const CVector &position, uint selectedTexture); CMeshLoad (const std::string &meshName, IShape **ppShp, IDriver *pDriver, const NLMISC::CVector &position, uint selectedTexture);
void run (void); void run (void);
void getName (std::string &result) const; void getName (std::string &result) const;
}; };
@ -122,7 +122,7 @@ private:
CTextureFile *TextureFile; CTextureFile *TextureFile;
bool *Signal; bool *Signal;
public: public:
CTextureLoad(CTextureFile *textureFile, bool *psgn, const CVector &position) CTextureLoad(CTextureFile *textureFile, bool *psgn, const NLMISC::CVector &position)
: TextureFile(textureFile), Signal(psgn) : TextureFile(textureFile), Signal(psgn)
{ {
Position = position; Position = position;

View file

@ -152,7 +152,7 @@ private:
struct CTextureLodToSort struct CTextureLodToSort
{ {
CTextureLod *Lod; CTextureLod *Lod;
CVector Position; NLMISC::CVector Position;
bool operator<(const CTextureLodToSort &other) const bool operator<(const CTextureLodToSort &other) const
{ {
return Lod->Weight<other.Lod->Weight; return Lod->Weight<other.Lod->Weight;

View file

@ -20,6 +20,7 @@
#include "nel/misc/types_nl.h" #include "nel/misc/types_nl.h"
#include "nel/misc/vector.h" #include "nel/misc/vector.h"
#include "nel/misc/plane.h" #include "nel/misc/plane.h"
#include "nel/misc/aabbox.h"
namespace NL3D { namespace NL3D {
@ -39,16 +40,16 @@ public:
/** build the camera collision as a cone or a cylinder /** build the camera collision as a cone or a cylinder
*/ */
void build(const CVector &start, const CVector &end, float radius, bool cone); void build(const NLMISC::CVector &start, const NLMISC::CVector &end, float radius, bool cone);
/** build the camera collision as a simple ray /** build the camera collision as a simple ray
*/ */
void buildRay(const CVector &start, const CVector &end); void buildRay(const NLMISC::CVector &start, const NLMISC::CVector &end);
/** compute the intersection of the Camera Volume against the triangle, and minimize /** compute the intersection of the Camera Volume against the triangle, and minimize
* minDist (actual square of distance) with min sqr distance of the poly. * minDist (actual square of distance) with min sqr distance of the poly.
*/ */
void minimizeDistanceAgainstTri(const CVector &p0, const CVector &p1, const CVector &p2, float &sqrMinDist); void minimizeDistanceAgainstTri(const NLMISC::CVector &p0, const NLMISC::CVector &p1, const NLMISC::CVector &p2, float &sqrMinDist);
/** Compute into this the camera collision 'other' mul by 'matrix' /** Compute into this the camera collision 'other' mul by 'matrix'
* NB: for cone Radius, suppose uniform scale, else will have strange result (a uniform scale is deduced) * NB: for cone Radius, suppose uniform scale, else will have strange result (a uniform scale is deduced)
@ -69,9 +70,9 @@ private:
enum {MaxNPlanes=6}; enum {MaxNPlanes=6};
// The start of the camera raycast // The start of the camera raycast
CVector _Start; NLMISC::CVector _Start;
// The end of the camera raycast // The end of the camera raycast
CVector _End; NLMISC::CVector _End;
// The radius (at end only if cone) // The radius (at end only if cone)
float _Radius; float _Radius;
// cone or cylinder? // cone or cylinder?
@ -83,8 +84,8 @@ private:
NLMISC::CAABBox _BBox; NLMISC::CAABBox _BBox;
// Temp Data for minimizeDistanceAgainstTri // Temp Data for minimizeDistanceAgainstTri
CVector _ArrayIn[3+MaxNPlanes]; NLMISC::CVector _ArrayIn[3+MaxNPlanes];
CVector _ArrayOut[3+MaxNPlanes]; NLMISC::CVector _ArrayOut[3+MaxNPlanes];
// The pyramid representing the camera collision volume. Nb: local to start for precision problems // The pyramid representing the camera collision volume. Nb: local to start for precision problems
NLMISC::CPlane _Pyramid[MaxNPlanes]; NLMISC::CPlane _Pyramid[MaxNPlanes];
@ -97,10 +98,10 @@ private:
float _MaxRadiusProj; float _MaxRadiusProj;
float _OODeltaRadiusProj; float _OODeltaRadiusProj;
float _RayLen; float _RayLen;
CVector _RayNorm; NLMISC::CVector _RayNorm;
// simpler method for simple ray // simpler method for simple ray
void intersectRay(const CVector &p0, const CVector &p1, const CVector &p2, float &sqrMinDist); void intersectRay(const NLMISC::CVector &p0, const NLMISC::CVector &p1, const NLMISC::CVector &p2, float &sqrMinDist);
}; };

View file

@ -22,6 +22,7 @@ namespace NL3D
class UDriver; class UDriver;
class UCamera; class UCamera;
class CCloudScape; class CCloudScape;
class CScene;
/// implementation of UWaterInstance methods /// implementation of UWaterInstance methods
class CCloudScapeUser : public UCloudScape class CCloudScapeUser : public UCloudScape

View file

@ -48,7 +48,7 @@ public:
static void releaseInstance(); static void releaseInstance();
/// convert a HLS (0..255) to a RGBA. /// convert a HLS (0..255) to a RGBA.
CRGBA convert(uint H, uint L, uint S); NLMISC::CRGBA convert(uint H, uint L, uint S);
/// convert a RGBA bitmap into another RGBA, with HLS decal (0..255, -255..+255, -255..+255). /// convert a RGBA bitmap into another RGBA, with HLS decal (0..255, -255..+255, -255..+255).
void convertRGBABitmap(NLMISC::CBitmap &dst, const NLMISC::CBitmap &src, uint8 dh, sint dl, sint ds); void convertRGBABitmap(NLMISC::CBitmap &dst, const NLMISC::CBitmap &src, uint8 dh, sint dl, sint ds);
@ -75,7 +75,7 @@ private:
uint8 H,L,S,A; uint8 H,L,S,A;
}; };
CRGBA _HueTable[HueTableSize]; NLMISC::CRGBA _HueTable[HueTableSize];
CHLSA _Color16ToHLS[65536]; CHLSA _Color16ToHLS[65536];
/// Constructor /// Constructor

View file

@ -27,7 +27,8 @@
#ifndef NL3D_GPU_PROGRAM_PARAMS_H #ifndef NL3D_GPU_PROGRAM_PARAMS_H
#define NL3D_GPU_PROGRAM_PARAMS_H #define NL3D_GPU_PROGRAM_PARAMS_H
#include <nel/misc/types_nl.h>
#include "nel/misc/types_nl.h"
// STL includes // STL includes
#include <map> #include <map>
@ -167,7 +168,7 @@ private:
std::map<std::string, size_t> m_MapName; // map from name to offset std::map<std::string, size_t> m_MapName; // map from name to offset
size_t m_First; size_t m_First;
size_t m_Last; size_t m_Last;
static const size_t s_End = -1; static const size_t s_End;
}; /* class CGPUProgramParams */ }; /* class CGPUProgramParams */

View file

@ -26,6 +26,7 @@
namespace NL3D namespace NL3D
{ {
class CInstanceGroup;
// *************************************************************************** // ***************************************************************************
/** /**
@ -106,14 +107,14 @@ public:
public: public:
/// Debug: build a colored Grid mesh of SunContribution. /// Debug: build a colored Grid mesh of SunContribution.
void buildSunDebugMesh(CMesh::CMeshBuild &meshBuild, CMeshBase::CMeshBaseBuild &meshBaseBuild, const CVector &deltaPos=CVector::Null); void buildSunDebugMesh(CMesh::CMeshBuild &meshBuild, CMeshBase::CMeshBaseBuild &meshBaseBuild, const NLMISC::CVector &deltaPos= NLMISC::CVector::Null);
/// Debug: build a colored Grid mesh of PointLight. R= pointLight1 id. G= PointLight2 id. B= The multiplier used to show Ids. /// Debug: build a colored Grid mesh of PointLight. R= pointLight1 id. G= PointLight2 id. B= The multiplier used to show Ids.
void buildPLDebugMesh(CMesh::CMeshBuild &meshBuild, CMeshBase::CMeshBaseBuild &meshBaseBuild, const CVector &deltaPos, const CInstanceGroup &igOut); void buildPLDebugMesh(CMesh::CMeshBuild &meshBuild, CMeshBase::CMeshBaseBuild &meshBaseBuild, const NLMISC::CVector &deltaPos, const CInstanceGroup &igOut);
private: private:
void addDebugMeshFaces(CMesh::CMeshBuild &meshBuild, CSurface &surface, uint vId0, void addDebugMeshFaces(CMesh::CMeshBuild &meshBuild, CSurface &surface, uint vId0,
const std::vector<CRGBA> &colors); const std::vector<NLMISC::CRGBA> &colors);
}; };

View file

@ -47,7 +47,7 @@ public:
float a31, a32, a33, a34; float a31, a32, a33, a34;
// Copy from a matrix. // Copy from a matrix.
void set(const CMatrix &mat) void set(const NLMISC::CMatrix &mat)
{ {
const float *m =mat.get(); const float *m =mat.get();
a11= m[0]; a12= m[4]; a13= m[8] ; a14= m[12]; a11= m[0]; a12= m[4]; a13= m[8] ; a14= m[12];
@ -57,14 +57,14 @@ public:
// mulSetvector. NB: in should be different as v!! (else don't work). // mulSetvector. NB: in should be different as v!! (else don't work).
void mulSetVector(const CVector &in, CVector &out) void mulSetVector(const NLMISC::CVector &in, NLMISC::CVector &out)
{ {
out.x= (a11*in.x + a12*in.y + a13*in.z); out.x= (a11*in.x + a12*in.y + a13*in.z);
out.y= (a21*in.x + a22*in.y + a23*in.z); out.y= (a21*in.x + a22*in.y + a23*in.z);
out.z= (a31*in.x + a32*in.y + a33*in.z); out.z= (a31*in.x + a32*in.y + a33*in.z);
} }
// mulSetpoint. NB: in should be different as v!! (else don't work). // mulSetpoint. NB: in should be different as v!! (else don't work).
void mulSetPoint(const CVector &in, CVector &out) void mulSetPoint(const NLMISC::CVector &in, NLMISC::CVector &out)
{ {
out.x= (a11*in.x + a12*in.y + a13*in.z + a14); out.x= (a11*in.x + a12*in.y + a13*in.z + a14);
out.y= (a21*in.x + a22*in.y + a23*in.z + a24); out.y= (a21*in.x + a22*in.y + a23*in.z + a24);
@ -73,14 +73,14 @@ public:
// mulSetvector. NB: in should be different as v!! (else don't work). // mulSetvector. NB: in should be different as v!! (else don't work).
void mulSetVector(const CVector &in, float scale, CVector &out) void mulSetVector(const NLMISC::CVector &in, float scale, NLMISC::CVector &out)
{ {
out.x= (a11*in.x + a12*in.y + a13*in.z) * scale; out.x= (a11*in.x + a12*in.y + a13*in.z) * scale;
out.y= (a21*in.x + a22*in.y + a23*in.z) * scale; out.y= (a21*in.x + a22*in.y + a23*in.z) * scale;
out.z= (a31*in.x + a32*in.y + a33*in.z) * scale; out.z= (a31*in.x + a32*in.y + a33*in.z) * scale;
} }
// mulSetpoint. NB: in should be different as v!! (else don't work). // mulSetpoint. NB: in should be different as v!! (else don't work).
void mulSetPoint(const CVector &in, float scale, CVector &out) void mulSetPoint(const NLMISC::CVector &in, float scale, NLMISC::CVector &out)
{ {
out.x= (a11*in.x + a12*in.y + a13*in.z + a14) * scale; out.x= (a11*in.x + a12*in.y + a13*in.z + a14) * scale;
out.y= (a21*in.x + a22*in.y + a23*in.z + a24) * scale; out.y= (a21*in.x + a22*in.y + a23*in.z + a24) * scale;
@ -89,14 +89,14 @@ public:
// mulAddvector. NB: in should be different as v!! (else don't work). // mulAddvector. NB: in should be different as v!! (else don't work).
void mulAddVector(const CVector &in, float scale, CVector &out) void mulAddVector(const NLMISC::CVector &in, float scale, NLMISC::CVector &out)
{ {
out.x+= (a11*in.x + a12*in.y + a13*in.z) * scale; out.x+= (a11*in.x + a12*in.y + a13*in.z) * scale;
out.y+= (a21*in.x + a22*in.y + a23*in.z) * scale; out.y+= (a21*in.x + a22*in.y + a23*in.z) * scale;
out.z+= (a31*in.x + a32*in.y + a33*in.z) * scale; out.z+= (a31*in.x + a32*in.y + a33*in.z) * scale;
} }
// mulAddpoint. NB: in should be different as v!! (else don't work). // mulAddpoint. NB: in should be different as v!! (else don't work).
void mulAddPoint(const CVector &in, float scale, CVector &out) void mulAddPoint(const NLMISC::CVector &in, float scale, NLMISC::CVector &out)
{ {
out.x+= (a11*in.x + a12*in.y + a13*in.z + a14) * scale; out.x+= (a11*in.x + a12*in.y + a13*in.z + a14) * scale;
out.y+= (a21*in.x + a22*in.y + a23*in.z + a24) * scale; out.y+= (a21*in.x + a22*in.y + a23*in.z + a24) * scale;

View file

@ -124,7 +124,7 @@ private:
double _LastSceneTime; double _LastSceneTime;
// maximum amplitude vector for each level. Stored in mesh because same for all instances. // maximum amplitude vector for each level. Stored in mesh because same for all instances.
CVector _MaxDeltaPos[HrcDepth]; NLMISC::CVector _MaxDeltaPos[HrcDepth];
float _MaxVertexMove; float _MaxVertexMove;
// MBR Cache // MBR Cache

View file

@ -87,7 +87,7 @@ private:
{ {
public: public:
CParticleSystemModel *Model; CParticleSystemModel *Model;
CMatrix OldAncestorMatOrRelPos; // last matrix of ancestor skeleton or relative matrix of ps to its ancestor (see flag below) NLMISC::CMatrix OldAncestorMatOrRelPos; // last matrix of ancestor skeleton or relative matrix of ps to its ancestor (see flag below)
bool IsRelMatrix; // gives usage of the field OldAncestorMatOrRelPos bool IsRelMatrix; // gives usage of the field OldAncestorMatOrRelPos
bool HasAncestorSkeleton; // has the system an ancestor skeleton ? bool HasAncestorSkeleton; // has the system an ancestor skeleton ?
public: public:

View file

@ -654,7 +654,7 @@ template<class T> typename CQuadGrid<T>::CIterator CQuadGrid<T>::erase(typename
if(!ptr->Selected) if(!ptr->Selected)
next= NULL; next= NULL;
// delete the object. // delete the object.
_NodeBlockMemory.free(ptr); _NodeBlockMemory.freeBlock(ptr);
return CIterator((CNode*)next); return CIterator((CNode*)next);

View file

@ -53,7 +53,7 @@ public:
public: public:
// Simple Definition of a mesh used to test against Ray // Simple Definition of a mesh used to test against Ray
std::vector<CVector> Vertices; std::vector<NLMISC::CVector> Vertices;
std::vector<uint32> Triangles; std::vector<uint32> Triangles;
/// Empty? /// Empty?

View file

@ -28,6 +28,8 @@
#include "nel/3d/shadow_map_manager.h" #include "nel/3d/shadow_map_manager.h"
#include "nel/3d/u_scene.h" #include "nel/3d/u_scene.h"
#include "nel/3d/vertex_program.h" #include "nel/3d/vertex_program.h"
#include "nel/3d/transform.h"
#include <vector> #include <vector>

View file

@ -22,7 +22,7 @@
#include "nel/misc/smart_ptr.h" #include "nel/misc/smart_ptr.h"
#include "nel/misc/vector.h" #include "nel/misc/vector.h"
#include "nel/misc/aabbox.h" #include "nel/misc/aabbox.h"
#include "nel/misc/class_id.h"
#include "nel/3d/texture.h" #include "nel/3d/texture.h"
#include "nel/3d/shape.h" #include "nel/3d/shape.h"

View file

@ -51,7 +51,7 @@ public:
* The usage of this matrix is for UV projection: XYZ= WorldProjectionMatrix * UVW. * The usage of this matrix is for UV projection: XYZ= WorldProjectionMatrix * UVW.
* NB: Vj (ie for W) is mapped such that Vp means NearClip of the shadow and Vp+Vj means FarClip of the shadow * NB: Vj (ie for W) is mapped such that Vp means NearClip of the shadow and Vp+Vj means FarClip of the shadow
*/ */
CMatrix LocalProjectionMatrix; NLMISC::CMatrix LocalProjectionMatrix;
/** Computed at shadow casting time. They are clipping planes used to clip receivers (mirror of the OBB). /** Computed at shadow casting time. They are clipping planes used to clip receivers (mirror of the OBB).
* Receivers may use them to clip sub received parts (as they which) * Receivers may use them to clip sub received parts (as they which)
@ -63,7 +63,7 @@ public:
/** Computed at shadow casting time. This is the LocalPos Bouding Box containing the shadow (AxisAligned). /** Computed at shadow casting time. This is the LocalPos Bouding Box containing the shadow (AxisAligned).
* \see generateClipInfoFromMatrix() * \see generateClipInfoFromMatrix()
*/ */
CAABBox LocalBoundingBox; NLMISC::CAABBox LocalBoundingBox;
// Filled by ShadowMapManager. This is the Last Frame Id we had update the texture. // Filled by ShadowMapManager. This is the Last Frame Id we had update the texture.
@ -114,13 +114,13 @@ public:
* driver->setupModelMatrix(localPosMatrix); * driver->setupModelMatrix(localPosMatrix);
* Then render his mesh. * Then render his mesh.
*/ */
void buildCasterCameraMatrix(const CVector &lightDir, const CMatrix &localPosMatrix, const CAABBox &bbShape, CMatrix &cameraMatrix); void buildCasterCameraMatrix(const NLMISC::CVector &lightDir, const NLMISC::CMatrix &localPosMatrix, const NLMISC::CAABBox &bbShape, NLMISC::CMatrix &cameraMatrix);
/** From the Camera matrix computed with buildCasterCameraMatrix, compute the LocalProjectionMatrix, which modify the /** From the Camera matrix computed with buildCasterCameraMatrix, compute the LocalProjectionMatrix, which modify the
* J axis according to backPoint and Shadow Depth. * J axis according to backPoint and Shadow Depth.
* NB: automatically calls the buildClipInfoFromMatrix() method * NB: automatically calls the buildClipInfoFromMatrix() method
*/ */
void buildProjectionInfos(const CMatrix &cameraMatrix, const CVector &backPoint, float shadowMaxDepth); void buildProjectionInfos(const NLMISC::CMatrix &cameraMatrix, const NLMISC::CVector &backPoint, float shadowMaxDepth);
/** The ShadowMap Caster can call this method after setting LocalProjectionMatrix. It computes auto the /** The ShadowMap Caster can call this method after setting LocalProjectionMatrix. It computes auto the
* LocalClipPlanes and LocalBoundingBox from it. NB: don't use it if you use buildProjectionInfos(). * LocalClipPlanes and LocalBoundingBox from it. NB: don't use it if you use buildProjectionInfos().
@ -158,13 +158,13 @@ class CShadowMapProjector
{ {
public: public:
CShadowMapProjector(); CShadowMapProjector();
void setWorldSpaceTextMat(const CMatrix &ws); void setWorldSpaceTextMat(const NLMISC::CMatrix &ws);
void applyToMaterial(const CMatrix &receiverWorldMatrix, CMaterial &material); void applyToMaterial(const NLMISC::CMatrix &receiverWorldMatrix, CMaterial &material);
private: private:
CMatrix _WsTextMat; NLMISC::CMatrix _WsTextMat;
CMatrix _XYZToUWVMatrix; NLMISC::CMatrix _XYZToUWVMatrix;
CMatrix _XYZToWUVMatrix; NLMISC::CMatrix _XYZToWUVMatrix;
}; };

View file

@ -30,6 +30,7 @@ namespace NL3D {
class CTransform; class CTransform;
class CScene;
// *************************************************************************** // ***************************************************************************

View file

@ -33,7 +33,7 @@ namespace NL3D
class CShadowVertex class CShadowVertex
{ {
public: public:
CVector Vertex; NLMISC::CVector Vertex;
uint32 MatrixId; uint32 MatrixId;
void serial(NLMISC::IStream &f) void serial(NLMISC::IStream &f)
{ {
@ -82,7 +82,7 @@ public:
* if don't intersect, dist2D="nearest distance to the ray", and distZ=0 * if don't intersect, dist2D="nearest distance to the ray", and distZ=0
* \param computeDist2D if false and don't intersect, then return dist2D=FLT_MAX, and distZ=0 * \param computeDist2D if false and don't intersect, then return dist2D=FLT_MAX, and distZ=0
*/ */
bool getRayIntersection(const CMatrix &toRaySpace, class CSkeletonModel &skeleton, bool getRayIntersection(const NLMISC::CMatrix &toRaySpace, class CSkeletonModel &skeleton,
const std::vector<uint32> &matrixInfluences, float &dist2D, float &distZ, bool computeDist2D); const std::vector<uint32> &matrixInfluences, float &dist2D, float &distZ, bool computeDist2D);
private: private:

View file

@ -54,7 +54,7 @@ public:
virtual NLMISC::CQuat getOrientation() const = 0; virtual NLMISC::CQuat getOrientation() const = 0;
/// Set the GUI reference /// Set the GUI reference
virtual void setInterfaceMatrix(const NL3D::CMatrix &matrix) = 0; virtual void setInterfaceMatrix(const NLMISC::CMatrix &matrix) = 0;
/// Get GUI center (1 = width, 1 = height, 0 = center) /// Get GUI center (1 = width, 1 = height, 0 = center)
virtual void getInterface2DShift(uint cid, float &x, float &y, float distance) const = 0; virtual void getInterface2DShift(uint cid, float &x, float &y, float distance) const = 0;

View file

@ -49,11 +49,11 @@ public:
/// \name Target and Direction specific /// \name Target and Direction specific
// @{ // @{
/// For TargetMode, the world Position of the target. /// For TargetMode, the world Position of the target.
CVector WorldTarget; NLMISC::CVector WorldTarget;
/// For TargetMode only, the Pos of eyes relative to the bone controlled. Default to (0,0,0) /// For TargetMode only, the Pos of eyes relative to the bone controlled. Default to (0,0,0)
CVector EyePos; NLMISC::CVector EyePos;
/// For DirectionMode, the WorldRotation to apply to the bone. NB: modified in execute() if TargetMode /// For DirectionMode, the WorldRotation to apply to the bone. NB: modified in execute() if TargetMode
CQuat CurrentWorldDirection; NLMISC::CQuat CurrentWorldDirection;
// @} // @}
/// \name Common /// \name Common
@ -63,7 +63,7 @@ public:
*/ */
bool Enabled; bool Enabled;
/// This give The World Orientation when the Mesh is in bind Pos (default to "LookBack"). /// This give The World Orientation when the Mesh is in bind Pos (default to "LookBack").
CQuat DefaultWorldDirection; NLMISC::CQuat DefaultWorldDirection;
/// The Maximum angle of rotation that can be performed between the Default Direction and Current Direction. Default to Pi/3 /// The Maximum angle of rotation that can be performed between the Default Direction and Current Direction. Default to Pi/3
float MaxAngle; float MaxAngle;
/// The Maximum Angular Velocity the ctrl can perform. Default to 2*Pi per second. /// The Maximum Angular Velocity the ctrl can perform. Default to 2*Pi per second.
@ -83,13 +83,13 @@ public:
private: private:
/// The last rotation computed (in LocalSkeleton Space). Used to smooth transition /// The last rotation computed (in LocalSkeleton Space). Used to smooth transition
CQuat _LastLSRotation; NLMISC::CQuat _LastLSRotation;
/// This tells that a Enable/Disable transition is in progress. /// This tells that a Enable/Disable transition is in progress.
bool _LastEnabled; bool _LastEnabled;
bool _EnableToDisableTransition; bool _EnableToDisableTransition;
CQuat getCurrentLSRotationFromBone(CSkeletonModel *model, CBone *bone); NLMISC::CQuat getCurrentLSRotationFromBone(CSkeletonModel *model, CBone *bone);
}; };

View file

@ -54,16 +54,16 @@ public:
bool isSharingEnabled() const { return !_DisableSharing; } bool isSharingEnabled() const { return !_DisableSharing; }
// set the ambiant/ diffuse color to be added to the embossed texture // set the ambiant/ diffuse color to be added to the embossed texture
void setAmbient(CRGBA ambient) { _Ambient = ambient; touch(); } void setAmbient(NLMISC::CRGBA ambient) { _Ambient = ambient; touch(); }
void setDiffuse(CRGBA diffuse) { _Diffuse = diffuse; touch(); } void setDiffuse(NLMISC::CRGBA diffuse) { _Diffuse = diffuse; touch(); }
// Set the direction of light (usually should be normalized). The bitmap is in the x,y plane // Set the direction of light (usually should be normalized). The bitmap is in the x,y plane
void setLightDir(const NLMISC::CVector &lightDir) { _LightDir = lightDir; touch(); } void setLightDir(const NLMISC::CVector &lightDir) { _LightDir = lightDir; touch(); }
// set a factor for the slope // set a factor for the slope
void setSlopeFactor(float factor) { _SlopeFactor = factor; touch(); } void setSlopeFactor(float factor) { _SlopeFactor = factor; touch(); }
// //
CRGBA getAmbient() const { return _Ambient; } NLMISC::CRGBA getAmbient() const { return _Ambient; }
CRGBA getDiffuse() const { return _Diffuse; } NLMISC::CRGBA getDiffuse() const { return _Diffuse; }
const CVector &getLightDir() const { return _LightDir; } const NLMISC::CVector &getLightDir() const { return _LightDir; }
float getSlopeFactor() const { return _SlopeFactor; } float getSlopeFactor() const { return _SlopeFactor; }
@ -75,8 +75,8 @@ protected:
// inherited from ITexture. Generate this bumpmap pixels // inherited from ITexture. Generate this bumpmap pixels
virtual void doGenerate(bool async = false); virtual void doGenerate(bool async = false);
NLMISC::CSmartPtr<ITexture> _HeightMap; NLMISC::CSmartPtr<ITexture> _HeightMap;
CRGBA _Ambient; NLMISC::CRGBA _Ambient;
CRGBA _Diffuse; NLMISC::CRGBA _Diffuse;
NLMISC::CVector _LightDir; NLMISC::CVector _LightDir;
bool _DisableSharing; bool _DisableSharing;
float _SlopeFactor; float _SlopeFactor;

View file

@ -140,7 +140,7 @@ public:
private: private:
void clearTile (CTile::TBitmap type); void clearTile (CTile::TBitmap type);
void free () void freeBlock ()
{ {
nlassert ((_Flags&=NL3D_CTILE_FREE_FLAG)==0); nlassert ((_Flags&=NL3D_CTILE_FREE_FLAG)==0);
_Flags|=NL3D_CTILE_FREE_FLAG; _Flags|=NL3D_CTILE_FREE_FLAG;

View file

@ -32,6 +32,7 @@ using NLMISC::CQuat;
class ILogicInfo; class ILogicInfo;
class CCluster; class CCluster;
class ITransformable;
// *************************************************************************** // ***************************************************************************
/** /**

View file

@ -48,7 +48,7 @@ public:
/// PointLights. Used at CVegetableManager::updateLighting() to get current colors of pointLights. /// PointLights. Used at CVegetableManager::updateLighting() to get current colors of pointLights.
CPointLightNamed *PointLight[MaxNumLight]; CPointLightNamed *PointLight[MaxNumLight];
/// Direction of the light. the direction to the instance should be precomputed. /// Direction of the light. the direction to the instance should be precomputed.
CVector Direction[MaxNumLight]; NLMISC::CVector Direction[MaxNumLight];
/// Factor to be multiplied by color of the light. Actually it is the attenuation factor. /// Factor to be multiplied by color of the light. Actually it is the attenuation factor.
uint PointLightFactor[MaxNumLight]; uint PointLightFactor[MaxNumLight];

View file

@ -69,7 +69,7 @@ public:
bool allocate(uint numVertices, uint &indexStart); bool allocate(uint numVertices, uint &indexStart);
/// free a subset of the VB. nlstop if subset not found... /// free a subset of the VB. nlstop if subset not found...
void free(uint indexStart); void freeBlock(uint indexStart);
// @} // @}

View file

@ -21,6 +21,7 @@
// //
#include "nel/3d/texture_cube.h" #include "nel/3d/texture_cube.h"
#include "nel/3d/texture_blank.h" #include "nel/3d/texture_blank.h"
#include "nel/3d/animation_time.h"
namespace NL3D namespace NL3D

View file

@ -502,7 +502,7 @@ namespace NLGUI
const CEventDescriptorKey& getLastKeyEvent() const{ return lastKeyEvent; } const CEventDescriptorKey& getLastKeyEvent() const{ return lastKeyEvent; }
IParser* getParser() const{ return parser; } IParser* getParser() const{ return _Parser; }
/// Retrieves the Id of the currently selected widgets /// Retrieves the Id of the currently selected widgets
void getEditorSelection( std::vector< std::string > &selection ); void getEditorSelection( std::vector< std::string > &selection );
@ -536,7 +536,7 @@ namespace NLGUI
CWidgetManager(); CWidgetManager();
~CWidgetManager(); ~CWidgetManager();
IParser *parser; IParser *_Parser;
static CWidgetManager *instance; static CWidgetManager *instance;
std::vector< SMasterGroup > _MasterGroups; std::vector< SMasterGroup > _MasterGroups;

View file

@ -112,7 +112,8 @@ public:
// A BNP structure // A BNP structure
struct BNP struct BNP
{ {
BNP() : FileNames(NULL), ThreadFileId(0), CacheFileOnOpen(false), AlwaysOpened(false), InternalUse(false), OffsetFromBeginning(0) { } BNP();
~BNP();
// FileName of the BNP. important to open it in getFile() (for other threads or if not always opened). // FileName of the BNP. important to open it in getFile() (for other threads or if not always opened).
std::string BigFileName; std::string BigFileName;
@ -163,6 +164,7 @@ private:
{ {
public: public:
CThreadFileArray(); CThreadFileArray();
~CThreadFileArray();
// Allocate a FileId for a BNP. // Allocate a FileId for a BNP.
uint32 allocate(); uint32 allocate();

View file

@ -132,7 +132,7 @@ public:
} }
/// delete an element allocated with this manager. dtor is called. NULL is tested. /// delete an element allocated with this manager. dtor is called. NULL is tested.
void free(T* ptr) void freeBlock(T* ptr)
{ {
if(!ptr) if(!ptr)
return; return;

View file

@ -690,10 +690,10 @@ inline int nlisprint(int c)
#endif #endif
// Open an url in a browser // Open an url in a browser
bool openURL (const char *url); bool openURL (const std::string &url);
// Open a document // Open a document
bool openDoc (const char *document); bool openDoc (const std::string &document);
// AntiBug method that return an epsilon if x==0, else x // AntiBug method that return an epsilon if x==0, else x
inline float favoid0(float x) inline float favoid0(float x)

View file

@ -55,7 +55,7 @@ public:
// allocated a block of n bytes // allocated a block of n bytes
void *alloc(uint numBytes); void *alloc(uint numBytes);
// deallocate a block // deallocate a block
void free(void *block, uint numBytes); void freeBlock(void *block, uint numBytes);
// compute the total number of bytes allocated since init // compute the total number of bytes allocated since init
// NB : freed block are not subtracted from that total !! // NB : freed block are not subtracted from that total !!
uint getNumAllocatedBytes() const { return _NumAllocatedBytes; } uint getNumAllocatedBytes() const { return _NumAllocatedBytes; }

View file

@ -45,7 +45,7 @@ public:
/// alloc a block /// alloc a block
void *alloc(); void *alloc();
/// destroy and dealloc a block /// destroy and dealloc a block
void free(void *block); void freeBlock(void *block);
// //
uint getNumBytesPerBlock() const { return _NumBytesPerBlock; } uint getNumBytesPerBlock() const { return _NumBytesPerBlock; }
uint getNumBlockPerChunk() const { return _NumBlockPerChunk; } uint getNumBlockPerChunk() const { return _NumBlockPerChunk; }

View file

@ -65,7 +65,7 @@ public:
*/ */
void *allocate(uint size); void *allocate(uint size);
/// free a block allocated with alloate(). no-op if NULL. nlstop() if don't find this block. /// free a block allocated with alloate(). no-op if NULL. nlstop() if don't find this block.
void free(void *ptr); void freeBlock(void *ptr);
// ********************* // *********************

View file

@ -49,7 +49,7 @@ public:
*/ */
void *alloc(uint size); void *alloc(uint size);
// free an object that has previously been allocated with alloc. size should be remembered by the caller. // free an object that has previously been allocated with alloc. size should be remembered by the caller.
void free(void *); void freeBlock(void *);
// get the number of allocated objects // get the number of allocated objects
uint getNumAllocatedBlocks() const; uint getNumAllocatedBlocks() const;
# ifdef NL_DEBUG # ifdef NL_DEBUG
@ -82,7 +82,9 @@ private:
// NL_USES_DEFAULT_ARENA_OBJECT_ALLOCATOR // for fast alloc // NL_USES_DEFAULT_ARENA_OBJECT_ALLOCATOR // for fast alloc
# define NL_USES_DEFAULT_ARENA_OBJECT_ALLOCATOR \ # define NL_USES_DEFAULT_ARENA_OBJECT_ALLOCATOR \
void *operator new(size_t size) { return NLMISC::CObjectArenaAllocator::getDefaultAllocator().alloc((uint) size); }\ void *operator new(size_t size) { return NLMISC::CObjectArenaAllocator::getDefaultAllocator().alloc((uint) size); }\
void operator delete(void *block) { NLMISC::CObjectArenaAllocator::getDefaultAllocator().free(block); } void *operator new(size_t size, int _BlockUse, char const* _FileName, int _LineNumber) { return NLMISC::CObjectArenaAllocator::getDefaultAllocator().alloc((uint) size); }\
void operator delete(void *block) { NLMISC::CObjectArenaAllocator::getDefaultAllocator().freeBlock(block); }\
void operator delete(void *block, int _BlockUse, char const* _FileName, int _LineNumber) { NLMISC::CObjectArenaAllocator::getDefaultAllocator().freeBlock(block); }
} }

View file

@ -90,7 +90,7 @@ public:
/* /*
* Free all the elements allocated since last free(). Memory is kept for next allocations. * Free all the elements allocated since last free(). Memory is kept for next allocations.
*/ */
void free () void freeBlock ()
{ {
typename std::list< std::vector<T> >::iterator ite=_BlockList.begin(); typename std::list< std::vector<T> >::iterator ite=_BlockList.begin();
while (ite!=_BlockList.end()) while (ite!=_BlockList.end())

View file

@ -28,8 +28,8 @@ namespace NLMISC
{ {
// get a string and add \r before \n if necessary // get a string and add \r before \n if necessary
std::string addSlashR (std::string str); std::string addSlashR (const std::string &str);
std::string removeSlashR (std::string str); std::string removeSlashR (const std::string &str);
/** /**
* \def MaxCStringSize * \def MaxCStringSize

View file

@ -386,17 +386,17 @@ typedef unsigned int uint; // at least 32bits (depend of processor)
#include <stdlib.h> #include <stdlib.h>
#include <intrin.h> #include <intrin.h>
#include <malloc.h> #include <malloc.h>
inline void *aligned_malloc(size_t size, size_t alignment) { return _aligned_malloc(size, alignment); } #define aligned_malloc(size, alignment) _aligned_malloc(size, alignment)
inline void aligned_free(void *ptr) { _aligned_free(ptr); } #define aligned_free(ptr) _aligned_free(ptr)
#elif defined(NL_OS_MAC) #elif defined(NL_OS_MAC)
#include <stdlib.h> #include <stdlib.h>
// under Mac OS X, malloc is already aligned for SSE and Altivec (16 bytes alignment) // under Mac OS X, malloc is already aligned for SSE and Altivec (16 bytes alignment)
inline void *aligned_malloc(size_t size, size_t /* alignment */) { return malloc(size); } #define aligned_malloc(size, alignment) malloc(size)
inline void aligned_free(void *ptr) { free(ptr); } #define aligned_free(ptr) free(ptr)
#else #else
#include <malloc.h> #include <malloc.h>
inline void *aligned_malloc(size_t size, size_t alignment) { return memalign(alignment, size); } #define aligned_malloc(size, alignment) memalign(alignment, size)
inline void aligned_free(void *ptr) { free(ptr); } #define aligned_free(ptr) free(ptr)
#endif /* NL_COMP_ */ #endif /* NL_COMP_ */

View file

@ -1,15 +0,0 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// 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/>.

View file

@ -30,6 +30,9 @@
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NL3D namespace NL3D
{ {

View file

@ -29,6 +29,9 @@
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NL3D namespace NL3D
{ {

View file

@ -25,6 +25,10 @@
using namespace NLMISC; using namespace NLMISC;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NL3D namespace NL3D
{ {

View file

@ -19,6 +19,7 @@
#include "nel/3d/coarse_mesh_build.h" #include "nel/3d/coarse_mesh_build.h"
#include "nel/3d/mesh.h" #include "nel/3d/mesh.h"
#include "nel/3d/debug_vb.h"
using namespace NLMISC; using namespace NLMISC;

View file

@ -21,6 +21,8 @@
#include "nel/3d/texture_file.h" #include "nel/3d/texture_file.h"
#include "nel/misc/hierarchical_timer.h" #include "nel/misc/hierarchical_timer.h"
#include "nel/3d/clip_trav.h" #include "nel/3d/clip_trav.h"
#include "nel/3d/debug_vb.h"
#include "nel/misc/fast_mem.h" #include "nel/misc/fast_mem.h"

View file

@ -22,6 +22,7 @@
#include "nel/3d/material.h" #include "nel/3d/material.h"
#include "nel/3d/frustum.h" #include "nel/3d/frustum.h"
#include "nel/3d/viewport.h" #include "nel/3d/viewport.h"
#include "nel/3d/debug_vb.h"
#include "nel/misc/smart_ptr.h" #include "nel/misc/smart_ptr.h"
#include "nel/misc/debug.h" #include "nel/misc/debug.h"

View file

@ -14,15 +14,14 @@
// You should have received a copy of the GNU Affero General Public License // 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/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
// Default NeL includes #ifndef STDDIRECT3D_H
#include "nel/misc/types_nl.h" #define STDDIRECT3D_H
#ifdef NL_OS_WINDOWS #if defined(_MSC_VER) && defined(_DEBUG)
# define WIN32_LEAN_AND_MEAN #define _CRTDBG_MAP_ALLOC
# ifndef NL_COMP_MINGW #include <stdlib.h>
# define NOMINMAX #include <crtdbg.h>
# endif #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
# include <windows.h>
#endif #endif
// System includes // System includes
@ -42,16 +41,14 @@
#include <deque> #include <deque>
#include <limits> #include <limits>
// Default NeL includes
#include "nel/misc/types_nl.h"
#ifdef NL_DEBUG #ifdef NL_DEBUG
// add Direct3D debug infos // add Direct3D debug infos
#define D3D_DEBUG_INFO #define D3D_DEBUG_INFO
#endif #endif
// Directx includes
#include <d3d9.h>
#include <d3dx9math.h>
// NeL includes // NeL includes
#include "nel/misc/common.h" #include "nel/misc/common.h"
#include "nel/misc/debug.h" #include "nel/misc/debug.h"
@ -59,3 +56,17 @@
#include "nel/misc/mem_stream.h" #include "nel/misc/mem_stream.h"
#include "nel/misc/time_nl.h" #include "nel/misc/time_nl.h"
#include "nel/misc/command.h" #include "nel/misc/command.h"
#ifdef NL_OS_WINDOWS
# define WIN32_LEAN_AND_MEAN
# ifndef NL_COMP_MINGW
# define NOMINMAX
# endif
# include <windows.h>
#endif
// Directx includes
#include <d3d9.h>
#include <d3dx9math.h>
#endif

View file

@ -36,6 +36,9 @@
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif

View file

@ -61,6 +61,9 @@ void (*nglGetProcAddress(const char *procName))()
} }
#endif // NL_OS_WINDOWS #endif // NL_OS_WINDOWS
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
// *************************************************************************** // ***************************************************************************
// The exported function names // The exported function names

View file

@ -33,6 +33,10 @@
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NL3D { namespace NL3D {
#ifdef NL_STATIC #ifdef NL_STATIC

View file

@ -19,6 +19,10 @@
#include "driver_opengl.h" #include "driver_opengl.h"
#include "nel/3d/light.h" #include "nel/3d/light.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NL3D { namespace NL3D {
#ifdef NL_STATIC #ifdef NL_STATIC

View file

@ -21,6 +21,10 @@
#include "nel/3d/texture_bump.h" #include "nel/3d/texture_bump.h"
#include "nel/3d/material.h" #include "nel/3d/material.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NL3D { namespace NL3D {
#ifdef NL_STATIC #ifdef NL_STATIC

View file

@ -17,6 +17,10 @@
#include "stdopengl.h" #include "stdopengl.h"
#include "driver_opengl.h" #include "driver_opengl.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NL3D { namespace NL3D {
#ifdef NL_STATIC #ifdef NL_STATIC

View file

@ -38,6 +38,10 @@
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NL3D namespace NL3D
{ {

View file

@ -22,6 +22,10 @@
// define it For Debug purpose only. Normal use is to hide this line // define it For Debug purpose only. Normal use is to hide this line
//#define NL3D_GLSTATE_DISABLE_CACHE //#define NL3D_GLSTATE_DISABLE_CACHE
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NL3D { namespace NL3D {
#ifdef NL_STATIC #ifdef NL_STATIC

View file

@ -28,6 +28,9 @@
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
//#define NEL_DUMP_UPLOAD_TIME //#define NEL_DUMP_UPLOAD_TIME

View file

@ -21,6 +21,10 @@
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NL3D { namespace NL3D {
#ifdef NL_STATIC #ifdef NL_STATIC

View file

@ -26,6 +26,9 @@
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
@ -1710,9 +1713,9 @@ void CDriverGL::resetVertexArrayRange()
// After, Clear the 2 vertexArrayRange, if any. // After, Clear the 2 vertexArrayRange, if any.
if(_AGPVertexArrayRange) if(_AGPVertexArrayRange)
_AGPVertexArrayRange->free(); _AGPVertexArrayRange->freeBlock();
if(_VRAMVertexArrayRange) if(_VRAMVertexArrayRange)
_VRAMVertexArrayRange->free(); _VRAMVertexArrayRange->freeBlock();
} }

View file

@ -24,6 +24,10 @@
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NL3D { namespace NL3D {
#ifdef NL_STATIC #ifdef NL_STATIC
@ -163,7 +167,7 @@ uint CVertexArrayRangeNVidia::sizeAllocated() const
// *************************************************************************** // ***************************************************************************
void CVertexArrayRangeNVidia::free() void CVertexArrayRangeNVidia::freeBlock()
{ {
H_AUTO_OGL(CVertexArrayRangeNVidia_free) H_AUTO_OGL(CVertexArrayRangeNVidia_free)
// release the ptr. // release the ptr.
@ -240,7 +244,7 @@ void *CVertexArrayRangeNVidia::allocateVB(uint32 size)
void CVertexArrayRangeNVidia::freeVB(void *ptr) void CVertexArrayRangeNVidia::freeVB(void *ptr)
{ {
H_AUTO_OGL(CVertexArrayRangeNVidia_freeVB) H_AUTO_OGL(CVertexArrayRangeNVidia_freeVB)
_HeapMemory.free(ptr); _HeapMemory.freeBlock(ptr);
} }
@ -541,7 +545,7 @@ uint CVertexArrayRangeATI::sizeAllocated() const
return _VertexArraySize; return _VertexArraySize;
} }
// *************************************************************************** // ***************************************************************************
void CVertexArrayRangeATI::free() void CVertexArrayRangeATI::freeBlock()
{ {
H_AUTO_OGL(CVertexArrayRangeATI_free) H_AUTO_OGL(CVertexArrayRangeATI_free)
// release the ptr. // release the ptr.
@ -619,7 +623,7 @@ void *CVertexArrayRangeATI::allocateVB(uint32 size)
void CVertexArrayRangeATI::freeVB(void *ptr) void CVertexArrayRangeATI::freeVB(void *ptr)
{ {
H_AUTO_OGL(CVertexArrayRangeATI_freeVB) H_AUTO_OGL(CVertexArrayRangeATI_freeVB)
_HeapMemory.free(ptr); _HeapMemory.freeBlock(ptr);
} }
@ -849,7 +853,7 @@ bool CVertexArrayRangeMapObjectATI::allocate(uint32 size, CVertexBuffer::TPrefer
} }
// *************************************************************************** // ***************************************************************************
void CVertexArrayRangeMapObjectATI::free() void CVertexArrayRangeMapObjectATI::freeBlock()
{ {
H_AUTO_OGL(CVertexArrayRangeMapObjectATI_free) H_AUTO_OGL(CVertexArrayRangeMapObjectATI_free)
_SizeAllocated = 0; _SizeAllocated = 0;
@ -1201,7 +1205,7 @@ bool CVertexArrayRangeARB::allocate(uint32 size, CVertexBuffer::TPreferredMemory
} }
// *************************************************************************** // ***************************************************************************
void CVertexArrayRangeARB::free() void CVertexArrayRangeARB::freeBlock()
{ {
H_AUTO_OGL(CVertexArrayRangeARB_free) H_AUTO_OGL(CVertexArrayRangeARB_free)
_SizeAllocated = 0; _SizeAllocated = 0;

View file

@ -57,7 +57,7 @@ public:
/// allocate a vertex array space. false if error. client must free before re-allocate. /// allocate a vertex array space. false if error. client must free before re-allocate.
virtual bool allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType)= 0; virtual bool allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType)= 0;
/// free this space. /// free this space.
virtual void free()= 0; virtual void freeBlock()= 0;
/// create a IVertexBufferHardGL /// create a IVertexBufferHardGL
virtual IVertexBufferHardGL *createVBHardGL(uint size, CVertexBuffer *vb) =0; virtual IVertexBufferHardGL *createVBHardGL(uint size, CVertexBuffer *vb) =0;
/// return the size allocated. 0 if not allocated or failure /// return the size allocated. 0 if not allocated or failure
@ -141,7 +141,7 @@ public:
/// allocate a vertex array sapce. false if error. must free before re-allocate. /// allocate a vertex array sapce. false if error. must free before re-allocate.
virtual bool allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType); virtual bool allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType);
/// free this space. /// free this space.
virtual void free(); virtual void freeBlock();
/// create a IVertexBufferHardGL /// create a IVertexBufferHardGL
virtual IVertexBufferHardGL *createVBHardGL(uint size, CVertexBuffer *vb); virtual IVertexBufferHardGL *createVBHardGL(uint size, CVertexBuffer *vb);
/// return the size allocated. 0 if not allocated or failure /// return the size allocated. 0 if not allocated or failure
@ -258,7 +258,7 @@ public:
/// allocate a vertex array sapce. false if error. must free before re-allocate. /// allocate a vertex array sapce. false if error. must free before re-allocate.
virtual bool allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType); virtual bool allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType);
/// free this space. /// free this space.
virtual void free(); virtual void freeBlock();
/// create a IVertexBufferHardGL /// create a IVertexBufferHardGL
virtual IVertexBufferHardGL *createVBHardGL(uint size, CVertexBuffer *vb); virtual IVertexBufferHardGL *createVBHardGL(uint size, CVertexBuffer *vb);
/// return the size allocated. 0 if not allocated or failure /// return the size allocated. 0 if not allocated or failure
@ -367,7 +367,7 @@ public:
*/ */
virtual bool allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType); virtual bool allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType);
/// free this space. /// free this space.
virtual void free(); virtual void freeBlock();
/// create a IVertexBufferHardGL /// create a IVertexBufferHardGL
virtual IVertexBufferHardGL *createVBHardGL(uint size, CVertexBuffer *vb); virtual IVertexBufferHardGL *createVBHardGL(uint size, CVertexBuffer *vb);
/// return the size allocated. 0 if not allocated or failure /// return the size allocated. 0 if not allocated or failure
@ -480,7 +480,7 @@ public:
*/ */
virtual bool allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType); virtual bool allocate(uint32 size, CVertexBuffer::TPreferredMemory vbType);
/// free this space. /// free this space.
virtual void free(); virtual void freeBlock();
/// create a IVertexBufferHardGL /// create a IVertexBufferHardGL
virtual IVertexBufferHardGL *createVBHardGL(uint size, CVertexBuffer *vb); virtual IVertexBufferHardGL *createVBHardGL(uint size, CVertexBuffer *vb);
/// return the size allocated. 0 if not allocated or failure /// return the size allocated. 0 if not allocated or failure

View file

@ -28,6 +28,10 @@
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
//#define DEBUG_SETUP_EXT_VERTEX_SHADER //#define DEBUG_SETUP_EXT_VERTEX_SHADER
namespace NL3D { namespace NL3D {

View file

@ -44,6 +44,10 @@
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NL3D { namespace NL3D {
#ifdef NL_STATIC #ifdef NL_STATIC

View file

@ -17,7 +17,12 @@
#ifndef STDOPENGL_H #ifndef STDOPENGL_H
#define STDOPENGL_H #define STDOPENGL_H
#include "nel/misc/types_nl.h" #if defined(_MSC_VER) && defined(_DEBUG)
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
#endif
#include <cstdlib> #include <cstdlib>
#include <cstdio> #include <cstdio>
@ -35,6 +40,8 @@
#include <deque> #include <deque>
#include <limits> #include <limits>
#include "nel/misc/types_nl.h"
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
# define WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN
# ifndef NL_COMP_MINGW # ifndef NL_COMP_MINGW

View file

@ -26,6 +26,9 @@
#include <X11/XKBlib.h> #include <X11/XKBlib.h>
#include "nel/misc/debug.h" #include "nel/misc/debug.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
typedef bool (*x11Proc)(NL3D::IDriver *drv, XEvent *e); typedef bool (*x11Proc)(NL3D::IDriver *drv, XEvent *e);

View file

@ -33,6 +33,8 @@
#include "nel/3d/water_env_map_user.h" #include "nel/3d/water_env_map_user.h"
#include "nel/3d/water_pool_manager.h" #include "nel/3d/water_pool_manager.h"
#include "nel/3d/u_camera.h" #include "nel/3d/u_camera.h"
#include "nel/3d/debug_vb.h"
#include "nel/misc/hierarchical_timer.h" #include "nel/misc/hierarchical_timer.h"
#include "nel/misc/event_emitter.h" #include "nel/misc/event_emitter.h"

View file

@ -26,8 +26,9 @@
#include "nel/3d/occlusion_query.h" #include "nel/3d/occlusion_query.h"
#include "nel/3d/mesh.h" #include "nel/3d/mesh.h"
#include "nel/3d/viewport.h" #include "nel/3d/viewport.h"
#include "nel/misc/common.h" #include "nel/3d/debug_vb.h"
#include "nel/misc/common.h"
namespace NL3D { namespace NL3D {

View file

@ -26,7 +26,6 @@
*/ */
#include "std3d.h" #include "std3d.h"
#include "nel/misc/types_nl.h"
#include "nel/3d/gpu_program_params.h" #include "nel/3d/gpu_program_params.h"
// STL includes // STL includes
@ -44,14 +43,14 @@ using namespace std;
namespace NL3D { namespace NL3D {
const size_t CGPUProgramParams::s_End = -1;
CGPUProgramParams::CGPUProgramParams() : m_First(s_End), m_Last(s_End) CGPUProgramParams::CGPUProgramParams() : m_First(s_End), m_Last(s_End)
{ {
} }
CGPUProgramParams::~CGPUProgramParams() CGPUProgramParams::~CGPUProgramParams()
{ {
} }
void CGPUProgramParams::copy(CGPUProgramParams *params) void CGPUProgramParams::copy(CGPUProgramParams *params)

View file

@ -3216,37 +3216,37 @@ void CLandscape::deleteTessFace(CTessFace *f)
// for refine() mgt, must remove from refine priority list, or from the temp rootTessFaceToUpdate list. // for refine() mgt, must remove from refine priority list, or from the temp rootTessFaceToUpdate list.
f->unlinkInPList(); f->unlinkInPList();
TessFaceAllocator.free(f); TessFaceAllocator.freeBlock(f);
} }
// *************************************************************************** // ***************************************************************************
void CLandscape::deleteTessVertex(CTessVertex *v) void CLandscape::deleteTessVertex(CTessVertex *v)
{ {
TessVertexAllocator.free(v); TessVertexAllocator.freeBlock(v);
} }
// *************************************************************************** // ***************************************************************************
void CLandscape::deleteTessNearVertex(CTessNearVertex *v) void CLandscape::deleteTessNearVertex(CTessNearVertex *v)
{ {
TessNearVertexAllocator.free(v); TessNearVertexAllocator.freeBlock(v);
} }
// *************************************************************************** // ***************************************************************************
void CLandscape::deleteTessFarVertex(CTessFarVertex *v) void CLandscape::deleteTessFarVertex(CTessFarVertex *v)
{ {
TessFarVertexAllocator.free(v); TessFarVertexAllocator.freeBlock(v);
} }
// *************************************************************************** // ***************************************************************************
void CLandscape::deleteTileMaterial(CTileMaterial *tm) void CLandscape::deleteTileMaterial(CTileMaterial *tm)
{ {
TileMaterialAllocator.free(tm); TileMaterialAllocator.freeBlock(tm);
} }
// *************************************************************************** // ***************************************************************************
void CLandscape::deleteTileFace(CTileFace *tf) void CLandscape::deleteTileFace(CTileFace *tf)
{ {
TileFaceAllocator.free(tf); TileFaceAllocator.freeBlock(tf);
} }

View file

@ -24,8 +24,11 @@
#include "nel/3d/landscape.h" #include "nel/3d/landscape.h"
#include "nel/3d/landscape_profile.h" #include "nel/3d/landscape_profile.h"
#include "nel/3d/patchdlm_context.h" #include "nel/3d/patchdlm_context.h"
#include "nel/3d/debug_vb.h"
#include "nel/misc/vector.h" #include "nel/misc/vector.h"
#include "nel/misc/common.h" #include "nel/misc/common.h"
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -19,8 +19,9 @@
#include "nel/3d/play_list_user.h" #include "nel/3d/play_list_user.h"
#include "nel/3d/animation_set_user.h" #include "nel/3d/animation_set_user.h"
#include "nel/3d/u_transform.h" #include "nel/3d/u_transform.h"
#include "nel/misc/hierarchical_timer.h" #include "nel/3d/transform.h"
#include "nel/misc/hierarchical_timer.h"
#include "nel/misc/debug.h" #include "nel/misc/debug.h"
using namespace NLMISC; using namespace NLMISC;

View file

@ -21,6 +21,8 @@
#include "nel/3d/ps_iterator.h" #include "nel/3d/ps_iterator.h"
#include "nel/3d/driver.h" #include "nel/3d/driver.h"
#include "nel/3d/particle_system.h" #include "nel/3d/particle_system.h"
#include "nel/3d/debug_vb.h"
#include "nel/misc/fast_mem.h" #include "nel/misc/fast_mem.h"
namespace NL3D namespace NL3D

View file

@ -21,8 +21,9 @@
#include "nel/3d/driver.h" #include "nel/3d/driver.h"
#include "nel/3d/ps_iterator.h" #include "nel/3d/ps_iterator.h"
#include "nel/3d/particle_system.h" #include "nel/3d/particle_system.h"
#include "nel/misc/quat.h" #include "nel/3d/debug_vb.h"
#include "nel/misc/quat.h"
namespace NL3D namespace NL3D

View file

@ -21,6 +21,8 @@
#include "nel/3d/driver.h" #include "nel/3d/driver.h"
#include "nel/3d/ps_iterator.h" #include "nel/3d/ps_iterator.h"
#include "nel/3d/particle_system.h" #include "nel/3d/particle_system.h"
#include "nel/3d/debug_vb.h"
#include "nel/misc/fast_floor.h" #include "nel/misc/fast_floor.h"

View file

@ -22,6 +22,7 @@
#include "nel/3d/ps_iterator.h" #include "nel/3d/ps_iterator.h"
#include "nel/3d/particle_system.h" #include "nel/3d/particle_system.h"
#include "nel/3d/driver.h" #include "nel/3d/driver.h"
#include "nel/3d/debug_vb.h"

View file

@ -29,12 +29,11 @@
#include "nel/3d/particle_system_shape.h" #include "nel/3d/particle_system_shape.h"
#include "nel/3d/particle_system_model.h" #include "nel/3d/particle_system_model.h"
#include "nel/3d/ps_iterator.h" #include "nel/3d/ps_iterator.h"
#include "nel/3d/debug_vb.h"
#include "nel/misc/stream.h" #include "nel/misc/stream.h"
#include "nel/misc/path.h" #include "nel/misc/path.h"
namespace NL3D namespace NL3D
{ {

View file

@ -20,6 +20,8 @@
#include "nel/3d/ps_ribbon_base.h" #include "nel/3d/ps_ribbon_base.h"
#include "nel/3d/particle_system.h" #include "nel/3d/particle_system.h"
using namespace NLMISC;
namespace NL3D namespace NL3D
{ {

View file

@ -20,6 +20,7 @@
#include "nel/3d/particle_system.h" #include "nel/3d/particle_system.h"
#include "nel/3d/ps_macro.h" #include "nel/3d/ps_macro.h"
#include "nel/3d/driver.h" #include "nel/3d/driver.h"
#include "nel/3d/debug_vb.h"
namespace NL3D namespace NL3D
{ {

View file

@ -22,6 +22,7 @@
#include "nel/3d/texture_grouped.h" #include "nel/3d/texture_grouped.h"
#include "nel/3d/ps_iterator.h" #include "nel/3d/ps_iterator.h"
#include "nel/3d/particle_system.h" #include "nel/3d/particle_system.h"
#include "nel/3d/debug_vb.h"
namespace NL3D namespace NL3D

View file

@ -21,6 +21,8 @@
#include "nel/3d/u_ps_sound_interface.h" #include "nel/3d/u_ps_sound_interface.h"
#include "nel/3d/ps_attrib_maker.h" #include "nel/3d/ps_attrib_maker.h"
using namespace NLMISC;
namespace NL3D namespace NL3D
{ {

View file

@ -25,6 +25,9 @@
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NL3D namespace NL3D
{ {

View file

@ -28,6 +28,9 @@
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NL3D namespace NL3D
{ {

View file

@ -19,6 +19,8 @@
#include "nel/3d/ray_mesh.h" #include "nel/3d/ray_mesh.h"
#include "nel/misc/vector_2f.h" #include "nel/misc/vector_2f.h"
#include "nel/misc/fast_mem.h" #include "nel/misc/fast_mem.h"
#include "nel/misc/plane.h"
#include "nel/3d/matrix_3x4.h" #include "nel/3d/matrix_3x4.h"
using namespace NLMISC; using namespace NLMISC;

View file

@ -14,7 +14,15 @@
// You should have received a copy of the GNU Affero General Public License // 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/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "nel/misc/types_nl.h" #ifndef NL_STD3D_H
#define NL_STD3D_H
#if defined(_MSC_VER) && defined(_DEBUG)
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
#endif
#include <map> #include <map>
#include <set> #include <set>
@ -36,6 +44,8 @@
#include <limits> #include <limits>
#include <iterator> #include <iterator>
#include "nel/misc/types_nl.h"
#include "nel/misc/rgba.h" #include "nel/misc/rgba.h"
#include "nel/misc/debug.h" #include "nel/misc/debug.h"
@ -45,7 +55,4 @@
#include "nel/misc/matrix.h" #include "nel/misc/matrix.h"
#include "nel/misc/time_nl.h" #include "nel/misc/time_nl.h"
#include "nel/3d/debug_vb.h" #endif
#include "nel/3d/transform.h"
#include "nel/3d/quad_grid.h"

View file

@ -24,6 +24,10 @@
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NL3D { namespace NL3D {

View file

@ -17,6 +17,8 @@
#include "std3d.h" #include "std3d.h"
#include "nel/3d/texture_emboss.h" #include "nel/3d/texture_emboss.h"
using namespace NLMISC;
namespace NL3D { namespace NL3D {
// *********************************************************************************************************** // ***********************************************************************************************************

View file

@ -243,7 +243,7 @@ void CTileBank::freeTile (int tileIndex)
nlassert (tileIndex<(sint)_TileVector.size()); nlassert (tileIndex<(sint)_TileVector.size());
// Free // Free
_TileVector[tileIndex].free(); _TileVector[tileIndex].freeBlock();
// Resize tile table // Resize tile table
int i; int i;

View file

@ -24,6 +24,9 @@
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NL3D namespace NL3D
{ {

View file

@ -35,6 +35,9 @@
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NL3D namespace NL3D
{ {
@ -747,7 +750,7 @@ void CVegetableManager::deleteClipBlock(CVegetableClipBlock *clipBlock)
_EmptyClipBlockList.remove(clipBlock); _EmptyClipBlockList.remove(clipBlock);
// delete // delete
_ClipBlockMemory.free(clipBlock); _ClipBlockMemory.freeBlock(clipBlock);
} }
@ -782,7 +785,7 @@ void CVegetableManager::deleteSortBlock(CVegetableSortBlock *sortBlock)
sortBlock->_Owner->_SortBlockList.remove(sortBlock); sortBlock->_Owner->_SortBlockList.remove(sortBlock);
// delete // delete
_SortBlockMemory.free(sortBlock); _SortBlockMemory.freeBlock(sortBlock);
} }
@ -878,7 +881,7 @@ void CVegetableManager::deleteIg(CVegetableInstanceGroup *ig)
// unlink from sortBlock, and delete. // unlink from sortBlock, and delete.
sortBlock->_InstanceGroupList.remove(ig); sortBlock->_InstanceGroupList.remove(ig);
_InstanceGroupMemory.free(ig); _InstanceGroupMemory.freeBlock(ig);
// decRef the clipBlock // decRef the clipBlock

View file

@ -19,6 +19,7 @@
#include "nel/3d/vegetablevb_allocator.h" #include "nel/3d/vegetablevb_allocator.h"
#include "nel/3d/vegetable_def.h" #include "nel/3d/vegetable_def.h"
#include "nel/3d/debug_vb.h"
using namespace std; using namespace std;

View file

@ -98,7 +98,7 @@ CVisualTileDescNode *CVisualCollisionManager::newVisualTileDescNode()
// *************************************************************************** // ***************************************************************************
void CVisualCollisionManager::deleteVisualTileDescNode(CVisualTileDescNode *ptr) void CVisualCollisionManager::deleteVisualTileDescNode(CVisualTileDescNode *ptr)
{ {
_TileDescNodeAllocator.free(ptr); _TileDescNodeAllocator.freeBlock(ptr);
} }
// *************************************************************************** // ***************************************************************************
@ -110,7 +110,7 @@ CPatchQuadBlock *CVisualCollisionManager::newPatchQuadBlock()
// *************************************************************************** // ***************************************************************************
void CVisualCollisionManager::deletePatchQuadBlock(CPatchQuadBlock *ptr) void CVisualCollisionManager::deletePatchQuadBlock(CPatchQuadBlock *ptr)
{ {
_PatchQuadBlockAllocator.free(ptr); _PatchQuadBlockAllocator.freeBlock(ptr);
} }

View file

@ -24,6 +24,10 @@
#include "nel/misc/common.h" #include "nel/misc/common.h"
#include "nel/3d/viewport.h" #include "nel/3d/viewport.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NL3D namespace NL3D
{ {

View file

@ -23,6 +23,9 @@
#include "nel/3d/water_height_map.h" #include "nel/3d/water_height_map.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NL3D { namespace NL3D {

View file

@ -27,6 +27,10 @@
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLGUI namespace NLGUI
{ {

View file

@ -27,6 +27,10 @@
using namespace NLMISC; using namespace NLMISC;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLGUI namespace NLGUI
{ {
std::map< std::string, std::map< std::string, std::string > > CCtrlBase::AHCache; std::map< std::string, std::map< std::string, std::string > > CCtrlBase::AHCache;

View file

@ -27,6 +27,10 @@
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace namespace
{ {
const uint KEY_REPEAT_MIN = 100; const uint KEY_REPEAT_MIN = 100;

View file

@ -26,6 +26,10 @@ using namespace std;
using namespace NLMISC; using namespace NLMISC;
using namespace NL3D; using namespace NL3D;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
NLMISC_REGISTER_OBJECT(CViewBase, CCtrlButton, std::string, "button"); NLMISC_REGISTER_OBJECT(CViewBase, CCtrlButton, std::string, "button");
namespace NLGUI namespace NLGUI

View file

@ -27,6 +27,10 @@
using namespace NLMISC; using namespace NLMISC;
using namespace std; using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
NLMISC_REGISTER_OBJECT(CViewBase, CCtrlColPick, std::string, "colpick"); NLMISC_REGISTER_OBJECT(CViewBase, CCtrlColPick, std::string, "colpick");
namespace NLGUI namespace NLGUI

View file

@ -18,6 +18,10 @@
#include "stdpch.h" #include "stdpch.h"
#include "nel/gui/ctrl_draggable.h" #include "nel/gui/ctrl_draggable.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLGUI namespace NLGUI
{ {

View file

@ -23,6 +23,10 @@
using namespace NLMISC; using namespace NLMISC;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLGUI namespace NLGUI
{ {

Some files were not shown because too many files have changed in this diff Show more