Page 1 of 1

CEGUI east language display optimized arithmetic

Posted: Wed Sep 20, 2006 07:33
by HyperIris
I'm sorry, make you long wait and my poor English.

Here is the CEGUI east language display optimized arithmetic. I don't know why I cann't access Mantis tracker

(http://mantis.cegui.org.uk/), so I decided post it here.

1. In class Texture (CEGUITexture.h) add:

Code: Select all

public:
virtual void updateFromMemory(int xOffset, int yOffset, int subWidth, int subHeight, void const *pData) = 0;


2. In class DirectX9Texture (d3d9texture.h) add

Code: Select all

public:
/*!
   \brief
   update an subimage in memory into the texture.

   \param xOffset
   the point x of the texture for update area

   \param xOffset
   the point y of the texture for update area

   \param subWidth
   the width of subimage

   \param subHeight
   the height of subimage

   \param pData
   the buffer (in 0xAARRGGBB pixels)

   \return
   Nothing.
   */
   virtual void   updateFromMemory(int xOffset, int yOffset, int subWidth, int subHeight, void const *pData);


then, in (d3d9texture.cpp) implement it.

if you use OpenGL, please implement it by yourself because I don't know how to do it.

Posted: Wed Sep 20, 2006 07:51
by HyperIris
3. Modify Font classes.

We need a 512x512 cache texture, and we init it at Font class.

Posted: Wed Sep 20, 2006 07:59
by HyperIris
4. In CEGUIFreeTypeFont.h add:

Code: Select all

public:
   virtual void rasterize (utf32 codepoint);


In CEGUIFreeTypeFont.cpp, we need implemen this override rasterize function.

when rasterize, we use MRU help us to update the texture.

Posted: Wed Sep 20, 2006 08:29
by HyperIris
5 The MRU class.

We are nearly the end point, but here is the mru table problem.

MRU records all commited codepoints and the their priorities
For example, when codepoint A commit to that MRU table, MRU tries find whether it already in table, if so, codepoint's priorities--, or find space in table and insert it to there, and it has init priority 0, if no space left, MRU find which codepoint's priority is the biggest and kick it out. then all codepoint's priorities++.

Due to some reason I can't give you the mru implement, here is the interface of it.

Code: Select all

class MRU 
{
public:
   void Commit(unsigned short* pString, int nCount, unsigned short* pPositions, unsigned short* pNewItems, int& nNumNewItem);
   void Clear();
   bool Init(int nMaxItemNum); //Size of mru table
   MRU();
   virtual ~MRU();
};

Posted: Thu Sep 21, 2006 14:45
by HyperIris
Due to some reason I decided delete the implement code.
I feel shame, but I have not choice.

Forgive me, I have no choice.

Posted: Fri Sep 22, 2006 03:55
by cutenoob
HOHO ,, It's OK ,,whatever , you make a TODO list :lol: :lol:

Relax man,,It's doesn't a shame thing :wink: :wink: but it's a pity