Changed: #878 Fix typos in comments/code

This commit is contained in:
kervala 2010-06-07 15:40:29 +02:00
parent c59af80faa
commit 13435926e7

View file

@ -264,7 +264,6 @@ static Bool WndProc(Display *d, XEvent *e, char *arg)
*/
#endif // NL_OS_UNIX
GLenum CDriverGL::NLCubeFaceToGLCubeFace[6] =
{
GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB,
@ -279,9 +278,9 @@ GLenum CDriverGL::NLCubeFaceToGLCubeFace[6] =
CDriverGL::CDriverGL()
{
H_AUTO_OGL(CDriverGL_CDriverGL)
_OffScreen = false;
#ifdef NL_OS_WINDOWS
_PBuffer = NULL;
_hWnd = NULL;
_hRC = NULL;
@ -290,10 +289,13 @@ CDriverGL::CDriverGL()
_Interval = 1;
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
NL3D::MAC::ctor();
#elif defined (NL_OS_UNIX)
cursor = None;
_win = 0;
_dpy = 0;
# ifdef XF86VIDMODE
// zero the old screen mode
@ -302,7 +304,8 @@ CDriverGL::CDriverGL()
# endif //XF86VIDMODE
#endif // NL_OS_UNIX
_FullScreen= false;
_OffScreen = false;
_FullScreen = false;
_CurrentMaterial=NULL;
_Initialized = false;
@ -347,7 +350,6 @@ CDriverGL::CDriverGL()
_NVTextureShaderEnabled = false;
// Compute the Flag which say if one texture has been changed in CMaterial.
_MaterialAllTextureTouchedFlag= 0;
for(i=0; i < IDRV_MAT_MAXTEXTURES; i++)
@ -356,7 +358,6 @@ CDriverGL::CDriverGL()
_CurrentTexAddrMode[i] = GL_NONE;
}
_UserTexMatEnabled = 0;
// Ligtmap preca.
@ -415,7 +416,6 @@ CDriverGL::CDriverGL()
_TextureTargetUpload = false;
}
// ***************************************************************************
CDriverGL::~CDriverGL()
{
@ -502,21 +502,18 @@ bool CDriverGL::stretchRect(ITexture * /* srcText */, NLMISC::CRect &/* srcRect
}
// ***************************************************************************
bool CDriverGL::supportBloomEffect() const
{
return (isVertexProgramSupported() && supportFrameBufferObject() && supportPackedDepthStencil() && supportTextureRectangle());
}
// ***************************************************************************
bool CDriverGL::supportNonPowerOfTwoTextures() const
{
return _Extensions.ARBTextureNonPowerOfTwo;
}
// ***************************************************************************
bool CDriverGL::isTextureRectangle(ITexture * tex) const
{
return (supportTextureRectangle() && tex->isBloomTexture() && tex->mipMapOff()
@ -524,7 +521,6 @@ bool CDriverGL::isTextureRectangle(ITexture * tex) const
}
// ***************************************************************************
bool CDriverGL::activeFrameBufferObject(ITexture * tex)
{
if(supportFrameBufferObject()/* && supportPackedDepthStencil()*/)
@ -545,7 +541,6 @@ bool CDriverGL::activeFrameBufferObject(ITexture * tex)
}
// --------------------------------------------------
void CDriverGL::disableHardwareVertexProgram()
{
H_AUTO_OGL(CDriverGL_disableHardwareVertexProgram)
@ -565,7 +560,6 @@ void CDriverGL::disableHardwareTextureShader()
}
// --------------------------------------------------
bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool resizeable) throw(EBadDisplay)
{
H_AUTO_OGL(CDriverGL_setDisplay)
@ -677,8 +671,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
return false;
}
// Make the context current
if (!wglMakeCurrent(tempHDC,tempGLRC))
{
@ -1190,7 +1182,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
nlwarning("Missing Important GL extension: GL_EXT_texture_env_combine => All envcombine are setup to GL_MODULATE!!!");
}
// Get num of light for this driver
int numLight;
glGetIntegerv (GL_MAX_LIGHTS, &numLight);
@ -1206,7 +1197,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
// init _DriverGLStates
_DriverGLStates.init(_Extensions.ARBTextureCubeMap, (_Extensions.NVTextureRectangle || _Extensions.EXTTextureRectangle || _Extensions.ARBTextureRectangle), _MaxDriverLight);
// Init OpenGL/Driver defaults.
//=============================
glViewport(0,0,width,height);
@ -1248,7 +1238,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
_VertexProgramEnabled= false;
_LastSetupGLArrayVertexProgram= false;
// Init VertexArrayRange according to supported extenstion.
_SupportVBHard= false;
_SlowUnlockVBHard= false;
@ -1297,7 +1286,8 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
_CurrentVertexBufferHard= NULL;
_NVCurrentVARPtr= NULL;
_NVCurrentVARSize= 0;
if(_SupportVBHard)
if (_SupportVBHard)
{
// try to allocate 16Mo by default of AGP Ram.
initVertexBufferHard(NL3D_DRV_VERTEXARRAY_AGP_INIT_SIZE, 0);
@ -1329,8 +1319,6 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
//===========================================================
initFragmentShaders();
// Activate the default texture environnments for all stages.
//===========================================================
for(uint stage=0;stage<inlGetNumTextStages(); stage++)
@ -1365,8 +1353,8 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
glTexGenfv(GL_Q, GL_OBJECT_PLANE, params);
glTexGenfv(GL_Q, GL_EYE_PLANE, params);
}
resetTextureShaders();
resetTextureShaders();
_PPLExponent = 1.f;
_PPLightDiffuseColor = NLMISC::CRGBA::White;
@ -1839,30 +1827,26 @@ void CDriverGL::resetTextureShaders()
{
glEnable(GL_TEXTURE_SHADER_NV);
for (uint stage = 0; stage < inlGetNumTextStages(); ++stage)
{
_DriverGLStates.activeTextureARB(stage);
if (stage != 0)
{
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB + stage - 1);
}
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_NONE);
glTexEnvi(GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_NONE);
_CurrentTexAddrMode[stage] = GL_NONE;
}
glDisable(GL_TEXTURE_SHADER_NV);
glDisable(GL_TEXTURE_SHADER_NV);
_NVTextureShaderEnabled = false;
}
}
// --------------------------------------------------
emptyProc CDriverGL::getWindowProc()
{
H_AUTO_OGL(CDriverGL_getWindowProc)
@ -1874,7 +1858,6 @@ emptyProc CDriverGL::getWindowProc()
}
// --------------------------------------------------
bool CDriverGL::activate()
{
H_AUTO_OGL(CDriverGL_activate)
@ -1903,7 +1886,6 @@ bool CDriverGL::activate()
}
// --------------------------------------------------
bool CDriverGL::isTextureExist(const ITexture&tex)
{
H_AUTO_OGL(CDriverGL_isTextureExist)
@ -1922,7 +1904,6 @@ bool CDriverGL::isTextureExist(const ITexture&tex)
}
// --------------------------------------------------
bool CDriverGL::clear2D(CRGBA rgba)
{
H_AUTO_OGL(CDriverGL_clear2D)
@ -1934,7 +1915,6 @@ bool CDriverGL::clear2D(CRGBA rgba)
}
// --------------------------------------------------
bool CDriverGL::clearZBuffer(float zval)
{
H_AUTO_OGL(CDriverGL_clearZBuffer)
@ -1947,7 +1927,6 @@ bool CDriverGL::clearZBuffer(float zval)
}
// --------------------------------------------------
bool CDriverGL::clearStencilBuffer(float stencilval)
{
H_AUTO_OGL(CDriverGL_clearStencilBuffer)
@ -1959,7 +1938,6 @@ bool CDriverGL::clearStencilBuffer(float stencilval)
}
// --------------------------------------------------
void CDriverGL::setColorMask (bool bRed, bool bGreen, bool bBlue, bool bAlpha)
{
H_AUTO_OGL(CDriverGL_setColorMask )
@ -1970,6 +1948,7 @@ void CDriverGL::setColorMask (bool bRed, bool bGreen, bool bBlue, bool bAlpha)
bool CDriverGL::swapBuffers()
{
H_AUTO_OGL(CDriverGL_swapBuffers)
++ _SwapBufferCounter;
// Reset texture shaders
//resetTextureShaders();
@ -2115,7 +2094,6 @@ bool CDriverGL::swapBuffers()
}
// --------------------------------------------------
bool CDriverGL::release()
{
H_AUTO_OGL(CDriverGL_release)
@ -2236,8 +2214,7 @@ bool CDriverGL::release()
}
// --------------------------------------------------
IDriver::TMessageBoxId CDriverGL::systemMessageBox (const char* message, const char* title, IDriver::TMessageBoxType type, TMessageBoxIcon icon)
IDriver::TMessageBoxId CDriverGL::systemMessageBox (const char* message, const char* title, IDriver::TMessageBoxType type, TMessageBoxIcon icon)
{
H_AUTO_OGL(CDriverGL_systemMessageBox)
#ifdef NL_OS_WINDOWS
@ -2280,7 +2257,6 @@ IDriver::TMessageBoxId CDriverGL::systemMessageBox (const char* message, const c
}
// --------------------------------------------------
void CDriverGL::setupViewport (const class CViewport& viewport)
{
H_AUTO_OGL(CDriverGL_setupViewport )
@ -2343,9 +2319,6 @@ void CDriverGL::setupViewport (const class CViewport& viewport)
int iheight=(int)((float)clientHeight*height+0.5f);
clamp (iheight, 0, clientHeight-iy);
glViewport (ix, iy, iwidth, iheight);
}
// --------------------------------------------------
@ -2355,10 +2328,8 @@ void CDriverGL::getViewport(CViewport &viewport)
viewport = _CurrViewport;
}
// --------------------------------------------------
void CDriverGL::setupScissor (const class CScissor& scissor)
void CDriverGL::setupScissor (const class CScissor& scissor)
{
H_AUTO_OGL(CDriverGL_setupScissor )
#ifdef NL_OS_WINDOWS
@ -2443,10 +2414,7 @@ void CDriverGL::setupScissor (const class CScissor& scissor)
}
}
// --------------------------------------------------
void CDriverGL::showCursor(bool b)
{
H_AUTO_OGL(CDriverGL_showCursor)
@ -2495,7 +2463,6 @@ void CDriverGL::showCursor(bool b)
// --------------------------------------------------
void CDriverGL::setMousePos(float x, float y)
{
H_AUTO_OGL(CDriverGL_setMousePos)
@ -2585,10 +2552,7 @@ void CDriverGL::getWindowPos(uint32 &x, uint32 &y)
#endif // NL_OS_UNIX
}
// --------------------------------------------------
bool CDriverGL::isActive()
{
H_AUTO_OGL(CDriverGL_isActive)
@ -2621,13 +2585,10 @@ const char *CDriverGL::getVideocardInformation ()
const char *renderer = (const char *) glGetString (GL_RENDERER);
const char *version = (const char *) glGetString (GL_VERSION);
smprintf(name, 1024, "OpenGL / %s / %s / %s", vendor, renderer, version);
return name;
}
void CDriverGL::setCapture (bool b)
{
H_AUTO_OGL(CDriverGL_setCapture )
@ -2703,8 +2664,6 @@ bool CDriverGL::clipRect(NLMISC::CRect &rect)
return rect.Width>0 && rect.Height>0;
}
void CDriverGL::getBufferPart (CBitmap &bitmap, NLMISC::CRect &rect)
{
H_AUTO_OGL(CDriverGL_getBufferPart )
@ -2763,9 +2722,6 @@ bool CDriverGL::fillBuffer (CBitmap &bitmap)
}
// ***************************************************************************
void CDriverGL::copyFrameBufferToTexture(ITexture *tex,
uint32 level,
uint32 offsetx,
@ -2811,7 +2767,7 @@ void CDriverGL::copyFrameBufferToTexture(ITexture *tex,
// gltext->activeFrameBufferObject(tex);
}
// ***************************************************************************
void CDriverGL::setPolygonMode (TPolygonMode mode)
{
H_AUTO_OGL(CDriverGL_setPolygonMode )
@ -2832,21 +2788,23 @@ void CDriverGL::setPolygonMode (TPolygonMode mode)
}
}
bool CDriverGL::fogEnabled()
// ***************************************************************************
bool CDriverGL::fogEnabled()
{
H_AUTO_OGL(CDriverGL_fogEnabled)
return _FogEnabled;
}
void CDriverGL::enableFog(bool enable)
// ***************************************************************************
void CDriverGL::enableFog(bool enable)
{
H_AUTO_OGL(CDriverGL_enableFog)
_DriverGLStates.enableFog(enable);
_FogEnabled= enable;
}
void CDriverGL::setupFog(float start, float end, CRGBA color)
// ***************************************************************************
void CDriverGL::setupFog(float start, float end, CRGBA color)
{
H_AUTO_OGL(CDriverGL_setupFog)
glFogf(GL_FOG_MODE, GL_LINEAR);
@ -2881,23 +2839,22 @@ void CDriverGL::setupFog(float start, float end, CRGBA color)
_FogEnd = end;
}
// ***************************************************************************
float CDriverGL::getFogStart() const
float CDriverGL::getFogStart() const
{
H_AUTO_OGL(CDriverGL_getFogStart)
return _FogStart;
}
// ***************************************************************************
float CDriverGL::getFogEnd() const
float CDriverGL::getFogEnd() const
{
H_AUTO_OGL(CDriverGL_getFogEnd)
return _FogEnd;
}
// ***************************************************************************
CRGBA CDriverGL::getFogColor() const
CRGBA CDriverGL::getFogColor() const
{
H_AUTO_OGL(CDriverGL_getFogColor)
CRGBA ret;
@ -3081,7 +3038,7 @@ bool CDriverGL::supportPerPixelLighting(bool specular) const
}
// ***************************************************************************
void CDriverGL::setPerPixelLightingLight(CRGBA diffuse, CRGBA specular, float shininess)
void CDriverGL::setPerPixelLightingLight(CRGBA diffuse, CRGBA specular, float shininess)
{
H_AUTO_OGL(CDriverGL_setPerPixelLightingLight)
@ -3091,7 +3048,7 @@ void CDriverGL::setPerPixelLightingLight(CRGBA diffuse, CRGBA specular, float sh
}
// ***************************************************************************
NLMISC::IMouseDevice *CDriverGL::enableLowLevelMouse(bool enable, bool exclusive)
NLMISC::IMouseDevice* CDriverGL::enableLowLevelMouse(bool enable, bool exclusive)
{
H_AUTO_OGL(CDriverGL_enableLowLevelMouse)
@ -3126,7 +3083,7 @@ NLMISC::IMouseDevice *CDriverGL::enableLowLevelMouse(bool enable, bool exclusive
}
// ***************************************************************************
NLMISC::IKeyboardDevice *CDriverGL::enableLowLevelKeyboard(bool enable)
NLMISC::IKeyboardDevice* CDriverGL::enableLowLevelKeyboard(bool enable)
{
H_AUTO_OGL(CDriverGL_enableLowLevelKeyboard)
#ifdef NL_OS_WINDOWS
@ -3160,7 +3117,7 @@ NLMISC::IKeyboardDevice *CDriverGL::enableLowLevelKeyboard(bool enable)
}
// ***************************************************************************
NLMISC::IInputDeviceManager *CDriverGL::getLowLevelInputDeviceManager()
NLMISC::IInputDeviceManager* CDriverGL::getLowLevelInputDeviceManager()
{
H_AUTO_OGL(CDriverGL_getLowLevelInputDeviceManager)
#ifdef NL_OS_WINDOWS
@ -3216,14 +3173,14 @@ uint CDriverGL::getDoubleClickDelay(bool hardwareMouse)
}
// ***************************************************************************
bool CDriverGL::supportBlendConstantColor() const
bool CDriverGL::supportBlendConstantColor() const
{
H_AUTO_OGL(CDriverGL_supportBlendConstantColor)
return _Extensions.EXTBlendColor;
}
// ***************************************************************************
void CDriverGL::setBlendConstantColor(NLMISC::CRGBA col)
void CDriverGL::setBlendConstantColor(NLMISC::CRGBA col)
{
H_AUTO_OGL(CDriverGL_setBlendConstantColor)
@ -3238,7 +3195,7 @@ void CDriverGL::setBlendConstantColor(NLMISC::CRGBA col)
}
// ***************************************************************************
NLMISC::CRGBA CDriverGL::getBlendConstantColor() const
NLMISC::CRGBA CDriverGL::getBlendConstantColor() const
{
H_AUTO_OGL(CDriverGL_CDriverGL)
@ -3252,7 +3209,6 @@ uint CDriverGL::getNbTextureStages() const
return inlGetNumTextStages();
}
// ***************************************************************************
void CDriverGL::refreshProjMatrixFromGL()
{
@ -3266,7 +3222,7 @@ void CDriverGL::refreshProjMatrixFromGL()
}
// ***************************************************************************
bool CDriverGL::setMonitorColorProperties (const CMonitorColorProperties &properties)
bool CDriverGL::setMonitorColorProperties (const CMonitorColorProperties &properties)
{
H_AUTO_OGL(CDriverGL_setMonitorColorProperties )
@ -3419,9 +3375,6 @@ void CDriverGL::initEMBM()
}
}
// ***************************************************************************
/** Water fragment program with extension ARB_fragment_program
*/
@ -3483,8 +3436,6 @@ MAD_SAT tmpFog, fogValue.x, fogFactor.x, fogFactor.y; \n\
LRP oCol, tmpFog.x, envMap, fogColor; \n\
END ";
// **************************************************************************************
/** Water fragment program with extension ARB_fragment_program and a diffuse map applied
*/
@ -3556,7 +3507,6 @@ MUL diffuse, diffuse, envMap; \n\
LRP oCol, tmpFog.x, diffuse, fogColor; \n\
END ";
// ***************************************************************************
/** Load a ARB_fragment_program_code, and ensure it is loaded natively
*/
@ -3595,7 +3545,6 @@ uint loadARBFragmentProgramStringNative(const char *prog, bool forceNativeProgra
return 0;
}
// ***************************************************************************
/** R200 Fragment Shader :
* Send fragment shader to fetch a perturbed envmap from the addition of 2 bumpmap
@ -3627,6 +3576,7 @@ void CDriverGL::forceNativeFragmentPrograms(bool nativeOnly)
_ForceNativeFragmentPrograms = nativeOnly;
}
// ***************************************************************************
void CDriverGL::initFragmentShaders()
{
H_AUTO_OGL(CDriverGL_initFragmentShaders)
@ -3781,7 +3731,6 @@ void CDriverGL::deleteFragmentShaders()
}
}
// ***************************************************************************
void CDriverGL::finish()
{
@ -4095,7 +4044,6 @@ void CDriverGL::retrieveATIDriverVersion()
#endif
}
// ***************************************************************************
bool CDriverGL::supportMADOperator() const
{
@ -4104,7 +4052,6 @@ bool CDriverGL::supportMADOperator() const
return _Extensions.NVTextureEnvCombine4 || _Extensions.ATITextureEnvCombine3;
}
// ***************************************************************************
uint CDriverGL::getNumAdapter() const
{
@ -4114,7 +4061,6 @@ uint CDriverGL::getNumAdapter() const
}
// ***************************************************************************
bool CDriverGL::getAdapter(uint adapter, CAdapter &desc) const
{
H_AUTO_OGL(CDriverGL_getAdapter)
@ -4137,7 +4083,6 @@ bool CDriverGL::getAdapter(uint adapter, CAdapter &desc) const
}
// ***************************************************************************
bool CDriverGL::setAdapter(uint adapter)
{
H_AUTO_OGL(CDriverGL_setAdapter)
@ -4146,7 +4091,6 @@ bool CDriverGL::setAdapter(uint adapter)
}
// ***************************************************************************
CVertexBuffer::TVertexColorType CDriverGL::getVertexColorFormat() const
{
H_AUTO_OGL(CDriverGL_CDriverGL)
@ -4155,7 +4099,6 @@ CVertexBuffer::TVertexColorType CDriverGL::getVertexColorFormat() const
}
// ***************************************************************************
bool CDriverGL::activeShader(CShader * /* shd */)
{
H_AUTO_OGL(CDriverGL_activeShader)
@ -4164,21 +4107,18 @@ bool CDriverGL::activeShader(CShader * /* shd */)
}
// ***************************************************************************
void CDriverGL::startBench (bool wantStandardDeviation, bool quick, bool reset)
{
CHTimer::startBench (wantStandardDeviation, quick, reset);
}
// ***************************************************************************
void CDriverGL::endBench ()
{
CHTimer::endBench ();
}
// ***************************************************************************
void CDriverGL::displayBench (class NLMISC::CLog *log)
{
// diplay
@ -4360,7 +4300,6 @@ uint COcclusionQueryGL::getVisibleCount()
return VisibleCount;
}
// ***************************************************************************
void CDriverGL::setDepthRange(float znear, float zfar)
{
@ -4466,12 +4405,10 @@ void CDriverGL::stencilOp(TStencilOp fail, TStencilOp zfail, TStencilOp zpass)
default: nlstop;
}
_DriverGLStates.stencilOp(glFail, glZFail, glZPass);
}
// ***************************************************************************
void CDriverGL::stencilMask(uint mask)
{
H_AUTO_OGL(CDriverGL_CDriverGL)
@ -4498,6 +4435,7 @@ void CDriverGL::endDialogMode()
} // NL3D
// ***************************************************************************
void displayGLError(GLenum error)
{
switch(error)