2016-03-19 00:07:31 +00:00
|
|
|
#ifndef __URDE_CTEXTEXECUTEBUFFER_HPP__
|
|
|
|
#define __URDE_CTEXTEXECUTEBUFFER_HPP__
|
|
|
|
|
|
|
|
#include "CSaveableState.hpp"
|
|
|
|
#include "CGuiTextSupport.hpp"
|
|
|
|
#include <list>
|
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
|
|
|
class CInstruction;
|
|
|
|
class CFontImageDef;
|
2016-03-19 03:58:01 +00:00
|
|
|
class CTextRenderBuffer;
|
|
|
|
class CBlockInstruction;
|
|
|
|
class CLineInstruction;
|
2016-03-19 00:07:31 +00:00
|
|
|
|
|
|
|
class CTextExecuteBuffer
|
|
|
|
{
|
2016-03-21 22:01:19 +00:00
|
|
|
friend class CGuiTextSupport;
|
|
|
|
|
2016-03-19 03:58:01 +00:00
|
|
|
std::list<std::shared_ptr<CInstruction>> x0_instList;
|
2016-03-19 00:07:31 +00:00
|
|
|
u32 x14_ = 0;
|
2016-03-20 00:32:30 +00:00
|
|
|
CSaveableState x18_textState;
|
2016-03-19 03:58:01 +00:00
|
|
|
CBlockInstruction* x6c_curBlock = nullptr;
|
|
|
|
CLineInstruction* x70_curLine = nullptr;
|
2016-03-20 00:32:30 +00:00
|
|
|
std::list<std::shared_ptr<CInstruction>>::iterator x74_curWordIt;
|
|
|
|
s32 x78_curY;
|
|
|
|
s32 x7c_curX;
|
|
|
|
s32 x80_ = 0;
|
|
|
|
s32 x84_ = 0;
|
|
|
|
s32 x88_spaceDistance = 0;
|
|
|
|
std::vector<CSaveableState> x8c_stateStack;
|
2016-03-19 00:07:31 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
CTextExecuteBuffer()
|
|
|
|
{
|
2016-03-20 00:32:30 +00:00
|
|
|
x74_curWordIt = x0_instList.begin();
|
2016-03-19 00:07:31 +00:00
|
|
|
}
|
|
|
|
|
2016-03-19 03:58:01 +00:00
|
|
|
CTextRenderBuffer CreateTextRenderBuffer() const;
|
2016-03-20 00:32:30 +00:00
|
|
|
std::vector<CToken> GetAssets() const;
|
2016-03-20 06:37:08 +00:00
|
|
|
void AddString(const wchar_t* str, int len);
|
|
|
|
void AddStringFragment(const wchar_t* str, int len);
|
|
|
|
int WrapOneLTR(const wchar_t* str, int len);
|
2016-03-19 00:07:31 +00:00
|
|
|
void MoveWordLTR();
|
|
|
|
void StartNewLine();
|
|
|
|
void StartNewWord();
|
|
|
|
void TerminateLine();
|
|
|
|
void TerminateLineLTR();
|
|
|
|
void AddPopState();
|
|
|
|
void AddPushState();
|
2016-03-20 06:37:08 +00:00
|
|
|
void AddVerticalJustification(EVerticalJustification vjust);
|
|
|
|
void AddJustification(EJustification just);
|
2016-03-20 00:32:30 +00:00
|
|
|
void AddLineExtraSpace(s32 space);
|
2016-03-20 06:37:08 +00:00
|
|
|
void AddLineSpacing(float spacing);
|
|
|
|
void AddRemoveColorOverride(int idx);
|
|
|
|
void AddColorOverride(int idx, const CTextColor& color);
|
2016-03-19 00:07:31 +00:00
|
|
|
void AddColor(EColorType, const CTextColor& color);
|
|
|
|
void AddImage(const CFontImageDef& image);
|
2016-03-21 00:25:53 +00:00
|
|
|
void AddFont(const TToken<CRasterFont>& font);
|
2016-03-19 00:07:31 +00:00
|
|
|
void EndBlock();
|
2016-03-20 06:37:08 +00:00
|
|
|
void BeginBlock(s32 offX, s32 offY, s32 padX, s32 padY,
|
|
|
|
ETextDirection dir, EJustification just,
|
|
|
|
EVerticalJustification vjust);
|
2016-03-19 00:07:31 +00:00
|
|
|
void Clear();
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __URDE_CTEXTEXECUTEBUFFER_HPP__
|