From 0ea5fc66924303d1bf73ba283a383e2aadee02f2 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sat, 11 Aug 2018 20:21:34 +0200 Subject: Initial commit --- docs/doxygen/nel/a03483.html | 2437 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2437 insertions(+) create mode 100644 docs/doxygen/nel/a03483.html (limited to 'docs/doxygen/nel/a03483.html') diff --git a/docs/doxygen/nel/a03483.html b/docs/doxygen/nel/a03483.html new file mode 100644 index 00000000..7ea27e23 --- /dev/null +++ b/docs/doxygen/nel/a03483.html @@ -0,0 +1,2437 @@ + + +NeL: NL3D::CTextContext class Reference + + + +
+

NL3D::CTextContext Class Reference

#include <text_context.h> +

+


Detailed Description

+CTextContext

+

Author:
Stephane Coutelas

+Nevrax France

+
Date:
2000
+ +

+ +

+Definition at line 44 of file text_context.h. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

void clear ()
 Clear the cache.

void computeString (const ucstring &s, CComputedString &output)
void computeString (const std::string &s, CComputedString &output)
void computeStringInfo (const ucstring &s, CComputedString &output)
 CTextContext ()
void dumpCache (const char *filename)
 Debug : write to the disk the texture cache.

void erase (uint32 index)
 remove a string from the cache

NLMISC::CRGBA getColor () const
CComputedStringgetComputedString (uint32 index)
NL3D::CFontGeneratorgetFontGenerator ()
CFontManagergetFontManager () const
uint32 getFontSize () const
CComputedString::THotSpot getHotSpot () const
bool getKeep800x600Ratio () const
float getScaleX () const
float getScaleZ () const
NLMISC::CRGBA getShadeColor () const
bool getShaded () const
void init (IDriver *drv, CFontManager *fmg)
 set the driver.

CComputedStringoperator[] (uint32 index)
 Get computed string from index.

void printAt (float x, float z, const ucstring &ucstr)
 Directly print a string.

void printAt (float x, float z, uint32 index)
void printClipAt (CRenderStringBuffer &rdrBuffer, float x, float z, uint32 index, float xmin, float ymin, float xmax, float ymax)
void printClipAtUnProjected (CRenderStringBuffer &renderBuffer, class NL3D::CFrustum &frustum, const NLMISC::CMatrix &scaleMatrix, float x, float y, float depth, uint32 index, float xmin, float ymin, float xmax, float ymax)
void printfAt (float x, float z, const char *format,...)
 Directly print a string.

void setColor (NLMISC::CRGBA color)
void setFontGenerator (const std::string fontFileName, const std::string fontExFileName="")
 Must be called before any print.

void setFontSize (uint32 fontSize)
void setHotSpot (CComputedString::THotSpot hotSpot)
void setKeep800x600Ratio (bool keep)
void setScaleX (float scaleX)
void setScaleZ (float scaleZ)
void setShadeColor (NLMISC::CRGBA color)
void setShaded (bool b)
void setShadeExtent (float shext)
uint32 textPush (const ucstring &str)
 computes an ucstring and adds the result to the cache (return the index)

uint32 textPush (const char *format,...)
 compute and add a string to the cache (return the index)

 ~CTextContext ()
 Destructor.


Private Attributes

std::vector< uint32_CacheFreePlaces
uint32 _CacheNbFreePlaces
std::vector< CComputedString_CacheStrings
 Cache to manipulate strings with indexes.

NLMISC::CRGBA _Color
 Current text color.

IDriver_Driver
 Driver.

NL3D::CFontGenerator_FontGen
 Font generator.

NL3D::CFontManager_FontManager
 Font manager.

uint32 _FontSize
 Font size;.

CComputedString::THotSpot _HotSpot
 Hotspot.

bool _Keep800x600Ratio
 resize the font to keep the same aspect ratio than in 800x600

float _ScaleX
 X scale.

float _ScaleZ
 Z scale.

NLMISC::CRGBA _ShadeColor
 Shade color (default is black).

bool _Shaded
 true if text is shaded

float _ShadeExtent
 shade's extent (shadow size)

CComputedString _TempString
+


Constructor & Destructor Documentation

+

