/********************************************************************
*
* File: fsCVertexStreamTextSpriteRenderData.h
*
* Purpose: Cocos2d-x implementation of the text render data.
*
*********************************************************************/
#ifndef fsCVertexStreamTextSpriteRenderDatahdr
#define fsCVertexStreamTextSpriteRenderDatahdr
#include <2d/CCLabel.h>
#include <renderer/CCTextureAtlas.h>
#include "../../../fsITextRenderData.h"
class fsVec2d;
class fsCVertexStreamTextSpriteRenderData : public fsITextRenderData
{
friend class fsCRenderDataFactoryVertexStream;
public:
void implRender() override;
fsS32 stringWidthInPixelsGet() const override;
virtual ~fsCVertexStreamTextSpriteRenderData() = default;<--- Destructor in derived class
protected:
static fsIRenderData* create();
fsCVertexStreamTextSpriteRenderData();
void dirtyTextProcessDo(const fsAffineMtx2d& pRenderMatrix, const fsRect& pFormattingRect, const fsStr& pText) override;
void matrixApplyDo(const fsAffineMtx2d& pRenderMatrix) override;
private:
void rawVertSet(fsS32 currVert, fsS32 x, fsS32 y, fsS32 w, fsS32 h);
void lineHorizontalOffset(fsS32 pLineStart, fsS32 pLineEnd, fsS32 pOffset);
void hardWrap(fsS32 pLineStart, fsS32 pLineEnd, fsS32 pOffset);
void softWrap(fsS32 pLineStart, fsS32& pLineEnd, fsS32& pCurrVert, fsS32 pX);
void verticalJustify(fsS32 pLineCount);
void quadsUpdate();
void rawVertBufferStore(const fsRect& pFormattingRect);
cocos2d::TextureAtlas* mTextureAtlas;
fsS32 mPixelWidth;
//#ifdef fsPCStore
// std::u16string mU16Str;
//#else
std::u32string mU16Str;
//#endif
};
#endif