mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@83 385bec56-5757-e545-9c3a-d8741f4650f1
56 lines
1.7 KiB
C++
56 lines
1.7 KiB
C++
/*---------------------------------------------------------------------------*
|
|
Project: Horizon
|
|
File: scrollBuffer.h
|
|
|
|
Copyright (C)2009 Nintendo Co., Ltd. All rights reserved.
|
|
|
|
These coded instructions, statements, and computer programs contain
|
|
proprietary information of Nintendo of America Inc. and/or Nintendo
|
|
Company Ltd., and are protected by Federal copyright law. They may
|
|
not be disclosed to third parties or copied or duplicated in any form,
|
|
in whole or in part, without the prior written consent of Nintendo.
|
|
|
|
$Rev$
|
|
*---------------------------------------------------------------------------*/
|
|
|
|
#ifndef SCROLL_BUFFER_H_
|
|
#define SCROLL_BUFFER_H_
|
|
|
|
#include "demo.h"
|
|
class ScrollBuffer
|
|
{
|
|
private:
|
|
enum
|
|
{
|
|
MAX_BUFFER_LINE=128,
|
|
MAX_BUFFER_CHARS=80,
|
|
MAX_DISPLAY_LINES=20,
|
|
FONT_SIZE=12
|
|
};
|
|
// 表示文字のバッファ (リングバッファ)
|
|
static char s_buffers[MAX_BUFFER_LINE][MAX_BUFFER_CHARS];
|
|
int m_head;
|
|
int m_tail;
|
|
int m_currentView;
|
|
|
|
demo::RenderSystemDrawing *m_render;
|
|
|
|
char *GetFormattedString(const char *fmt, va_list arg);
|
|
|
|
public:
|
|
ScrollBuffer() :
|
|
m_head(0), m_tail(0), m_currentView(0)
|
|
{}
|
|
void Initialize(demo::RenderSystemDrawing *render)
|
|
{
|
|
m_render=render;
|
|
}
|
|
|
|
ScrollBuffer *Update(); // キー入力を参照して、スクロールする
|
|
ScrollBuffer *AppendText(const char *fmt, ...); // 文字列を追加する
|
|
ScrollBuffer *ReplaceText(const char *fmt, ...); // 最新の文字列を置換する
|
|
void Render(); // レンダリング
|
|
};
|
|
|
|
#endif // SCROLL_BUFFER_H
|