+ + + + +
+ + + + + + + + + +
NL3D::CTextContext::CTextContext  ) 
+
+ + + + + +
+   + + +

+Constructor defaults : fontsize=12, color=(0,0,0,255), hotspot=bottomleft, scale=1, shaded=false, shadeExtent=0.001f shadecolor=(0,0,0,255), 800x600ratio=true +

+Definition at line 36 of file text_context.cpp. +

+References _CacheNbFreePlaces, _FontGen, _FontSize, _Keep800x600Ratio, _ScaleX, _ScaleZ, _ShadeColor, _Shaded, and _ShadeExtent. +

+

00037 {
+00038         _Driver = NULL;
+00039         _FontManager = NULL;
+00040         _FontGen = NULL;
+00041 
+00042         _FontSize = 12;
+00043 
+00044         _Color = NLMISC::CRGBA(0,0,0);
+00045 
+00046         _HotSpot = CComputedString::BottomLeft;
+00047 
+00048         _ScaleX = 1.0f;
+00049         _ScaleZ = 1.0f;
+00050 
+00051         _Shaded = false;
+00052         _ShadeExtent = 0.001f;  
+00053         _ShadeColor = NLMISC::CRGBA(0,0,0);
+00054 
+00055         _Keep800x600Ratio= true;
+00056 
+00057         _CacheNbFreePlaces = 0;
+00058 }
+
+

+ + + + +
+ + + + + + + + + +
NL3D::CTextContext::~CTextContext  ) 
+
+ + + + + +
+   + + +

+Destructor. +

+ +

+Definition at line 61 of file text_context.cpp. +

+References _FontGen. +

+

00062 {
+00063         if (_FontGen)
+00064                 delete _FontGen;
+00065 }
+
+


Member Function Documentation

+

+ + + + +
+ + + + + + + + + +
void NL3D::CTextContext::clear  ) 
+
+ + + + + +
+   + + +

+Clear the cache. +

+ +

+Definition at line 140 of file text_context.cpp. +

+References _CacheFreePlaces, _CacheNbFreePlaces, and _CacheStrings. +

+Referenced by NL3D::CTextContextUser::clear(). +

+

00141 {
+00142         _CacheFreePlaces.clear();
+00143         _CacheNbFreePlaces = 0;
+00144         _CacheStrings.clear();
+00145 }
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void NL3D::CTextContext::computeString const ucstring s,
CComputedString output
[inline]
+
+ + + + + +
+   + + +

+Compute a ucstring as primitive blocks using the font manager's method computeString

Parameters:
+ + + +
an ucstring
the computed string
+
+ +

+Definition at line 274 of file text_context.h. +

+References _FontGen, _FontSize, _Keep800x600Ratio, NL3D::CFontManager::computeString(), and s. +

+

00275         {
+00276                 _FontManager->computeString (s, _FontGen, _Color, _FontSize, _Driver, output, _Keep800x600Ratio);
+00277         }
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void NL3D::CTextContext::computeString const std::string &  s,
CComputedString output
[inline]
+
+ + + + + +
+   + + +

+Compute a string as primitive blocks using the font manager's method computeString

Parameters:
+ + + +
a string
the computed string
+
+ +

+Definition at line 263 of file text_context.h. +

+References _FontGen, _FontSize, _Keep800x600Ratio, NL3D::CFontManager::computeString(), and s. +

+Referenced by NL3D::CTextContextUser::render3D(). +

+

00264         {
+00265                 _FontManager->computeString (s, _FontGen, _Color, _FontSize, _Driver, output, _Keep800x600Ratio);
+00266         }
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void NL3D::CTextContext::computeStringInfo const ucstring s,
CComputedString output
[inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 279 of file text_context.h. +

+References _FontGen, _FontSize, _Keep800x600Ratio, NL3D::CFontManager::computeStringInfo(), and s. +

+Referenced by NL3D::CTextContextUser::getStringInfo(). +

+

00280         {
+00281                 _FontManager->computeStringInfo (s, _FontGen, _Color, _FontSize, _Driver, output, _Keep800x600Ratio);
+00282         }
+
+

+ + + + +
+ + + + + + + + + + +
void NL3D::CTextContext::dumpCache const char *  filename  )  [inline]
+
+ + + + + +
+   + + +

+Debug : write to the disk the texture cache. +

