mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-04 09:14:49 +00:00
Changed: #878 Fix typos in comments/code
This commit is contained in:
parent
cb86d0ff0e
commit
f0236fc165
11 changed files with 57 additions and 129 deletions
|
@ -57,7 +57,7 @@ void CAsyncTextureManager::CTextureEntry::createCoarseBitmap()
|
||||||
CoarseBitmap= *Texture;
|
CoarseBitmap= *Texture;
|
||||||
// remove all mipmaps, and convert to DXTC1 (if possible, ie if was DXTC5 or DXTC3 as example)
|
// remove all mipmaps, and convert to DXTC1 (if possible, ie if was DXTC5 or DXTC3 as example)
|
||||||
CoarseBitmap.releaseMipMaps();
|
CoarseBitmap.releaseMipMaps();
|
||||||
// TODODO: consersion to DXTC1
|
// TODODO: conversion to DXTC1
|
||||||
CoarseBitmap.convertToType(CBitmap::DXTC1);
|
CoarseBitmap.convertToType(CBitmap::DXTC1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,12 +17,11 @@
|
||||||
#include "std3d.h"
|
#include "std3d.h"
|
||||||
|
|
||||||
#include "nel/3d/bezier_patch.h"
|
#include "nel/3d/bezier_patch.h"
|
||||||
|
|
||||||
using namespace NLMISC;
|
using namespace NLMISC;
|
||||||
|
|
||||||
|
|
||||||
namespace NL3D {
|
namespace NL3D {
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void CBezierPatch::make(CVector vertices[4], CVector normals[4])
|
void CBezierPatch::make(CVector vertices[4], CVector normals[4])
|
||||||
{
|
{
|
||||||
|
@ -48,6 +47,7 @@ void CBezierPatch::make(CVector vertices[4], CVector normals[4])
|
||||||
|
|
||||||
makeInteriors();
|
makeInteriors();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void CBezierPatch::makeInteriors()
|
void CBezierPatch::makeInteriors()
|
||||||
{
|
{
|
||||||
|
@ -60,6 +60,7 @@ void CBezierPatch::makeInteriors()
|
||||||
Interiors[2] = Tangents[3] + Tangents[4] - c;
|
Interiors[2] = Tangents[3] + Tangents[4] - c;
|
||||||
Interiors[3] = Tangents[5] + Tangents[6] - d;
|
Interiors[3] = Tangents[5] + Tangents[6] - d;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void CBezierPatch::applyMatrix(const CMatrix &m)
|
void CBezierPatch::applyMatrix(const CMatrix &m)
|
||||||
{
|
{
|
||||||
|
@ -73,7 +74,6 @@ void CBezierPatch::applyMatrix(const CMatrix &m)
|
||||||
Interiors[i]= m*Interiors[i];
|
Interiors[i]= m*Interiors[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
static inline void mulAdd(CVector &tgt, const CVector &src, float f)
|
static inline void mulAdd(CVector &tgt, const CVector &src, float f)
|
||||||
{
|
{
|
||||||
|
@ -82,7 +82,6 @@ static inline void mulAdd(CVector &tgt, const CVector &src, float f)
|
||||||
tgt.z+= src.z*f;
|
tgt.z+= src.z*f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
static inline void mulAddD(CVectorD &tgt, const CVector &src, double f)
|
static inline void mulAddD(CVectorD &tgt, const CVector &src, double f)
|
||||||
{
|
{
|
||||||
|
@ -91,7 +90,6 @@ static inline void mulAddD(CVectorD &tgt, const CVector &src, double f)
|
||||||
tgt.z+= src.z*f;
|
tgt.z+= src.z*f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
CVector CBezierPatch::eval(float ps, float pt) const
|
CVector CBezierPatch::eval(float ps, float pt) const
|
||||||
{
|
{
|
||||||
|
@ -132,6 +130,7 @@ CVector CBezierPatch::eval(float ps, float pt) const
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
CVectorD CBezierPatch::evalDouble(double ps, double pt) const
|
CVectorD CBezierPatch::evalDouble(double ps, double pt) const
|
||||||
{
|
{
|
||||||
|
@ -173,7 +172,6 @@ CVectorD CBezierPatch::evalDouble(double ps, double pt) const
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
CVector CBezierPatch::evalNormal(float ps, float pt) const
|
CVector CBezierPatch::evalNormal(float ps, float pt) const
|
||||||
{
|
{
|
||||||
|
@ -250,14 +248,12 @@ CVector CBezierPatch::evalNormal(float ps, float pt) const
|
||||||
mulAdd(tgtT, Tangents[3] , s2 * t3);
|
mulAdd(tgtT, Tangents[3] , s2 * t3);
|
||||||
mulAdd(tgtT, Vertices[2] , s3 * t3);
|
mulAdd(tgtT, Vertices[2] , s3 * t3);
|
||||||
|
|
||||||
|
|
||||||
// Return the normal.
|
// Return the normal.
|
||||||
CVector norm= tgtT^tgtS;
|
CVector norm= tgtT^tgtS;
|
||||||
norm.normalize();
|
norm.normalize();
|
||||||
return norm;
|
return norm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
CVector CBezierPatch::evalTangentS(float ps, float pt) const
|
CVector CBezierPatch::evalTangentS(float ps, float pt) const
|
||||||
{
|
{
|
||||||
|
@ -307,7 +303,6 @@ CVector CBezierPatch::evalTangentS(float ps, float pt) const
|
||||||
return tgtS.normed();
|
return tgtS.normed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
CVector CBezierPatch::evalTangentT(float ps, float pt) const
|
CVector CBezierPatch::evalTangentT(float ps, float pt) const
|
||||||
{
|
{
|
||||||
|
@ -357,7 +352,6 @@ CVector CBezierPatch::evalTangentT(float ps, float pt) const
|
||||||
return tgtT.normed();
|
return tgtT.normed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void CBezierPatch::CBezierCurve::subdivide(CBezierCurve &left, CBezierCurve &right, float t)
|
void CBezierPatch::CBezierCurve::subdivide(CBezierCurve &left, CBezierCurve &right, float t)
|
||||||
{
|
{
|
||||||
|
@ -377,7 +371,6 @@ void CBezierPatch::CBezierCurve::subdivide(CBezierCurve &left, CBezierCurve &ri
|
||||||
left.P3= right.P0= t1*left.P2 + t*right.P1;
|
left.P3= right.P0= t1*left.P2 + t*right.P1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void CBezierPatch::subdivideS(CBezierPatch &left, CBezierPatch &right, float s) const
|
void CBezierPatch::subdivideS(CBezierPatch &left, CBezierPatch &right, float s) const
|
||||||
{
|
{
|
||||||
|
@ -408,7 +401,6 @@ void CBezierPatch::subdivideS(CBezierPatch &left, CBezierPatch &right, float s)
|
||||||
curveTRight[3].get(right.Vertices[1], right.Tangents[2] , right.Tangents[3] , right.Vertices[2]);
|
curveTRight[3].get(right.Vertices[1], right.Tangents[2] , right.Tangents[3] , right.Vertices[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void CBezierPatch::subdivideT(CBezierPatch &top, CBezierPatch &bottom, float t) const
|
void CBezierPatch::subdivideT(CBezierPatch &top, CBezierPatch &bottom, float t) const
|
||||||
{
|
{
|
||||||
|
@ -439,6 +431,4 @@ void CBezierPatch::subdivideT(CBezierPatch &top, CBezierPatch &bottom, float t)
|
||||||
curveSBottom[3].get(bottom.Vertices[3], bottom.Tangents[5] , bottom.Tangents[4] , bottom.Vertices[2]);
|
curveSBottom[3].get(bottom.Vertices[3], bottom.Tangents[5] , bottom.Tangents[4] , bottom.Vertices[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // NL3D
|
} // NL3D
|
||||||
|
|
|
@ -21,8 +21,6 @@
|
||||||
#include "nel/3d/texture_bump.h"
|
#include "nel/3d/texture_bump.h"
|
||||||
#include "nel/3d/material.h"
|
#include "nel/3d/material.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace NL3D {
|
namespace NL3D {
|
||||||
|
|
||||||
static void convBlend(CMaterial::TBlend blend, GLenum& glenum)
|
static void convBlend(CMaterial::TBlend blend, GLenum& glenum)
|
||||||
|
@ -86,7 +84,6 @@ static inline void convTexAddr(ITexture *tex, CMaterial::TTexAddressingMode mode
|
||||||
GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV, GL_DOT_PRODUCT_DEPTH_REPLACE_NV
|
GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV, GL_DOT_PRODUCT_DEPTH_REPLACE_NV
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static const GLenum glTexCubeAddrModesNV[] =
|
static const GLenum glTexCubeAddrModesNV[] =
|
||||||
{
|
{
|
||||||
GL_NONE, GL_TEXTURE_CUBE_MAP_ARB, GL_PASS_THROUGH_NV, GL_CULL_FRAGMENT_NV,
|
GL_NONE, GL_TEXTURE_CUBE_MAP_ARB, GL_PASS_THROUGH_NV, GL_CULL_FRAGMENT_NV,
|
||||||
|
@ -107,8 +104,6 @@ static inline void convTexAddr(ITexture *tex, CMaterial::TTexAddressingMode mode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
void CDriverGL::setTextureEnvFunction(uint stage, CMaterial& mat)
|
void CDriverGL::setTextureEnvFunction(uint stage, CMaterial& mat)
|
||||||
{
|
{
|
||||||
|
@ -152,7 +147,6 @@ void CDriverGL::setTextureEnvFunction(uint stage, CMaterial& mat)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------
|
//--------------------------------
|
||||||
void CDriverGL::setupUserTextureMatrix(uint numStages, CMaterial& mat)
|
void CDriverGL::setupUserTextureMatrix(uint numStages, CMaterial& mat)
|
||||||
{
|
{
|
||||||
|
@ -219,7 +213,6 @@ void CDriverGL::disableUserTextureMatrix()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
CMaterial::TShader CDriverGL::getSupportedShader(CMaterial::TShader shader)
|
CMaterial::TShader CDriverGL::getSupportedShader(CMaterial::TShader shader)
|
||||||
{
|
{
|
||||||
|
@ -235,9 +228,6 @@ CMaterial::TShader CDriverGL::getSupportedShader(CMaterial::TShader shader)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
void CDriverGL::setTextureShaders(const uint8 *addressingModes, const CSmartPtr<ITexture> *textures)
|
void CDriverGL::setTextureShaders(const uint8 *addressingModes, const CSmartPtr<ITexture> *textures)
|
||||||
{
|
{
|
||||||
|
@ -256,10 +246,7 @@ void CDriverGL::setTextureShaders(const uint8 *addressingModes, const CSmartPtr<
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
bool CDriverGL::setupMaterial(CMaterial& mat)
|
bool CDriverGL::setupMaterial(CMaterial& mat)
|
||||||
{
|
{
|
||||||
H_AUTO_OGL(CDriverGL_setupMaterial)
|
H_AUTO_OGL(CDriverGL_setupMaterial)
|
||||||
|
@ -268,7 +255,6 @@ bool CDriverGL::setupMaterial(CMaterial& mat)
|
||||||
uint32 touched=mat.getTouched();
|
uint32 touched=mat.getTouched();
|
||||||
uint stage;
|
uint stage;
|
||||||
|
|
||||||
|
|
||||||
// profile.
|
// profile.
|
||||||
_NbSetupMaterialCall++;
|
_NbSetupMaterialCall++;
|
||||||
|
|
||||||
|
@ -287,7 +273,6 @@ bool CDriverGL::setupMaterial(CMaterial& mat)
|
||||||
}
|
}
|
||||||
pShader=static_cast<CShaderGL*>((IMaterialDrvInfos*)(mat._MatDrvInfo));
|
pShader=static_cast<CShaderGL*>((IMaterialDrvInfos*)(mat._MatDrvInfo));
|
||||||
|
|
||||||
|
|
||||||
// 1. Setup modified fields of material.
|
// 1. Setup modified fields of material.
|
||||||
//=====================================
|
//=====================================
|
||||||
if( touched )
|
if( touched )
|
||||||
|
@ -329,7 +314,6 @@ bool CDriverGL::setupMaterial(CMaterial& mat)
|
||||||
pShader->SupportedShader= getSupportedShader(mat.getShader());
|
pShader->SupportedShader= getSupportedShader(mat.getShader());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Since modified, must rebind all openGL states. And do this also for the delete/new problem.
|
// Since modified, must rebind all openGL states. And do this also for the delete/new problem.
|
||||||
/* If an old material is deleted, _CurrentMaterial is invalid. But this is grave only if a new
|
/* If an old material is deleted, _CurrentMaterial is invalid. But this is grave only if a new
|
||||||
material is created, with the same pointer (bad luck). Since an newly allocated material always
|
material is created, with the same pointer (bad luck). Since an newly allocated material always
|
||||||
|
@ -342,7 +326,6 @@ bool CDriverGL::setupMaterial(CMaterial& mat)
|
||||||
mat.clearTouched(0xFFFFFFFF);
|
mat.clearTouched(0xFFFFFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Now we can get the supported shader from the cache.
|
// Now we can get the supported shader from the cache.
|
||||||
CMaterial::TShader matShader = pShader->SupportedShader;
|
CMaterial::TShader matShader = pShader->SupportedShader;
|
||||||
|
|
||||||
|
@ -417,7 +400,6 @@ bool CDriverGL::setupMaterial(CMaterial& mat)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 3. Bind OpenGL States.
|
// 3. Bind OpenGL States.
|
||||||
//=======================
|
//=======================
|
||||||
if (_CurrentMaterial!=&mat)
|
if (_CurrentMaterial!=&mat)
|
||||||
|
@ -446,7 +428,6 @@ bool CDriverGL::setupMaterial(CMaterial& mat)
|
||||||
_DriverGLStates.alphaFunc(mat.getAlphaTestThreshold());
|
_DriverGLStates.alphaFunc(mat.getAlphaTestThreshold());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Bind ZBuffer Part.
|
// Bind ZBuffer Part.
|
||||||
//===================
|
//===================
|
||||||
_DriverGLStates.enableZWrite(mat.getFlags()&IDRV_MAT_ZWRITE);
|
_DriverGLStates.enableZWrite(mat.getFlags()&IDRV_MAT_ZWRITE);
|
||||||
|
@ -526,7 +507,6 @@ bool CDriverGL::setupMaterial(CMaterial& mat)
|
||||||
_CurrentMaterial=&mat;
|
_CurrentMaterial=&mat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 4. Misc
|
// 4. Misc
|
||||||
//=====================================
|
//=====================================
|
||||||
|
|
||||||
|
@ -547,7 +527,6 @@ bool CDriverGL::setupMaterial(CMaterial& mat)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
sint CDriverGL::beginMultiPass()
|
sint CDriverGL::beginMultiPass()
|
||||||
{
|
{
|
||||||
|
@ -574,6 +553,7 @@ sint CDriverGL::beginMultiPass()
|
||||||
default: return 1;
|
default: return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void CDriverGL::setupPass(uint pass)
|
void CDriverGL::setupPass(uint pass)
|
||||||
{
|
{
|
||||||
|
@ -607,7 +587,6 @@ void CDriverGL::setupPass(uint pass)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void CDriverGL::endMultiPass()
|
void CDriverGL::endMultiPass()
|
||||||
{
|
{
|
||||||
|
@ -640,7 +619,6 @@ void CDriverGL::endMultiPass()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void CDriverGL::computeLightMapInfos (const CMaterial &mat)
|
void CDriverGL::computeLightMapInfos (const CMaterial &mat)
|
||||||
{
|
{
|
||||||
|
@ -682,7 +660,6 @@ void CDriverGL::computeLightMapInfos (const CMaterial &mat)
|
||||||
// NB: _NLightMaps==0 means there is no lightmaps at all.
|
// NB: _NLightMaps==0 means there is no lightmaps at all.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
sint CDriverGL::beginLightMapMultiPass ()
|
sint CDriverGL::beginLightMapMultiPass ()
|
||||||
{
|
{
|
||||||
|
@ -714,13 +691,13 @@ sint CDriverGL::beginLightMapMultiPass ()
|
||||||
// Manage too if no lightmaps.
|
// Manage too if no lightmaps.
|
||||||
return std::max (_NLightMapPass, (uint)1);
|
return std::max (_NLightMapPass, (uint)1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void CDriverGL::setupLightMapPass(uint pass)
|
void CDriverGL::setupLightMapPass(uint pass)
|
||||||
{
|
{
|
||||||
H_AUTO_OGL(CDriverGL_setupLightMapPass)
|
H_AUTO_OGL(CDriverGL_setupLightMapPass)
|
||||||
const CMaterial &mat= *_CurrentMaterial;
|
const CMaterial &mat= *_CurrentMaterial;
|
||||||
|
|
||||||
|
|
||||||
// common colors
|
// common colors
|
||||||
static uint32 packedColorBlack= CRGBA(0,0,0,255).getPacked();
|
static uint32 packedColorBlack= CRGBA(0,0,0,255).getPacked();
|
||||||
static GLfloat glcolBlack[4]= {0.f,0.f,0.f,1.f};
|
static GLfloat glcolBlack[4]= {0.f,0.f,0.f,1.f};
|
||||||
|
@ -759,7 +736,6 @@ void CDriverGL::setupLightMapPass(uint pass)
|
||||||
|
|
||||||
nlassert(pass<_NLightMapPass);
|
nlassert(pass<_NLightMapPass);
|
||||||
|
|
||||||
|
|
||||||
// setup Texture Pass.
|
// setup Texture Pass.
|
||||||
//=========================
|
//=========================
|
||||||
uint lmapId;
|
uint lmapId;
|
||||||
|
@ -953,7 +929,6 @@ void CDriverGL::setupLightMapPass(uint pass)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// setup blend / lighting.
|
// setup blend / lighting.
|
||||||
//=========================
|
//=========================
|
||||||
|
|
||||||
|
@ -1012,7 +987,6 @@ void CDriverGL::setupLightMapPass(uint pass)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Dynamic lighting: The influence of the dynamic light must be added only in the first pass (only one time)
|
// Dynamic lighting: The influence of the dynamic light must be added only in the first pass (only one time)
|
||||||
if(pass==0)
|
if(pass==0)
|
||||||
{
|
{
|
||||||
|
@ -1026,6 +1000,7 @@ void CDriverGL::setupLightMapPass(uint pass)
|
||||||
else if(pass==1)
|
else if(pass==1)
|
||||||
_DriverGLStates.setDiffuse(packedColorBlack, glcolBlack);
|
_DriverGLStates.setDiffuse(packedColorBlack, glcolBlack);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void CDriverGL::endLightMapMultiPass()
|
void CDriverGL::endLightMapMultiPass()
|
||||||
{
|
{
|
||||||
|
@ -1057,7 +1032,6 @@ void CDriverGL::endLightMapMultiPass()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void CDriverGL::resetLightMapVertexSetup()
|
void CDriverGL::resetLightMapVertexSetup()
|
||||||
{
|
{
|
||||||
|
@ -1079,7 +1053,6 @@ void CDriverGL::resetLightMapVertexSetup()
|
||||||
_LastVertexSetupIsLightMap= false;
|
_LastVertexSetupIsLightMap= false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void CDriverGL::startSpecularBatch()
|
void CDriverGL::startSpecularBatch()
|
||||||
{
|
{
|
||||||
|
@ -1185,6 +1158,7 @@ sint CDriverGL::beginSpecularMultiPass()
|
||||||
else
|
else
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void CDriverGL::setupSpecularPass(uint pass)
|
void CDriverGL::setupSpecularPass(uint pass)
|
||||||
{
|
{
|
||||||
|
@ -1308,10 +1282,9 @@ void CDriverGL::setupSpecularPass(uint pass)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // We have to do it in 2 passes
|
{
|
||||||
|
// We have to do it in 2 passes
|
||||||
// For Both Pass, setup correct Env.
|
// For Both Pass, setup correct Env.
|
||||||
|
|
||||||
if( pass == 0 )
|
if( pass == 0 )
|
||||||
{ // Just display the texture
|
{ // Just display the texture
|
||||||
_DriverGLStates.enableBlend(false);
|
_DriverGLStates.enableBlend(false);
|
||||||
|
@ -1333,7 +1306,6 @@ void CDriverGL::setupSpecularPass(uint pass)
|
||||||
|
|
||||||
activateTexEnvMode(0, env);
|
activateTexEnvMode(0, env);
|
||||||
|
|
||||||
|
|
||||||
// Set stage 1
|
// Set stage 1
|
||||||
if( mat.getTexture(0) == NULL )
|
if( mat.getTexture(0) == NULL )
|
||||||
{
|
{
|
||||||
|
@ -1355,6 +1327,7 @@ void CDriverGL::setupSpecularPass(uint pass)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void CDriverGL::endSpecularMultiPass()
|
void CDriverGL::endSpecularMultiPass()
|
||||||
{
|
{
|
||||||
|
@ -1364,7 +1337,6 @@ void CDriverGL::endSpecularMultiPass()
|
||||||
setupSpecularEnd();
|
setupSpecularEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// a functor that can is used to generate a cube map used for specular / diffuse lighting
|
// a functor that can is used to generate a cube map used for specular / diffuse lighting
|
||||||
struct CSpecCubeMapFunctor : ICubeMapFunctor
|
struct CSpecCubeMapFunctor : ICubeMapFunctor
|
||||||
{
|
{
|
||||||
|
@ -1380,13 +1352,11 @@ struct CSpecCubeMapFunctor : ICubeMapFunctor
|
||||||
float Exp;
|
float Exp;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* /// parameters for specular cube map generation
|
/* /// parameters for specular cube map generation
|
||||||
const uint MaxSpecularExp = 64;
|
const uint MaxSpecularExp = 64;
|
||||||
const uint SpecularExpStep = 8;
|
const uint SpecularExpStep = 8;
|
||||||
const uint SpecularMapSize = 32; */
|
const uint SpecularMapSize = 32; */
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
CTextureCube *CDriverGL::getSpecularCubeMap(uint exp)
|
CTextureCube *CDriverGL::getSpecularCubeMap(uint exp)
|
||||||
{
|
{
|
||||||
|
@ -1434,7 +1404,6 @@ CTextureCube *CDriverGL::getSpecularCubeMap(uint exp)
|
||||||
|
|
||||||
NLMISC::clamp(exp, 1u, (MaxExponent - 1));
|
NLMISC::clamp(exp, 1u, (MaxExponent - 1));
|
||||||
|
|
||||||
|
|
||||||
uint cubeMapIndex = expToCubeMap[exp];
|
uint cubeMapIndex = expToCubeMap[exp];
|
||||||
nlassert(cubeMapIndex < numCubeMap);
|
nlassert(cubeMapIndex < numCubeMap);
|
||||||
|
|
||||||
|
@ -1542,7 +1511,6 @@ void CDriverGL::setupPPLPass(uint pass)
|
||||||
|
|
||||||
// setup the tex envs
|
// setup the tex envs
|
||||||
|
|
||||||
|
|
||||||
// Stage 0 is rgb = DiffuseCubeMap * LightColor + DiffuseGouraud * 1
|
// Stage 0 is rgb = DiffuseCubeMap * LightColor + DiffuseGouraud * 1
|
||||||
if(_CurrentTexEnvSpecial[0] != TexEnvSpecialPPLStage0)
|
if(_CurrentTexEnvSpecial[0] != TexEnvSpecialPPLStage0)
|
||||||
{
|
{
|
||||||
|
@ -1591,8 +1559,6 @@ void CDriverGL::setupPPLPass(uint pass)
|
||||||
env.Env.SrcArg1Alpha = CMaterial::Diffuse;
|
env.Env.SrcArg1Alpha = CMaterial::Diffuse;
|
||||||
activateTexEnvMode(1, env);
|
activateTexEnvMode(1, env);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Stage 2 is rgb = SpecularCubeMap * SpecularLightColor + Prec * 1
|
// Stage 2 is rgb = SpecularCubeMap * SpecularLightColor + Prec * 1
|
||||||
// alpha = prec alpha
|
// alpha = prec alpha
|
||||||
|
|
||||||
|
@ -1674,7 +1640,6 @@ void CDriverGL::endPPLMultiPass()
|
||||||
// nothing to do there ...
|
// nothing to do there ...
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ******PER PIXEL LIGHTING, NO SPECULAR**************************************
|
// ******PER PIXEL LIGHTING, NO SPECULAR**************************************
|
||||||
sint CDriverGL::beginPPLNoSpecMultiPass()
|
sint CDriverGL::beginPPLNoSpecMultiPass()
|
||||||
{
|
{
|
||||||
|
@ -1704,7 +1669,6 @@ void CDriverGL::setupPPLNoSpecPass(uint pass)
|
||||||
activateTexture(0, tex0);
|
activateTexture(0, tex0);
|
||||||
activateTexture(1, mat.getTexture(0));
|
activateTexture(1, mat.getTexture(0));
|
||||||
|
|
||||||
|
|
||||||
for (uint k = 2; k < inlGetNumTextStages(); ++k)
|
for (uint k = 2; k < inlGetNumTextStages(); ++k)
|
||||||
{
|
{
|
||||||
activateTexture(k, NULL);
|
activateTexture(k, NULL);
|
||||||
|
@ -1712,7 +1676,6 @@ void CDriverGL::setupPPLNoSpecPass(uint pass)
|
||||||
|
|
||||||
// setup the tex envs
|
// setup the tex envs
|
||||||
|
|
||||||
|
|
||||||
// Stage 0 is rgb = DiffuseCubeMap * LightColor + DiffuseGouraud * 1 (TODO : EnvCombine3)
|
// Stage 0 is rgb = DiffuseCubeMap * LightColor + DiffuseGouraud * 1 (TODO : EnvCombine3)
|
||||||
if(_CurrentTexEnvSpecial[0] != TexEnvSpecialPPLStage0)
|
if(_CurrentTexEnvSpecial[0] != TexEnvSpecialPPLStage0)
|
||||||
{
|
{
|
||||||
|
@ -1784,7 +1747,6 @@ void CDriverGL::endPPLNoSpecMultiPass()
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
/*inline void CDriverGL::setupCausticsFirstTex(const CMaterial &mat)
|
/*inline void CDriverGL::setupCausticsFirstTex(const CMaterial &mat)
|
||||||
{
|
{
|
||||||
|
@ -1999,7 +1961,6 @@ void CDriverGL::endCloudMultiPass()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
sint CDriverGL::beginWaterMultiPass()
|
sint CDriverGL::beginWaterMultiPass()
|
||||||
{
|
{
|
||||||
|
@ -2088,7 +2049,6 @@ void CDriverGL::setupWaterPassR200(const CMaterial &mat)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
/** water setup for ARB_fragment_program
|
/** water setup for ARB_fragment_program
|
||||||
*/
|
*/
|
||||||
|
@ -2175,7 +2135,6 @@ void CDriverGL::setupWaterPassARB(const CMaterial &mat)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
/** Presetupped texture shader for water shader on NV20
|
/** Presetupped texture shader for water shader on NV20
|
||||||
*/
|
*/
|
||||||
|
@ -2187,7 +2146,6 @@ static const uint8 WaterNoDiffuseTexAddrMode[IDRV_MAT_MAXTEXTURES] =
|
||||||
CMaterial::TextureOff
|
CMaterial::TextureOff
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static const uint8 WaterTexAddrMode[IDRV_MAT_MAXTEXTURES] =
|
static const uint8 WaterTexAddrMode[IDRV_MAT_MAXTEXTURES] =
|
||||||
{
|
{
|
||||||
CMaterial::FetchTexture,
|
CMaterial::FetchTexture,
|
||||||
|
@ -2198,7 +2156,6 @@ static const uint8 WaterTexAddrMode[IDRV_MAT_MAXTEXTURES] =
|
||||||
|
|
||||||
static const float IdentityTexMat[4] = { 1.f, 0.f, 0.f, 1.f };
|
static const float IdentityTexMat[4] = { 1.f, 0.f, 0.f, 1.f };
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
void CDriverGL::setupWaterPassNV20(const CMaterial &mat)
|
void CDriverGL::setupWaterPassNV20(const CMaterial &mat)
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace NLMISC {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Class description
|
* CEventEmitter UNIX implementation
|
||||||
* \author Vianney Lecroart
|
* \author Vianney Lecroart
|
||||||
* \author Nevrax France
|
* \author Nevrax France
|
||||||
* \date 2000
|
* \date 2000
|
||||||
|
|
|
@ -257,7 +257,7 @@ void CShadowMapManager::renderGenerate(CScene *scene)
|
||||||
if(driverForShadowGeneration)
|
if(driverForShadowGeneration)
|
||||||
driverForShadowGeneration->getWindowSize(wndW, wndH);
|
driverForShadowGeneration->getWindowSize(wndW, wndH);
|
||||||
uint baseTextureSize= scene->getShadowMapTextureSize();
|
uint baseTextureSize= scene->getShadowMapTextureSize();
|
||||||
// Minimize the Dest Texture size, so the blurTexture don't get to heavy in VRAM.
|
// Minimize the Dest Texture size, so the blurTexture don't get too heavy in VRAM.
|
||||||
uint32 textDestW= min(wndW, (uint32)NL3D_SMM_MAX_TEXTDEST_SIZE);
|
uint32 textDestW= min(wndW, (uint32)NL3D_SMM_MAX_TEXTDEST_SIZE);
|
||||||
uint32 textDestH= min(wndH, (uint32)NL3D_SMM_MAX_TEXTDEST_SIZE);
|
uint32 textDestH= min(wndH, (uint32)NL3D_SMM_MAX_TEXTDEST_SIZE);
|
||||||
|
|
||||||
|
|
|
@ -459,51 +459,51 @@ private:
|
||||||
#if EAX_AVAILABLE == 1
|
#if EAX_AVAILABLE == 1
|
||||||
LPKSPROPERTYSET _EAXSource;
|
LPKSPROPERTYSET _EAXSource;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if NLSOUND_PROFILE
|
#if NLSOUND_PROFILE
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
static double _LastSwapTime;
|
static double _LastSwapTime;
|
||||||
static double _TotalSwapTime;
|
static double _TotalSwapTime;
|
||||||
static double _MaxSwapTime;
|
static double _MaxSwapTime;
|
||||||
static double _MinSwapTime;
|
static double _MinSwapTime;
|
||||||
static uint32 _SwapCount;
|
static uint32 _SwapCount;
|
||||||
|
|
||||||
static double _TotalUpdateTime;
|
static double _TotalUpdateTime;
|
||||||
static double _MaxUpdateTime;
|
static double _MaxUpdateTime;
|
||||||
static double _MinUpdateTime;
|
static double _MinUpdateTime;
|
||||||
static uint32 _UpdateCount;
|
static uint32 _UpdateCount;
|
||||||
static uint32 _TotalUpdateSize;
|
static uint32 _TotalUpdateSize;
|
||||||
|
|
||||||
static double _PosTime;
|
static double _PosTime;
|
||||||
static double _LockTime;
|
static double _LockTime;
|
||||||
static double _CopyTime;
|
static double _CopyTime;
|
||||||
static double _UnlockTime;
|
static double _UnlockTime;
|
||||||
static uint32 _CopyCount;
|
static uint32 _CopyCount;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
static double getTestLast() { return 1000.0f * _LastSwapTime; };
|
static double getTestLast() { return 1000.0f * _LastSwapTime; };
|
||||||
static double getTestMax() { return 1000.0f * _MaxSwapTime; };
|
static double getTestMax() { return 1000.0f * _MaxSwapTime; };
|
||||||
static double getTestMin() { return 1000.0f * _MinSwapTime; };
|
static double getTestMin() { return 1000.0f * _MinSwapTime; };
|
||||||
static double getTestAverage() { return (_SwapCount > 0) ? 1000.0f * _TotalSwapTime / _SwapCount : 0.0; };
|
static double getTestAverage() { return (_SwapCount > 0) ? 1000.0f * _TotalSwapTime / _SwapCount : 0.0; };
|
||||||
|
|
||||||
static double getAveragePosTime() { return (_CopyCount > 0) ? 1000.0f * _PosTime / _CopyCount : 0.0; };
|
static double getAveragePosTime() { return (_CopyCount > 0) ? 1000.0f * _PosTime / _CopyCount : 0.0; };
|
||||||
static double getAverageLockTime() { return (_CopyCount > 0) ? 1000.0f * _LockTime / _CopyCount : 0.0; };
|
static double getAverageLockTime() { return (_CopyCount > 0) ? 1000.0f * _LockTime / _CopyCount : 0.0; };
|
||||||
static double getAverageCopyTime() { return (_CopyCount > 0) ? 1000.0f * _CopyTime / _CopyCount : 0.0; };
|
static double getAverageCopyTime() { return (_CopyCount > 0) ? 1000.0f * _CopyTime / _CopyCount : 0.0; };
|
||||||
static double getAverageUnlockTime() { return (_CopyCount > 0) ? 1000.0f * _UnlockTime / _CopyCount : 0.0; };
|
static double getAverageUnlockTime() { return (_CopyCount > 0) ? 1000.0f * _UnlockTime / _CopyCount : 0.0; };
|
||||||
static double getAverageCumulTime() { return (_CopyCount > 0) ? 1000.0f * (_PosTime + _LockTime + _CopyTime + _UnlockTime) / _CopyCount : 0.0; };
|
static double getAverageCumulTime() { return (_CopyCount > 0) ? 1000.0f * (_PosTime + _LockTime + _CopyTime + _UnlockTime) / _CopyCount : 0.0; };
|
||||||
static uint getAverageUpdateSize() { return (_CopyCount > 0) ? (uint) (_TotalUpdateSize / _CopyCount) : 0; };
|
static uint getAverageUpdateSize() { return (_CopyCount > 0) ? (uint) (_TotalUpdateSize / _CopyCount) : 0; };
|
||||||
|
|
||||||
static double getMaxUpdateTime() { return 1000.0f * _MaxUpdateTime; };
|
static double getMaxUpdateTime() { return 1000.0f * _MaxUpdateTime; };
|
||||||
static double getMinUpdateTime() { return 1000.0f * _MinUpdateTime; };
|
static double getMinUpdateTime() { return 1000.0f * _MinUpdateTime; };
|
||||||
static double getAverageUpdateTime() { return (_UpdateCount > 0) ? 1000.0f * _TotalUpdateTime / _UpdateCount : 0.0; };
|
static double getAverageUpdateTime() { return (_UpdateCount > 0) ? 1000.0f * _TotalUpdateTime / _UpdateCount : 0.0; };
|
||||||
|
|
||||||
static double getTotalUpdateTime() { return 1000.0f * _TotalUpdateTime; };
|
static double getTotalUpdateTime() { return 1000.0f * _TotalUpdateTime; };
|
||||||
static double getUpdateBytesPerMsec() { return (_UpdateCount > 0) ? _TotalUpdateSize / _TotalUpdateTime / 1000.0 : 0.0; }
|
static double getUpdateBytesPerMsec() { return (_UpdateCount > 0) ? _TotalUpdateSize / _TotalUpdateTime / 1000.0 : 0.0; }
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -18,10 +18,6 @@
|
||||||
|
|
||||||
#include "stdpch.h"
|
#include "stdpch.h"
|
||||||
|
|
||||||
#ifdef NL_OS_WINDOWS
|
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "actions.h"
|
#include "actions.h"
|
||||||
#include "events_listener.h"
|
#include "events_listener.h"
|
||||||
#include "interface_v3/interface_manager.h"
|
#include "interface_v3/interface_manager.h"
|
||||||
|
|
|
@ -26,9 +26,8 @@
|
||||||
|
|
||||||
// OS.
|
// OS.
|
||||||
#ifdef NL_OS_WINDOWS
|
#ifdef NL_OS_WINDOWS
|
||||||
|
# define NOMINMAX
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
# undef min
|
|
||||||
# undef max
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Misc
|
// Misc
|
||||||
|
|
|
@ -247,7 +247,6 @@ bool CCtrlTextButton::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup)
|
||||||
if (prop)
|
if (prop)
|
||||||
_TextShadowColorOver = convertColor(prop);
|
_TextShadowColorOver = convertColor(prop);
|
||||||
|
|
||||||
|
|
||||||
// *** Read Text Global Color
|
// *** Read Text Global Color
|
||||||
// Default: take "global_color" param interface_element option.
|
// Default: take "global_color" param interface_element option.
|
||||||
_TextModulateGlobalColorNormal= _TextModulateGlobalColorPushed= _TextModulateGlobalColorOver= getModulateGlobalColor();
|
_TextModulateGlobalColorNormal= _TextModulateGlobalColorPushed= _TextModulateGlobalColorOver= getModulateGlobalColor();
|
||||||
|
@ -262,12 +261,10 @@ bool CCtrlTextButton::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup)
|
||||||
prop = (char*) xmlGetProp( cur, (xmlChar*)"force_text_over" );
|
prop = (char*) xmlGetProp( cur, (xmlChar*)"force_text_over" );
|
||||||
if (prop) _ForceTextOver= convertBool(prop);
|
if (prop) _ForceTextOver= convertBool(prop);
|
||||||
|
|
||||||
|
|
||||||
// read Text header color
|
// read Text header color
|
||||||
prop = (char*) xmlGetProp( cur, (xmlChar*)"text_header_color" );
|
prop = (char*) xmlGetProp( cur, (xmlChar*)"text_header_color" );
|
||||||
if (prop) _TextHeaderColor= convertBool(prop);
|
if (prop) _TextHeaderColor= convertBool(prop);
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,10 +31,6 @@
|
||||||
#include "../time_client.h"
|
#include "../time_client.h"
|
||||||
#include "lua_ihm.h"
|
#include "lua_ihm.h"
|
||||||
|
|
||||||
#ifdef NL_OS_WINDOWS
|
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace NLMISC;
|
using namespace NLMISC;
|
||||||
using namespace NL3D;
|
using namespace NL3D;
|
||||||
|
|
|
@ -19,13 +19,6 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
#include "stdpch.h"
|
#include "stdpch.h"
|
||||||
#ifdef NL_OS_WINDOWS
|
|
||||||
//#include <sys/utime.h>
|
|
||||||
#else
|
|
||||||
//#include <utime.h>
|
|
||||||
//#define _utimbuf utimbuf
|
|
||||||
//#define _utime utime
|
|
||||||
#endif
|
|
||||||
#include "nel/misc/path.h"
|
#include "nel/misc/path.h"
|
||||||
#include "nel/misc/sha1.h"
|
#include "nel/misc/sha1.h"
|
||||||
#include "bnp_patch.h"
|
#include "bnp_patch.h"
|
||||||
|
|
Loading…
Reference in a new issue