aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llrender
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llrender/llfont.cpp2
-rw-r--r--linden/indra/llrender/llfontregistry.cpp7
-rw-r--r--linden/indra/llrender/llgl.cpp30
-rw-r--r--linden/indra/llrender/llgl.h7
-rw-r--r--linden/indra/llrender/llglheaders.h10
5 files changed, 38 insertions, 18 deletions
diff --git a/linden/indra/llrender/llfont.cpp b/linden/indra/llrender/llfont.cpp
index da5eda0..946f52f 100644
--- a/linden/indra/llrender/llfont.cpp
+++ b/linden/indra/llrender/llfont.cpp
@@ -311,7 +311,7 @@ BOOL LLFont::addChar(const llwchar wch) const
311 // Try looking it up in the backup Unicode font 311 // Try looking it up in the backup Unicode font
312 if (mFallbackFontp) 312 if (mFallbackFontp)
313 { 313 {
314 //llinfos << "Trying to add glyph from fallback font!" << llendl 314 //llinfos << "Trying to add glyph from fallback font!" << llendl;
315 LLFontList::iterator iter; 315 LLFontList::iterator iter;
316 for(iter = mFallbackFontp->begin(); iter != mFallbackFontp->end(); iter++) 316 for(iter = mFallbackFontp->begin(); iter != mFallbackFontp->end(); iter++)
317 { 317 {
diff --git a/linden/indra/llrender/llfontregistry.cpp b/linden/indra/llrender/llfontregistry.cpp
index b1d8c5c..9792a91 100644
--- a/linden/indra/llrender/llfontregistry.cpp
+++ b/linden/indra/llrender/llfontregistry.cpp
@@ -107,7 +107,7 @@ bool removeSubString(std::string& str, const std::string& substr)
107 size_t pos = str.find(substr); 107 size_t pos = str.find(substr);
108 if (pos != string::npos) 108 if (pos != string::npos)
109 { 109 {
110 str.replace(pos,substr.length(),(const char *)NULL, 0); 110 str.erase(pos,substr.length());
111 return true; 111 return true;
112 } 112 }
113 return false; 113 return false;
@@ -442,12 +442,13 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc)
442 std::string font_path = local_path + *file_name_it; 442 std::string font_path = local_path + *file_name_it;
443 BOOL is_fallback = !is_first_found; 443 BOOL is_fallback = !is_first_found;
444 F32 size_mult = (is_fallback ? 1 : match_desc->getSizeMult()); 444 F32 size_mult = (is_fallback ? 1 : match_desc->getSizeMult());
445 if (!fontp->loadFace(font_path, point_size * size_mult, 445 F32 size = (F32)llround(point_size * size_mult);
446 if (!fontp->loadFace(font_path, size,
446 LLFontGL::sVertDPI, LLFontGL::sHorizDPI, 2, is_fallback)) 447 LLFontGL::sVertDPI, LLFontGL::sHorizDPI, 2, is_fallback))
447 { 448 {
448 font_path = sys_path + *file_name_it; 449 font_path = sys_path + *file_name_it;
449 450
450 if (!fontp->loadFace(font_path, point_size * size_mult, 451 if (!fontp->loadFace(font_path, size,
451 LLFontGL::sVertDPI, LLFontGL::sHorizDPI, 2, is_fallback)) 452 LLFontGL::sVertDPI, LLFontGL::sHorizDPI, 2, is_fallback))
452 { 453 {
453 LL_INFOS_ONCE("LLFontRegistry") << "Couldn't load font " << *file_name_it << LL_ENDL; 454 LL_INFOS_ONCE("LLFontRegistry") << "Couldn't load font " << *file_name_it << LL_ENDL;
diff --git a/linden/indra/llrender/llgl.cpp b/linden/indra/llrender/llgl.cpp
index be3ed96..d73f7b6 100644
--- a/linden/indra/llrender/llgl.cpp
+++ b/linden/indra/llrender/llgl.cpp
@@ -554,41 +554,46 @@ extern LLCPUInfo gSysCPU;
554void LLGLManager::initExtensions() 554void LLGLManager::initExtensions()
555{ 555{
556#if LL_MESA_HEADLESS 556#if LL_MESA_HEADLESS
557# if GL_ARB_multitexture 557# ifdef GL_ARB_multitexture
558 mHasMultitexture = TRUE; 558 mHasMultitexture = TRUE;
559# else 559# else
560 mHasMultitexture = FALSE; 560 mHasMultitexture = FALSE;
561# endif 561# endif
562# if GL_ARB_texture_env_combine 562# ifdef GL_ARB_texture_env_combine
563 mHasARBEnvCombine = TRUE; 563 mHasARBEnvCombine = TRUE;
564# else 564# else
565 mHasARBEnvCombine = FALSE; 565 mHasARBEnvCombine = FALSE;
566# endif 566# endif
567# if GL_ARB_texture_compression 567# ifdef GL_ARB_texture_compression
568 mHasCompressedTextures = TRUE; 568 mHasCompressedTextures = TRUE;
569# else 569# else
570 mHasCompressedTextures = FALSE; 570 mHasCompressedTextures = FALSE;
571# endif 571# endif
572# if GL_ARB_vertex_buffer_object 572# ifdef GL_ARB_vertex_buffer_object
573 mHasVertexBufferObject = TRUE; 573 mHasVertexBufferObject = TRUE;
574# else 574# else
575 mHasVertexBufferObject = FALSE; 575 mHasVertexBufferObject = FALSE;
576# endif 576# endif
577# if GL_EXT_framebuffer_object 577# ifdef GL_EXT_framebuffer_object
578 mHasFramebufferObject = TRUE; 578 mHasFramebufferObject = TRUE;
579# else 579# else
580 mHasFramebufferObject = FALSE; 580 mHasFramebufferObject = FALSE;
581# endif 581# endif
582# if GL_EXT_framebuffer_multisample 582# ifdef GL_EXT_framebuffer_multisample
583 mHasFramebufferMultisample = TRUE; 583 mHasFramebufferMultisample = TRUE;
584# else 584# else
585 mHasFramebufferMultisample = FALSE; 585 mHasFramebufferMultisample = FALSE;
586# endif 586# endif
587# if GL_ARB_draw_buffers 587# ifdef GL_ARB_draw_buffers
588 mHasDrawBuffers = TRUE; 588 mHasDrawBuffers = TRUE;
589#else 589#else
590 mHasDrawBuffers = FALSE; 590 mHasDrawBuffers = FALSE;
591# endif 591# endif
592# if defined(GL_NV_depth_clamp) || defined(GL_ARB_depth_clamp)
593 mHasDepthClamp = TRUE;
594#else
595 mHasDepthClamp = FALSE;
596#endif
592 mHasMipMapGeneration = FALSE; 597 mHasMipMapGeneration = FALSE;
593 mHasSeparateSpecularColor = FALSE; 598 mHasSeparateSpecularColor = FALSE;
594 mHasAnisotropic = FALSE; 599 mHasAnisotropic = FALSE;
@@ -614,6 +619,7 @@ void LLGLManager::initExtensions()
614 && ExtensionExists("GL_EXT_packed_depth_stencil", gGLHExts.mSysExts); 619 && ExtensionExists("GL_EXT_packed_depth_stencil", gGLHExts.mSysExts);
615 mHasFramebufferMultisample = mHasFramebufferObject && ExtensionExists("GL_EXT_framebuffer_multisample", gGLHExts.mSysExts); 620 mHasFramebufferMultisample = mHasFramebufferObject && ExtensionExists("GL_EXT_framebuffer_multisample", gGLHExts.mSysExts);
616 mHasDrawBuffers = ExtensionExists("GL_ARB_draw_buffers", gGLHExts.mSysExts); 621 mHasDrawBuffers = ExtensionExists("GL_ARB_draw_buffers", gGLHExts.mSysExts);
622 mHasDepthClamp = ExtensionExists("GL_ARB_depth_clamp", gGLHExts.mSysExts) || ExtensionExists("GL_NV_depth_clamp", gGLHExts.mSysExts);
617#if !LL_DARWIN 623#if !LL_DARWIN
618 mHasPointParameters = !mIsATI && ExtensionExists("GL_ARB_point_parameters", gGLHExts.mSysExts); 624 mHasPointParameters = !mIsATI && ExtensionExists("GL_ARB_point_parameters", gGLHExts.mSysExts);
619#endif 625#endif
@@ -636,6 +642,7 @@ void LLGLManager::initExtensions()
636 mHasFramebufferObject = FALSE; 642 mHasFramebufferObject = FALSE;
637 mHasFramebufferMultisample = FALSE; 643 mHasFramebufferMultisample = FALSE;
638 mHasDrawBuffers = FALSE; 644 mHasDrawBuffers = FALSE;
645 mHasDepthClamp = FALSE;
639 mHasMipMapGeneration = FALSE; 646 mHasMipMapGeneration = FALSE;
640 mHasSeparateSpecularColor = FALSE; 647 mHasSeparateSpecularColor = FALSE;
641 mHasAnisotropic = FALSE; 648 mHasAnisotropic = FALSE;
@@ -687,10 +694,11 @@ void LLGLManager::initExtensions()
687 if (strchr(blacklist,'q')) mHasFramebufferObject = FALSE;//S 694 if (strchr(blacklist,'q')) mHasFramebufferObject = FALSE;//S
688 if (strchr(blacklist,'r')) mHasDrawBuffers = FALSE;//S 695 if (strchr(blacklist,'r')) mHasDrawBuffers = FALSE;//S
689 if (strchr(blacklist,'s')) mHasFramebufferMultisample = FALSE; 696 if (strchr(blacklist,'s')) mHasFramebufferMultisample = FALSE;
697 if (strchr(blacklist,'t')) mHasDepthClamp = FALSE;
690 698
691 } 699 }
692#endif // LL_LINUX || LL_SOLARIS 700#endif // LL_LINUX || LL_SOLARIS
693 701
694 if (!mHasMultitexture) 702 if (!mHasMultitexture)
695 { 703 {
696 LL_INFOS("RenderInit") << "Couldn't initialize multitexturing" << LL_ENDL; 704 LL_INFOS("RenderInit") << "Couldn't initialize multitexturing" << LL_ENDL;
@@ -1775,7 +1783,7 @@ LLGLDepthTest::~LLGLDepthTest()
1775 } 1783 }
1776} 1784}
1777 1785
1778LLGLClampToFarClip::LLGLClampToFarClip(glh::matrix4f P) 1786LLGLSquashToFarClip::LLGLSquashToFarClip(glh::matrix4f P)
1779{ 1787{
1780 for (U32 i = 0; i < 4; i++) 1788 for (U32 i = 0; i < 4; i++)
1781 { 1789 {
@@ -1788,7 +1796,7 @@ LLGLClampToFarClip::LLGLClampToFarClip(glh::matrix4f P)
1788 glMatrixMode(GL_MODELVIEW); 1796 glMatrixMode(GL_MODELVIEW);
1789} 1797}
1790 1798
1791LLGLClampToFarClip::~LLGLClampToFarClip() 1799LLGLSquashToFarClip::~LLGLSquashToFarClip()
1792{ 1800{
1793 glMatrixMode(GL_PROJECTION); 1801 glMatrixMode(GL_PROJECTION);
1794 glPopMatrix(); 1802 glPopMatrix();
diff --git a/linden/indra/llrender/llgl.h b/linden/indra/llrender/llgl.h
index 88552ce..90642b3 100644
--- a/linden/indra/llrender/llgl.h
+++ b/linden/indra/llrender/llgl.h
@@ -88,6 +88,7 @@ public:
88 BOOL mHasOcclusionQuery; 88 BOOL mHasOcclusionQuery;
89 BOOL mHasPointParameters; 89 BOOL mHasPointParameters;
90 BOOL mHasDrawBuffers; 90 BOOL mHasDrawBuffers;
91 BOOL mHasDepthClamp;
91 92
92 // Other extensions. 93 // Other extensions.
93 BOOL mHasAnisotropic; 94 BOOL mHasAnisotropic;
@@ -306,11 +307,11 @@ private:
306 leaves this class. 307 leaves this class.
307 Does not stack. 308 Does not stack.
308*/ 309*/
309class LLGLClampToFarClip 310class LLGLSquashToFarClip
310{ 311{
311public: 312public:
312 LLGLClampToFarClip(glh::matrix4f projection); 313 LLGLSquashToFarClip(glh::matrix4f projection);
313 ~LLGLClampToFarClip(); 314 ~LLGLSquashToFarClip();
314}; 315};
315 316
316/* 317/*
diff --git a/linden/indra/llrender/llglheaders.h b/linden/indra/llrender/llglheaders.h
index c7178a5..9e3ae9d 100644
--- a/linden/indra/llrender/llglheaders.h
+++ b/linden/indra/llrender/llglheaders.h
@@ -819,5 +819,15 @@ extern void glGetBufferPointervARB (GLenum, GLenum, GLvoid* *);
819 819
820#endif // LL_MESA / LL_WINDOWS / LL_DARWIN 820#endif // LL_MESA / LL_WINDOWS / LL_DARWIN
821 821
822// Even when GL_ARB_depth_clamp is available in the driver, the (correct)
823// headers, and therefore GL_DEPTH_CLAMP might not be defined.
824// In that case GL_DEPTH_CLAMP_NV should be defined, but why not just
825// use the known numeric.
826//
827// To avoid #ifdef's in the code. Just define this here.
828#ifndef GL_DEPTH_CLAMP
829// Probably (still) called GL_DEPTH_CLAMP_NV.
830#define GL_DEPTH_CLAMP 0x864F
831#endif
822 832
823#endif // LL_LLGLHEADERS_H 833#endif // LL_LLGLHEADERS_H