+ +

+Definition at line 285 of file text_context.h. +

+References NL3D::CFontManager::dumpCache(). +

+Referenced by NL3D::CTextContextUser::dumpCacheTexture(). +

+

00286         {
+00287                 _FontManager->dumpCache (filename);
+00288         }
+
+

+ + + + +
+ + + + + + + + + + +
void NL3D::CTextContext::erase uint32  index  ) 
+
+ + + + + +
+   + + +

+remove a string from the cache +

+ +

+Definition at line 125 of file text_context.cpp. +

+References _CacheFreePlaces, _CacheNbFreePlaces, and uint32. +

+Referenced by NL3D::CTextContextUser::erase(). +

+

00126 {
+00127         if (_CacheFreePlaces.size() == _CacheNbFreePlaces)
+00128         {
+00129                 _CacheFreePlaces.push_back (i);
+00130         }
+00131         else
+00132         {
+00133                 _CacheFreePlaces[_CacheNbFreePlaces] = i;
+00134         }
+00135         _CacheNbFreePlaces++;
+00136 }
+
+

+ + + + +
+ + + + + + + + + + +
NLMISC::CRGBA NL3D::CTextContext::getColor void   )  const [inline]
+
+ + + + + +
+   + + +

+Accessors GET +

+Definition at line 105 of file text_context.h. +

+

00105 { return _Color; }
+
+

+ + + + +
+ + + + + + + + + + +
CComputedString* NL3D::CTextContext::getComputedString uint32  index  )  [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 248 of file text_context.h. +

+References _CacheStrings, index, and uint32. +

+Referenced by NL3D::CTextContextUser::getStringInfo(), NL3D::CTextContextUser::resetStringSelection(), NL3D::CTextContextUser::setStringColor(), and NL3D::CTextContextUser::setStringSelection(). +

+

00249         {
+00250                 if (index < _CacheStrings.size())
+00251                         return &_CacheStrings[index];
+00252                 else
+00253                         return NULL;
+00254         }
+
+

+ + + + +
+ + + + + + + + + + +
NL3D::CFontGenerator* NL3D::CTextContext::getFontGenerator void   )  [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 75 of file text_context.h. +

+References _FontGen. +

+

00075 { return _FontGen; }
+
+

+ + + + +
+ + + + + + + + + + +
CFontManager* NL3D::CTextContext::getFontManager void   )  const [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 71 of file text_context.h. +

+Referenced by NL3D::CTextContextUser::flushRenderBuffer(), and NL3D::CTextContextUser::flushRenderBufferUnProjected(). +

+

00071 {return _FontManager;}
+
+

+ + + + +
+ + + + + + + + + +
uint32 NL3D::CTextContext::getFontSize  )  const [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 107 of file text_context.h. +

+References _FontSize, and uint32. +

+Referenced by NL3D::CTextContextUser::getFontSize(). +

+

00107 { return _FontSize; }
+
+

+ + + + +
+ + + + + + + + + +
CComputedString::THotSpot NL3D::CTextContext::getHotSpot  )  const [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 109 of file text_context.h. +

+Referenced by NL3D::CTextContextUser::getHotSpot(). +

+

00109 { return _HotSpot; }
+
+

+ + + + +
+ + + + + + + + + +
bool NL3D::CTextContext::getKeep800x600Ratio  )  const [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 117 of file text_context.h. +

+References _Keep800x600Ratio. +

+Referenced by NL3D::CTextContextUser::getKeep800x600Ratio(). +

+

00117 {return _Keep800x600Ratio;}
+
+

+ + + + +
+ + + + + + + + + +
float NL3D::CTextContext::getScaleX  )  const [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 111 of file text_context.h. +

+References _ScaleX. +

+Referenced by NL3D::CTextContextUser::getScaleX(). +

+

00111 { return _ScaleX; }
+
+

+ + + + +
+ + + + + + + + + +
float NL3D::CTextContext::getScaleZ  )  const [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 113 of file text_context.h. +

+References _ScaleZ. +

+Referenced by NL3D::CTextContextUser::getScaleY(). +

+

00113 { return _ScaleZ; }
+
+

+ + + + +
+ + + + + + + + + +
NLMISC::CRGBA NL3D::CTextContext::getShadeColor  )  const [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 119 of file text_context.h. +

+References _ShadeColor. +

+Referenced by NL3D::CTextContextUser::getShadeColor(). +

+

00119 { return _ShadeColor; }
+
+

+ + + + +
+ + + + + + + + + +
bool NL3D::CTextContext::getShaded  )  const [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 115 of file text_context.h. +

+References _Shaded. +

+Referenced by NL3D::CTextContextUser::getShaded(). +

+

00115 { return _Shaded; }
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void NL3D::CTextContext::init IDriver drv,
CFontManager fmg
[inline]
+
+ + + + + +
+   + + +

+set the driver. +

+Inits +

+Definition at line 63 of file text_context.h. +

+References nlassert. +

+Referenced by NL3D::CTextContextUser::CTextContextUser(). +

+

00064         {
+00065                 nlassert(drv && fmg);
+00066                 _Driver= drv;
+00067                 _FontManager= fmg;
+00068         }
+
+

+ + + + +
+ + + + + + + + + + +
CComputedString& NL3D::CTextContext::operator[] uint32  index  )  [inline]
+
+ + + + + +
+   + + +

