SAGA2: Rename enums in dispnode.h and document.h

This commit is contained in:
Eugene Sandulenko 2022-10-27 14:17:57 +02:00
parent 2d903d39dc
commit 32b75a6524
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
4 changed files with 40 additions and 40 deletions

View File

@ -112,7 +112,7 @@ void DisplayNodeList::init(uint16 s) {
_displayList[i]._efx = nullptr;
_displayList[i]._nextDisplayed = nullptr;
_displayList[i]._object = nullptr;
_displayList[i]._type = nodeTypeObject;
_displayList[i]._type = kNodeTypeObject;
}
}
//-----------------------------------------------------------------------
@ -123,7 +123,7 @@ DisplayNode::DisplayNode() {
_sortDepth = 0;
_object = nullptr;
_flags = 0; // various flags
_type = nodeTypeObject;
_type = kNodeTypeObject;
_efx = nullptr;
}
@ -172,7 +172,7 @@ void DisplayNodeList::draw() {
}
for (dn = DisplayNodeList::_head; dn; dn = dn->_nextDisplayed) {
if (dn->_type == nodeTypeEffect)
if (dn->_type == kNodeTypeEffect)
dn->drawEffect();
else
dn->drawObject();
@ -291,13 +291,13 @@ void DisplayNodeList::buildObjects(bool fromScratch) {
dn->_nextDisplayed = nullptr;
dn->_object = ob;
dn->_type = nodeTypeObject;
dn->_type = kNodeTypeObject;
dn->_flags = 0;
if (centerActorIndicatorEnabled
&& isActor(dn->_object)
&& ((Actor *)dn->_object) == centerActor)
dn->_flags |= DisplayNode::displayIndicator;
dn->_flags |= DisplayNode::kDisplayIndicator;
// Various test data
// dn->spriteFrame = 0;
@ -789,7 +789,7 @@ void DisplayNode::drawObject() {
_hitBox.width = bodySprite->size.x;
_hitBox.height = bodySprite->size.y;
if (_flags & displayIndicator) {
if (_flags & kDisplayIndicator) {
Point16 indicatorCoords;
gPixelMap &indicator = *mouseCursors[kMouseCenterActorIndicatorImage];
@ -814,7 +814,7 @@ ObjectID pickObject(const StaticPoint32 &mouse, StaticTilePoint &objPos) {
error("Object sprites have been dumped!");
for (dn = DisplayNodeList::_head; dn; dn = dn->_nextDisplayed) {
if (dn->_type == nodeTypeObject) {
if (dn->_type == kNodeTypeObject) {
GameObject *obj = dn->_object;
if (obj->parent() == currentWorld && dn->_hitBox.ptInside(mouse.x, mouse.y)) {
@ -907,7 +907,7 @@ void DisplayNodeList::buildEffects(bool) {
if (_displayList[i]._efx->isHidden() || _displayList[i]._efx->isDead())
continue;
// make sure it knows it's not a real object
_displayList[i]._type = nodeTypeEffect;
_displayList[i]._type = kNodeTypeEffect;
_displayList[i]._sortDepth = _displayList[i]._efx->_screenCoords.y + _displayList[i]._efx->_current.z / 2;
if (dn) {

View File

@ -38,8 +38,8 @@ struct StaticTilePoint;
class Effectron;
enum nodeType {
nodeTypeObject = 0,
nodeTypeEffect
kNodeTypeObject = 0,
kNodeTypeEffect
};
@ -58,7 +58,7 @@ private:
uint8 _flags; // various flags
enum {
displayIndicator = (1 << 0)
kDisplayIndicator = (1 << 0)
};
public:

View File

@ -69,7 +69,7 @@ static uint8 scrollTextColors[] = { 65, 65, 65, 65, 65, 65, 65, 66, 66, 67, 67,
CDocumentAppearance scrollAppearance = {
{202, 54, 236, 317},
1,
pageOrientVertical,
kPageOrientVertical,
scrollTextColors,
{ {50, 64, 131, 169}, {0, 0, 0, 0} },
{184, 206, 44, 42},
@ -95,7 +95,7 @@ static uint8 bookTextColors[] = { 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65
CDocumentAppearance bookAppearance = {
{123, 76, 394, 252},
2,
pageOrientHorizontal,
kPageOrientHorizontal,
bookTextColors,
{ {40, 26, 135, 205}, {218, 26, 135, 205} },
{231, 217, 34, 27},
@ -117,7 +117,7 @@ static StaticWindow parchDecorations[] = {
CDocumentAppearance parchAppearance = {
{202, 54, 208, 256},
1,
pageOrientVertical,
kPageOrientVertical,
bookTextColors,
{ {27, 18, 149, 212}, {0, 0, 0, 0} },
{164, 229, 20, 20},
@ -152,7 +152,7 @@ CDocument::CDocument(CDocumentAppearance &dApp,
_illustrationCon = nullptr;
// set the maxium string length
_maxSize = maxPages * maxLines * maxChars;
_maxSize = kMaxPages * kMaxLines * kMaxChars;
// get the org text size
_textSize = clamp(0, strlen(buffer), _maxSize);
@ -179,7 +179,7 @@ CDocument::CDocument(CDocumentAppearance &dApp,
_pageBreakSet = true;
// null out the image pointer array
for (int16 i = 0; i < maxPages; i++) {
for (int16 i = 0; i < kMaxPages; i++) {
_images[i] = nullptr;
}
@ -200,7 +200,7 @@ CDocument::CDocument(CDocumentAppearance &dApp,
CDocument::~CDocument() {
int16 i;
for (i = 0; i < maxPages; i++) {
for (i = 0; i < kMaxPages; i++) {
if (_images[i]) {
free(_images[i]);
}
@ -279,7 +279,7 @@ void CDocument::pointerMove(gPanelMessage &msg) {
Point16 pos = msg._pickPos;
if (msg._inPanel && Rect16(0, 0, _extent.width, _extent.height).ptInside(pos)) {
if (_app.orientation == pageOrientVertical) {
if (_app.orientation == kPageOrientVertical) {
// find out which end of the book we're on
if (pos.y < _extent.height / 2) setMouseImage(kMousePgUpImage, -7, -7);
else setMouseImage(kMousePgDownImage, -7, -7);
@ -306,7 +306,7 @@ bool CDocument::pointerHit(gPanelMessage &msg) {
if (msg._inPanel && Rect16(0, 0, _extent.width, _extent.height).ptInside(pos)) {
gEvent ev;
if (_app.orientation == pageOrientVertical) {
if (_app.orientation == kPageOrientVertical) {
// find out which end of the book we're on
if (pos.y < _extent.height / 2) cmdDocumentUp(ev); //gotoPage( _currentPage - _app.numPages );
else cmdDocumentDn(ev); //gotoPage( _currentPage + _app.numPages );
@ -336,7 +336,7 @@ bool CDocument::pointerHit(gPanelMessage &msg) {
}
void CDocument::gotoPage(int8 page) {
page = clamp(0, page, maxPages);
page = clamp(0, page, kMaxPages);
while (page % _app.numPages) page++;
@ -407,7 +407,7 @@ bool CDocument::checkForImage(char *string,
_illustrationCon = resFile->newContext(MKTAG(argv[0], argv[1], argv[2], argv[3]),
"book internal resources");
// set image for next page
if (offPageIndex < maxPages) {
if (offPageIndex < kMaxPages) {
// if the last entry is defined as a number
if (argv[7] == ':') {
// convert the text into a number
@ -447,7 +447,7 @@ bool CDocument::checkForImage(char *string,
// set the line offset
_lineOffset[offPageIndex] =
_imageSizes[offPageIndex].y / (_textHeight + 1) +
textPictureOffset;
kTextPictureOffset;
} else {
warning("CDocument: Document overflow");
}
@ -475,7 +475,7 @@ void CDocument::makePages() {
bool newPage = false;
while (offset >= 0 && pageIndex < maxPages) {
while (offset >= 0 && pageIndex < kMaxPages) {
while (offset >= 0 &&
lineIndex < linesPerPage &&
!newPage) {
@ -585,7 +585,7 @@ void CDocument::renderText() {
for (; lineIndex < _numLines[pageIndex]; lineIndex++) {
int16 temp = _lineLen[pageIndex][lineIndex];
assert(pageIndex < maxPages);
assert(pageIndex < kMaxPages);
assert(temp < 35);
str += _lineLen[pageIndex][lineIndex];
@ -613,7 +613,7 @@ void CDocument::renderText() {
}
for (; lineIndex < _numLines[pageIndex]; lineIndex++) {
assert(pageIndex <= maxPages);
assert(pageIndex <= kMaxPages);
tPort.moveTo(pageRect->x, pageRect->y + (_textHeight * lineIndex) + 1);
tPort.setColor(_app.textColors[lineIndex]);

View File

@ -45,15 +45,15 @@ const uint32 bookGroupID = MKTAG('B', 'O', 'O', 'K');
const int maxVisiblePages = 2;
enum {
pageLeft = 0,
pageRight,
pageUp,
pageDown
kPageLeft = 0,
kPageRight,
kPageUp,
kPageDown
};
enum pageOrientation {
pageOrientVertical = 0,
pageOrientHorizontal
kPageOrientVertical = 0,
kPageOrientHorizontal
};
struct CDocumentAppearance {
@ -78,10 +78,10 @@ class CDocument : public ModalWindow {
private:
enum {
maxPages = 32,
maxLines = 32,
maxChars = 32,
textPictureOffset = 1
kMaxPages = 32,
kMaxLines = 32,
kMaxChars = 32,
kTextPictureOffset = 1
};
struct ImageHeader {
@ -93,7 +93,7 @@ private:
CDocumentAppearance &_app;
// image poiner array
void *_images[maxPages];
void *_images[kMaxPages];
uint16 _currentPage,
_lineWidth,
@ -104,10 +104,10 @@ private:
gFont *_textFont;
uint16 _textHeight;
uint16 _pages;
uint16 _numLines[maxPages];
uint16 _lineLen[maxPages][maxLines];
uint16 _lineOffset[maxPages];
Extent16 _imageSizes[maxPages];
uint16 _numLines[kMaxPages];
uint16 _lineLen[kMaxPages][kMaxLines];
uint16 _lineOffset[kMaxPages];
Extent16 _imageSizes[kMaxPages];
bool _pageBreakSet;
char *_scan; // for parsing book text.