Fission FSN
Loading...
Searching...
No Matches
fsCVertexStreamTextSpriteRenderData.h
Go to the documentation of this file.
1/********************************************************************
2*
3* File: fsCVertexStreamTextSpriteRenderData.h
4*
5* Purpose: Cocos2d-x implementation of the text render data.
6*
7*********************************************************************/
8
9#ifndef fsCVertexStreamTextSpriteRenderDatahdr
10#define fsCVertexStreamTextSpriteRenderDatahdr
11
12#include <2d/CCLabel.h>
13#include <renderer/CCTextureAtlas.h>
14
16
17class fsVec2d;
18
19
21{
23
24public:
25
26 void implRender() override;
27
28 fsS32 stringWidthInPixelsGet() const override;
29
31
32protected:
33
36
37 void dirtyTextProcessDo(const fsAffineMtx2d& pRenderMatrix, const fsRect& pFormattingRect,
38 const fsStr& pText) override;
39 void matrixApplyDo(const fsAffineMtx2d& pRenderMatrix) override;
40
41private:
42
43 void rawVertSet(fsS32 currVert, fsS32 x, fsS32 y, fsS32 w, fsS32 h);
44 void lineHorizontalOffset(fsS32 pLineStart, fsS32 pLineEnd, fsS32 pOffset);
45 void hardWrap(fsS32 pLineStart, fsS32 pLineEnd, fsS32 pOffset);
46 void softWrap(fsS32 pLineStart, fsS32& pLineEnd, fsS32& pCurrVert, fsS32 pX);
47
48 void verticalJustify(fsS32 pLineCount);
49
50 void quadsUpdate();
51
52 void rawVertBufferStore(const fsRect& pFormattingRect);
53
54 cocos2d::TextureAtlas* mTextureAtlas;
55 fsS32 mPixelWidth;
56
57 //#ifdef fsPCStore
58 // std::u16string mU16Str;
59 //#else
60 std::u32string mU16Str;
61 //#endif
62
63
64 void pipelineSetup();
65 void blendDescriptorSetup(cocos2d::PipelineDescriptor& pipelineDescriptor);
66
67 cocos2d::QuadCommand _quadCommand;
68 cocos2d::backend::UniformLocation _textureLocation;
69 cocos2d::backend::UniformLocation _textColorLocation;
70 cocos2d::backend::UniformLocation _mvpMatrixLocation;
71
72 cocos2d::backend::ProgramState* _programState;
73 cocos2d::BlendFunc _blendFunc;
74
75 fsF32 _globalZOrder;
76};
77
78#endif
Definition fsAffineMtx2d.h:27
Definition fsCVertexStreamTextSpriteRenderData-v3.h:21
static fsIRenderData * create()
friend class fsCRenderDataFactoryVertexStream
Definition fsCVertexStreamTextSpriteRenderData-v3.h:22
fsS32 stringWidthInPixelsGet() const override
void dirtyTextProcessDo(const fsAffineMtx2d &pRenderMatrix, const fsRect &pFormattingRect, const fsStr &pText) override
void matrixApplyDo(const fsAffineMtx2d &pRenderMatrix) override
fsIRenderData()=default
Definition fsITextRenderData.h:19
Definition fsRect.h:16
Definition fsStr.h:23
int fsS32
Definition fsBaseTypes.h:20
float fsF32
Definition fsBaseTypes.h:28
Definition fsVec2d.h:16