+Get computed string from index. +

+ +

+Definition at line 242 of file text_context.h. +

+References _CacheStrings, index, nlassert, and uint32. +

+

00243         {
+00244                 nlassert (index < _CacheStrings.size());
+00245                 return _CacheStrings[index];
+00246         }
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
void NL3D::CTextContext::printAt float  x,
float  z,
const ucstring ucstr
[inline]
+
+ + + + + +
+   + + +

+Directly print a string. +

+ +

+Definition at line 196 of file text_context.h. +

+References _FontGen, _FontSize, _Keep800x600Ratio, _ScaleX, _ScaleZ, _ShadeColor, _Shaded, _ShadeExtent, _TempString, NLMISC::CRGBA::A, NL3D::CComputedString::Color, NL3D::CFontManager::computeString(), nlassert, NL3D::CComputedString::render2D(), x, and z. +

+

00197         {
+00198                 nlassert(_FontGen);
+00199 
+00200                 // compute the string just one time
+00201                 _FontManager->computeString (ucstr, _FontGen, _Color, _FontSize, _Driver, _TempString, _Keep800x600Ratio);
+00202 
+00203                 // draw shaded
+00204                 if(_Shaded)
+00205                 {
+00206                         CRGBA   bkup = _TempString.Color;
+00207                         _TempString.Color= _ShadeColor;
+00208                         _TempString.Color.A = bkup.A;
+00209                         _TempString.render2D (*_Driver,x+_ShadeExtent,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
+00210                         _TempString.Color= bkup;
+00211                 }
+00212 
+00213                 // draw
+00214                 _TempString.render2D (*_Driver, x, z, _HotSpot, _ScaleX, _ScaleZ);
+00215         }
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
void NL3D::CTextContext::printAt float  x,
float  z,
uint32  index
[inline]
+
+ + + + + +
+   + + +

+Print a string that is in the cache from its index (it leaves the string in the cache) z : if the hotspot is bottom z is the position of the line of the string, not the bottom of the string bounding box ! +

+Definition at line 144 of file text_context.h. +

+References _CacheStrings, _ScaleX, _ScaleZ, _ShadeColor, _Shaded, _ShadeExtent, NLMISC::CRGBA::A, NL3D::CComputedString::Color, index, nlassert, NL3D::CComputedString::render2D(), uint32, x, and z. +

+Referenced by NL3D::CTextContextUser::printAt(), and NL3D::CTextContextUser::printfAt(). +

+

00145         {
+00146                 nlassert (index < _CacheStrings.size());
+00147                 CComputedString &rCS = _CacheStrings[index];
+00148                 if(_Shaded)
+00149                 {
+00150                         CRGBA   bkup = rCS.Color;
+00151                         rCS.Color = _ShadeColor;
+00152                         rCS.Color.A = bkup.A;
+00153                         rCS.render2D (*_Driver, x+_ShadeExtent, z-_ShadeExtent, _HotSpot, _ScaleX, _ScaleZ);
+00154                         rCS.Color= bkup;
+00155                 }
+00156                 rCS.render2D (*_Driver, x, z, _HotSpot, _ScaleX, _ScaleZ);
+00157         }
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void NL3D::CTextContext::printClipAt CRenderStringBuffer rdrBuffer,
float  x,
float  z,
uint32  index,
float  xmin,
float  ymin,
float  xmax,
float  ymax
[inline]
+
+ + + + + +
+   + + +

+Clip and print a string that is in the cache (it leaves the string in the cache) z : if the hotspot is bottom z is the position of the line of the string, not the bottom of the string bounding box ! +

+Definition at line 162 of file text_context.h. +

+References _CacheStrings, _ShadeColor, _Shaded, _ShadeExtent, NLMISC::CRGBA::A, NL3D::CComputedString::Color, index, nlassert, NL3D::CComputedString::render2DClip(), uint32, x, and z. +

+Referenced by NL3D::CTextContextUser::printClipAt(). +

+

00163         {
+00164                 nlassert (index < _CacheStrings.size());
+00165                 CComputedString &rCS = _CacheStrings[index];
+00166                 if(_Shaded)
+00167                 {
+00168                         CRGBA   bkup = rCS.Color;
+00169                         rCS.Color= _ShadeColor;
+00170                         rCS.Color.A = bkup.A;
+00171                         rCS.render2DClip(*_Driver, rdrBuffer, x+_ShadeExtent, z-_ShadeExtent, xmin, ymin, xmax, ymax);
+00172                         rCS.Color= bkup;
+00173                 }
+00174                 rCS.render2DClip (*_Driver, rdrBuffer, x, z, xmin, ymin, xmax, ymax);
+00175         }
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void NL3D::CTextContext::printClipAtUnProjected CRenderStringBuffer renderBuffer,
class NL3D::CFrustum frustum,
const NLMISC::CMatrix scaleMatrix,
float  x,
float  y,
float  depth,
uint32  index,
float  xmin,
float  ymin,
float  xmax,
float  ymax
[inline]
+
+ + + + + +
+   + + +

+Clip and print a string that is in the cache (it leaves the string in the cache) z : if the hotspot is bottom z is the position of the line of the string, not the bottom of the string bounding box ! +

+Definition at line 180 of file text_context.h. +

+References _CacheStrings, _ShadeColor, _Shaded, _ShadeExtent, NLMISC::CRGBA::A, NL3D::CComputedString::Color, depth, index, nlassert, NL3D::CComputedString::render2DUnProjected(), uint32, x, and y. +

+Referenced by NL3D::CTextContextUser::printClipAtUnProjected(). +

+

00181         {
+00182                 nlassert (index < _CacheStrings.size());
+00183                 CComputedString &rCS = _CacheStrings[index];
+00184                 if(_Shaded)
+00185                 {
+00186                         CRGBA   bkup = rCS.Color;
+00187                         rCS.Color= _ShadeColor;
+00188                         rCS.Color.A = bkup.A;
+00189                         rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x+_ShadeExtent, y-_ShadeExtent, depth, xmin, ymin, xmax, ymax);
+00190                         rCS.Color= bkup;
+00191                 }
+00192                 rCS.render2DUnProjected (*_Driver, renderBuffer, frustum, scaleMatrix, x, y, depth, xmin, ymin, xmax, ymax);
+00193         }
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void NL3D::CTextContext::printfAt float  x,
float  z,
const char *  format,
... 
[inline]
+
+ + + + + +
+   + + +

