SAGA2: Fix global constructors in document.cpp

This commit is contained in:
a/ 2021-06-30 08:32:20 +09:00 committed by Eugene Sandulenko
parent b02941237d
commit 654964aad0
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
2 changed files with 41 additions and 70 deletions

View File

@ -65,19 +65,18 @@ static StaticWindow scrollDecorations[] = {
static uint8 scrollTextColors[] = { 65, 65, 65, 65, 65, 65, 65, 66, 66, 67, 67, 67, 67, 66, 66, 66 };
CDocumentAppearance scrollAppearance(
Rect16(202, 54, 236, 317), // Window size
1,
pageOrientVertical,
scrollTextColors,
Rect16(50, 64, 131, 169), // Page 1
Rect16(0, 0, 0, 0), // (No page 2)
Rect16(184, 206, 44, 42), // Close button rect
scrollDecorations,
ARRAYSIZE(scrollDecorations),
MKTAG('S', 'C', 'R', 'L'),
MKTAG('S', 'R', 'L', 0)
);
CDocumentAppearance scrollAppearance = {
{202, 54, 236, 317},
1,
pageOrientVertical,
scrollTextColors,
{ {50, 64, 131, 169}, {0, 0, 0, 0} },
{184, 206, 44, 42},
scrollDecorations,
ARRAYSIZE(scrollDecorations),
MKTAG('S', 'C', 'R', 'L'),
MKTAG('S', 'R', 'L', 0)
};
/* ===================================================================== *
Book metrics
@ -92,19 +91,18 @@ static StaticWindow bookDecorations[] = {
static uint8 bookTextColors[] = { 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65 };
CDocumentAppearance bookAppearance(
Rect16(123, 76, 394, 252), // Window size
2,
pageOrientHorizontal,
bookTextColors,
Rect16(40, 26, 135, 205), // Page 1
Rect16(218, 26, 135, 205), // Page 2
Rect16(231, 217, 34, 27), // Close button rect
bookDecorations,
ARRAYSIZE(bookDecorations),
MKTAG('B', 'O', 'O', 'K'),
MKTAG('B', 'K', 'D', 0)
);
CDocumentAppearance bookAppearance = {
{123, 76, 394, 252},
2,
pageOrientHorizontal,
bookTextColors,
{ {40, 26, 135, 205}, {218, 26, 135, 205} },
{231, 217, 34, 27},
bookDecorations,
ARRAYSIZE(bookDecorations),
MKTAG('B', 'O', 'O', 'K'),
MKTAG('B', 'K', 'D', 0)
};
/* ===================================================================== *
Parchment metrics
@ -115,19 +113,18 @@ static StaticWindow parchDecorations[] = {
{{202, 54, 208, 256}, nullptr, 0}
};
CDocumentAppearance parchAppearance(
Rect16(202, 54, 208, 256), // Window size
1,
pageOrientVertical,
bookTextColors,
Rect16(27, 18, 149, 212), // Page 1
Rect16(0, 0, 0, 0), // (No page 2)
Rect16(164, 229, 20, 20), // Close button rect
parchDecorations,
ARRAYSIZE(parchDecorations),
MKTAG('P', 'A', 'R', 'C'),
MKTAG('P', 'C', 'H', 0)
);
CDocumentAppearance parchAppearance = {
{202, 54, 208, 256},
1,
pageOrientVertical,
bookTextColors,
{ {27, 18, 149, 212}, {0, 0, 0, 0} },
{64, 229, 20, 20},
parchDecorations,
ARRAYSIZE(parchDecorations),
MKTAG('P', 'A', 'R', 'C'),
MKTAG('P', 'C', 'H', 0)
};
// deliminator defines
char deliminator = '@';
@ -773,7 +770,7 @@ void CDocument::renderText(void) {
for (pageIndex = currentPage;
pageIndex - currentPage < app.numPages && pageIndex < pages;
pageIndex++) {
Rect16 *pageRect = &app.pageRect[pageIndex % app.numPages];
StaticRect *pageRect = &app.pageRect[pageIndex % app.numPages];
// if there is an image on this page
if (images[pageIndex]) {

View File

@ -57,43 +57,17 @@ enum pageOrientation {
pageOrientHorizontal
};
class CDocumentAppearance {
public:
Rect16 windowPos; // Position of window on screen
struct CDocumentAppearance {
StaticRect windowPos; // Position of window on screen
int16 numPages; // Number of visible pages
int16 orientation; // Orientation of pages
uint8 *textColors; // Text color array
Rect16 pageRect[maxVisiblePages];// Array of visible page rects
Rect16 closeRect; // Close-box rectangle
StaticRect pageRect[maxVisiblePages];// Array of visible page rects
StaticRect closeRect; // Close-box rectangle
StaticWindow *decoList; // List of decorator panels
int16 numDecos; // Number of decorator panels
hResID groupID; // Resource ID for decoration group
hResID decoID; // Resource ID for decorations
CDocumentAppearance(
Rect16 _windowPos,
int16 _numPages,
int16 _orientation,
uint8 *_textColors,
Rect16 _pageRect_0,
Rect16 _pageRect_1,
Rect16 _closeRect,
StaticWindow *_decoList,
int16 _numDecos,
hResID _groupID,
hResID _decoID)
: windowPos(_windowPos),
numPages(_numPages),
orientation(_orientation),
textColors(_textColors),
closeRect(_closeRect),
decoList(_decoList),
numDecos(_numDecos),
groupID(_groupID),
decoID(_decoID) {
pageRect[0] = _pageRect_0;
pageRect[1] = _pageRect_1;
}
};
// Base class for scrolls, books, and parchments