+Directly print a string. +

+ +

+Definition at line 218 of file text_context.h. +

+References _FontGen, _FontSize, _Keep800x600Ratio, _ScaleX, _ScaleZ, _ShadeColor, _Shaded, _ShadeExtent, _TempString, NLMISC::CRGBA::A, NL3D::CComputedString::Color, NL3D::CFontManager::computeString(), format, nlassert, NLMISC_CONVERT_VARGS, NL3D::CComputedString::render2D(), x, and z. +

+

00219         {
+00220                 nlassert(_FontGen);
+00221 
+00222                 // compute the string just one time
+00223                 char *str;
+00224                 NLMISC_CONVERT_VARGS (str, format, NLMISC::MaxCStringSize);
+00225                 _FontManager->computeString (str, _FontGen, _Color, _FontSize, _Driver, _TempString, _Keep800x600Ratio);
+00226 
+00227                 // draw shaded
+00228                 if(_Shaded)
+00229                 {
+00230                         CRGBA   bkup = _TempString.Color;
+00231                         _TempString.Color = _ShadeColor;
+00232                         _TempString.Color.A = bkup.A;
+00233                         _TempString.render2D (*_Driver,x+_ShadeExtent,z-_ShadeExtent,_HotSpot,_ScaleX,_ScaleZ);
+00234                         _TempString.Color= bkup;
+00235                 }
+00236 
+00237                 // draw
+00238                 _TempString.render2D (*_Driver, x, z, _HotSpot, _ScaleX, _ScaleZ);
+00239         }
+
+

+ + + + +
+ + + + + + + + + + +
void NL3D::CTextContext::setColor NLMISC::CRGBA  color  )  [inline]
+
+ + + + + +
+   + + +

+Accessors SET +

+Definition at line 81 of file text_context.h. +

+Referenced by NL3D::CTextContextUser::setColor(). +

+

00081 { _Color = color; }
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void NL3D::CTextContext::setFontGenerator const std::string  fontFileName,
const std::string  fontExFileName = ""
+
+ + + + + +
+   + + +

+Must be called before any print. +

+ +

+Definition at line 149 of file text_context.cpp. +

+References _FontGen. +

+Referenced by NL3D::CTextContextUser::CTextContextUser(). +

+

00150 {
+00151         _FontGen = new NL3D::CFontGenerator(fontFileName, fontExFileName);
+00152 }
+
+

+ + + + +
+ + + + + + + + + + +
void NL3D::CTextContext::setFontSize uint32  fontSize  )  [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 83 of file text_context.h. +

+References _FontSize, and uint32. +

+Referenced by NL3D::CTextContextUser::setFontSize(). +

+

00083 { _FontSize = fontSize; }
+
+

+ + + + +
+ + + + + + + + + + +
void NL3D::CTextContext::setHotSpot CComputedString::THotSpot  hotSpot  )  [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 85 of file text_context.h. +

+Referenced by NL3D::CTextContextUser::setHotSpot(). +

+

00085 { _HotSpot = hotSpot; }
+
+

+ + + + +
+ + + + + + + + + + +
void NL3D::CTextContext::setKeep800x600Ratio bool  keep  )  [inline]
+
+ + + + + +
+   + + +

+If true the CFontManager look at Driver window size, and resize fontSize to keep the same size than if it was in 800x600... +

+Definition at line 99 of file text_context.h. +

+References _Keep800x600Ratio. +

+Referenced by NL3D::CTextContextUser::setKeep800x600Ratio(). +

+

00099 { _Keep800x600Ratio = keep; }
+
+

+ + + + +
+ + + + + + + + + + +
void NL3D::CTextContext::setScaleX float  scaleX  )  [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 87 of file text_context.h. +

+References _ScaleX. +

+Referenced by NL3D::CTextContextUser::setScaleX(). +

+

00087 { _ScaleX = scaleX; }
+
+

+ + + + +
+ + + + + + + + + + +
void NL3D::CTextContext::setScaleZ float  scaleZ  )  [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 89 of file text_context.h. +

+References _ScaleZ. +

+Referenced by NL3D::CTextContextUser::setScaleY(). +

+

00089 { _ScaleZ = scaleZ; }
+
+

+ + + + +
+ + + + + + + + + + +
void NL3D::CTextContext::setShadeColor NLMISC::CRGBA  color  )  [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 95 of file text_context.h. +

+References _ShadeColor. +

+Referenced by NL3D::CTextContextUser::setShadeColor(). +

+

00095 { _ShadeColor = color; }
+
+

+ + + + +
+ + + + + + + + + + +
void NL3D::CTextContext::setShaded bool  b  )  [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 91 of file text_context.h. +

+References _Shaded. +

+Referenced by NL3D::CTextContextUser::setShaded(). +

+

00091 { _Shaded = b; }
+
+

+ + + + +
+ + + + + + + + + + +
void NL3D::CTextContext::setShadeExtent float  shext  )  [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 93 of file text_context.h. +

+References _ShadeExtent. +

+Referenced by NL3D::CTextContextUser::setShadeExtent(). +

+

00093 { _ShadeExtent = shext; }
+
+

+ + + + +
+ + + + + + + + + + +
uint32 NL3D::CTextContext::textPush const ucstring str  ) 
+
+ + + + + +
+   + + +

+computes an ucstring and adds the result to the cache (return the index) +

+ +

+Definition at line 98 of file text_context.cpp. +

+References _CacheFreePlaces, _CacheNbFreePlaces, _CacheStrings, _FontGen, _FontSize, _Keep800x600Ratio, NL3D::CFontManager::computeString(), index, nlassert, and uint32. +

+

00099 { 
+00100         nlassert(_FontGen);
+00101 
+00102         if (_CacheNbFreePlaces == 0)
+00103         {
+00104                 CComputedString csTmp;
+00105 
+00106                 _CacheStrings.push_back (csTmp);
+00107                 if (_CacheFreePlaces.size() == 0)
+00108                         _CacheFreePlaces.resize (1);
+00109                 _CacheFreePlaces[0] = _CacheStrings.size()-1;
+00110                 _CacheNbFreePlaces = 1;
+00111         }
+00112 
+00113         // compute the string.
+00114         uint32 index = _CacheFreePlaces[_CacheNbFreePlaces-1];
+00115         CComputedString &strToFill = _CacheStrings[index];
+00116         _FontManager->computeString (str, _FontGen, _Color
+00117                 , _FontSize, _Driver, strToFill, _Keep800x600Ratio);
+00118 
+00119         _CacheNbFreePlaces--;
+00120 
+00121         return index;
+00122 }
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
uint32 NL3D::CTextContext::textPush const char *  format,
... 
+
+ + + + + +
+   + + +

+compute and add a string to the cache (return the index) +

+Cache methods +

+Definition at line 68 of file text_context.cpp. +

+References _CacheFreePlaces, _CacheNbFreePlaces, _CacheStrings, _FontGen, _FontSize, _Keep800x600Ratio, NL3D::CFontManager::computeString(), format, index, nlassert, NLMISC_CONVERT_VARGS, and uint32. +

+Referenced by NL3D::CTextContextUser::textPush(). +

+

00069 { 
+00070         nlassert(_FontGen);
+00071 
+00072         // convert the string.
+00073         char *str;
+00074         NLMISC_CONVERT_VARGS (str, format, NLMISC::MaxCStringSize);
+00075 
+00076         if (_CacheNbFreePlaces == 0)
+00077         {
+00078                 CComputedString csTmp;
+00079 
+00080                 _CacheStrings.push_back (csTmp);
+00081                 if (_CacheFreePlaces.size() == 0)
+00082                         _CacheFreePlaces.resize (1);
+00083                 _CacheFreePlaces[0] = _CacheStrings.size()-1;
+00084                 _CacheNbFreePlaces = 1;
+00085         }
+00086 
+00087         // compute the string.
+00088         uint32 index = _CacheFreePlaces[_CacheNbFreePlaces-1];
+00089         CComputedString &strToFill = _CacheStrings[index];
+00090         _FontManager->computeString (str, _FontGen, _Color, _FontSize, _Driver, strToFill, _Keep800x600Ratio);
+00091 
+00092         _CacheNbFreePlaces--;
+00093 
+00094         return index;
+00095 }
+
+


Field Documentation

+

+ + + + +
+ + +
std::vector<uint32> NL3D::CTextContext::_CacheFreePlaces [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 338 of file text_context.h. +

+Referenced by clear(), erase(), and textPush().

+

+ + + + +
+ + +
uint32 NL3D::CTextContext::_CacheNbFreePlaces [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 339 of file text_context.h. +

+Referenced by clear(), CTextContext(), erase(), and textPush().

+

+ + + + +
+ + +
std::vector<CComputedString> NL3D::CTextContext::_CacheStrings [private] +
+
+ + + + + +
+   + + +

+Cache to manipulate strings with indexes. +

+Strings Caches +

+Definition at line 337 of file text_context.h. +

+Referenced by clear(), getComputedString(), operator[](), printAt(), printClipAt(), printClipAtUnProjected(), and textPush().

+

+ + + + +
+ + +
NLMISC::CRGBA NL3D::CTextContext::_Color [private] +
+
+ + + + + +
+   + + +

+Current text color. +

+ +

+Definition at line 309 of file text_context.h.

+

+ + + + +
+ + +
IDriver* NL3D::CTextContext::_Driver [private] +
+
+ + + + + +
+   + + +

+Driver. +

+ +

+Definition at line 293 of file text_context.h.

+

+ + + + +
+ + +
NL3D::CFontGenerator* NL3D::CTextContext::_FontGen [private] +
+
+ + + + + +
+   + + +

+Font generator. +

+ +

+Definition at line 299 of file text_context.h. +

+Referenced by computeString(), computeStringInfo(), CTextContext(), getFontGenerator(), printAt(), printfAt(), setFontGenerator(), textPush(), and ~CTextContext().

+

+ + + + +
+ + +
NL3D::CFontManager* NL3D::CTextContext::_FontManager [private] +
+
+ + + + + +
+   + + +

+Font manager. +

+ +

+Definition at line 296 of file text_context.h.

+

+ + + + +
+ + +
uint32 NL3D::CTextContext::_FontSize [private] +
+
+ + + + + +
+   + + +

+Font size;. +

+Text Style properties +

+Definition at line 306 of file text_context.h. +

+Referenced by computeString(), computeStringInfo(), CTextContext(), getFontSize(), printAt(), printfAt(), setFontSize(), and textPush().

+

+ + + + +
+ + +
CComputedString::THotSpot NL3D::CTextContext::_HotSpot [private] +
+
+ + + + + +
+   + + +

+Hotspot. +

+ +

+Definition at line 312 of file text_context.h.

+

+ + + + +
+ + +
bool NL3D::CTextContext::_Keep800x600Ratio [private] +
+
+ + + + + +
+   + + +

+resize the font to keep the same aspect ratio than in 800x600 +

+ +

+Definition at line 330 of file text_context.h. +

+Referenced by computeString(), computeStringInfo(), CTextContext(), getKeep800x600Ratio(), printAt(), printfAt(), setKeep800x600Ratio(), and textPush().

+

+ + + + +
+ + +
float NL3D::CTextContext::_ScaleX [private] +
+
+ + + + + +
+   + + +

+X scale. +

+ +

+Definition at line 315 of file text_context.h. +

+Referenced by CTextContext(), getScaleX(), printAt(), printfAt(), and setScaleX().

+

+ + + + +
+ + +
float NL3D::CTextContext::_ScaleZ [private] +
+
+ + + + + +
+   + + +

+Z scale. +

+ +

+Definition at line 318 of file text_context.h. +

+Referenced by CTextContext(), getScaleZ(), printAt(), printfAt(), and setScaleZ().

+

+ + + + +
+ + +
NLMISC::CRGBA NL3D::CTextContext::_ShadeColor [private] +
+
+ + + + + +
+   + + +

+Shade color (default is black). +

+ +

+Definition at line 327 of file text_context.h. +

+Referenced by CTextContext(), getShadeColor(), printAt(), printClipAt(), printClipAtUnProjected(), printfAt(), and setShadeColor().

+

+ + + + +
+ + +
bool NL3D::CTextContext::_Shaded [private] +
+
+ + + + + +
+   + + +

+true if text is shaded +

+ +

+Definition at line 321 of file text_context.h. +

+Referenced by CTextContext(), getShaded(), printAt(), printClipAt(), printClipAtUnProjected(), printfAt(), and setShaded().

+

+ + + + +
+ + +
float NL3D::CTextContext::_ShadeExtent [private] +
+
+ + + + + +
+   + + +

+shade's extent (shadow size) +

+ +

+Definition at line 324 of file text_context.h. +

+Referenced by CTextContext(), printAt(), printClipAt(), printClipAtUnProjected(), printfAt(), and setShadeExtent().

+

+ + + + +
+ + +
CComputedString NL3D::CTextContext::_TempString [private] +
+
+ + + + + +
+   + + +

+Cache for for printAt() and printfAt(). This prevents from creating VBdrvinfos each time they are called (N*each frame!!). +

+Definition at line 344 of file text_context.h. +

+Referenced by printAt(), and printfAt().

+


The documentation for this class was generated from the following files: +
Generated on Tue Mar 16 07:49:28 2004 for NeL by + +doxygen +1.3.6
+ + -- cgit v1.2.1