Refactor artLockFrameData with FrmImage
This commit is contained in:
parent
45278f66a5
commit
2e5be31ed4
126
src/pipboy.cc
126
src/pipboy.cc
|
@ -287,9 +287,6 @@ PipboyRenderProc* _PipFnctn[5] = {
|
||||||
pipboyHandleAlarmClock,
|
pipboyHandleAlarmClock,
|
||||||
};
|
};
|
||||||
|
|
||||||
// 0x6642E0
|
|
||||||
Size gPipboyFrmSizes[PIPBOY_FRM_COUNT];
|
|
||||||
|
|
||||||
// 0x664338
|
// 0x664338
|
||||||
MessageListItem gPipboyMessageListItem;
|
MessageListItem gPipboyMessageListItem;
|
||||||
|
|
||||||
|
@ -312,9 +309,6 @@ int gPipboyQuestLocationsCount;
|
||||||
// 0x66441C
|
// 0x66441C
|
||||||
unsigned char* gPipboyWindowBuffer;
|
unsigned char* gPipboyWindowBuffer;
|
||||||
|
|
||||||
// 0x664420
|
|
||||||
unsigned char* gPipboyFrmData[PIPBOY_FRM_COUNT];
|
|
||||||
|
|
||||||
// 0x66444C
|
// 0x66444C
|
||||||
int gPipboyWindowHolodisksCount;
|
int gPipboyWindowHolodisksCount;
|
||||||
|
|
||||||
|
@ -347,9 +341,6 @@ int gPipboyPreviousMouseY;
|
||||||
// 0x6644C4
|
// 0x6644C4
|
||||||
int gPipboyWindow;
|
int gPipboyWindow;
|
||||||
|
|
||||||
// 0x6644C8
|
|
||||||
CacheEntry* gPipboyFrmHandles[PIPBOY_FRM_COUNT];
|
|
||||||
|
|
||||||
// 0x6644F4
|
// 0x6644F4
|
||||||
int _holodisk;
|
int _holodisk;
|
||||||
|
|
||||||
|
@ -400,6 +391,8 @@ unsigned char _stat_flag;
|
||||||
|
|
||||||
static int gPipboyPrevTab;
|
static int gPipboyPrevTab;
|
||||||
|
|
||||||
|
static FrmImage _pipboyFrmImages[PIPBOY_FRM_COUNT];
|
||||||
|
|
||||||
// 0x497004
|
// 0x497004
|
||||||
int pipboyOpen(int intent)
|
int pipboyOpen(int intent)
|
||||||
{
|
{
|
||||||
|
@ -525,8 +518,7 @@ static int pipboyWindowInit(int intent)
|
||||||
int index;
|
int index;
|
||||||
for (index = 0; index < PIPBOY_FRM_COUNT; index++) {
|
for (index = 0; index < PIPBOY_FRM_COUNT; index++) {
|
||||||
int fid = buildFid(OBJ_TYPE_INTERFACE, gPipboyFrmIds[index], 0, 0, 0);
|
int fid = buildFid(OBJ_TYPE_INTERFACE, gPipboyFrmIds[index], 0, 0, 0);
|
||||||
gPipboyFrmData[index] = artLockFrameDataReturningSize(fid, &(gPipboyFrmHandles[index]), &(gPipboyFrmSizes[index].width), &(gPipboyFrmSizes[index].height));
|
if (!_pipboyFrmImages[index].lock(fid)) {
|
||||||
if (gPipboyFrmData[index] == NULL) {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -535,7 +527,7 @@ static int pipboyWindowInit(int intent)
|
||||||
debugPrint("\n** Error loading pipboy graphics! **\n");
|
debugPrint("\n** Error loading pipboy graphics! **\n");
|
||||||
|
|
||||||
while (--index >= 0) {
|
while (--index >= 0) {
|
||||||
artUnlock(gPipboyFrmHandles[index]);
|
_pipboyFrmImages[index].unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -547,13 +539,13 @@ static int pipboyWindowInit(int intent)
|
||||||
if (gPipboyWindow == -1) {
|
if (gPipboyWindow == -1) {
|
||||||
debugPrint("\n** Error opening pipboy window! **\n");
|
debugPrint("\n** Error opening pipboy window! **\n");
|
||||||
for (int index = 0; index < PIPBOY_FRM_COUNT; index++) {
|
for (int index = 0; index < PIPBOY_FRM_COUNT; index++) {
|
||||||
artUnlock(gPipboyFrmHandles[index]);
|
_pipboyFrmImages[index].unlock();
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
gPipboyWindowBuffer = windowGetBuffer(gPipboyWindow);
|
gPipboyWindowBuffer = windowGetBuffer(gPipboyWindow);
|
||||||
memcpy(gPipboyWindowBuffer, gPipboyFrmData[PIPBOY_FRM_BACKGROUND], PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_HEIGHT);
|
memcpy(gPipboyWindowBuffer, _pipboyFrmImages[PIPBOY_FRM_BACKGROUND].getData(), PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_HEIGHT);
|
||||||
|
|
||||||
pipboyDrawNumber(gameTimeGetHour(), 4, PIPBOY_WINDOW_TIME_X, PIPBOY_WINDOW_TIME_Y);
|
pipboyDrawNumber(gameTimeGetHour(), 4, PIPBOY_WINDOW_TIME_X, PIPBOY_WINDOW_TIME_Y);
|
||||||
pipboyDrawDate();
|
pipboyDrawDate();
|
||||||
|
@ -561,14 +553,14 @@ static int pipboyWindowInit(int intent)
|
||||||
int alarmButton = buttonCreate(gPipboyWindow,
|
int alarmButton = buttonCreate(gPipboyWindow,
|
||||||
124,
|
124,
|
||||||
13,
|
13,
|
||||||
gPipboyFrmSizes[PIPBOY_FRM_ALARM_UP].width,
|
_pipboyFrmImages[PIPBOY_FRM_ALARM_UP].getWidth(),
|
||||||
gPipboyFrmSizes[PIPBOY_FRM_ALARM_UP].height,
|
_pipboyFrmImages[PIPBOY_FRM_ALARM_UP].getHeight(),
|
||||||
-1,
|
-1,
|
||||||
-1,
|
-1,
|
||||||
-1,
|
-1,
|
||||||
504,
|
504,
|
||||||
gPipboyFrmData[PIPBOY_FRM_ALARM_UP],
|
_pipboyFrmImages[PIPBOY_FRM_ALARM_UP].getData(),
|
||||||
gPipboyFrmData[PIPBOY_FRM_ALARM_DOWN],
|
_pipboyFrmImages[PIPBOY_FRM_ALARM_DOWN].getData(),
|
||||||
NULL,
|
NULL,
|
||||||
BUTTON_FLAG_TRANSPARENT);
|
BUTTON_FLAG_TRANSPARENT);
|
||||||
if (alarmButton != -1) {
|
if (alarmButton != -1) {
|
||||||
|
@ -582,14 +574,14 @@ static int pipboyWindowInit(int intent)
|
||||||
int btn = buttonCreate(gPipboyWindow,
|
int btn = buttonCreate(gPipboyWindow,
|
||||||
53,
|
53,
|
||||||
y,
|
y,
|
||||||
gPipboyFrmSizes[PIPBOY_FRM_LITTLE_RED_BUTTON_UP].width,
|
_pipboyFrmImages[PIPBOY_FRM_LITTLE_RED_BUTTON_UP].getWidth(),
|
||||||
gPipboyFrmSizes[PIPBOY_FRM_LITTLE_RED_BUTTON_UP].height,
|
_pipboyFrmImages[PIPBOY_FRM_LITTLE_RED_BUTTON_UP].getHeight(),
|
||||||
-1,
|
-1,
|
||||||
-1,
|
-1,
|
||||||
-1,
|
-1,
|
||||||
eventCode,
|
eventCode,
|
||||||
gPipboyFrmData[PIPBOY_FRM_LITTLE_RED_BUTTON_UP],
|
_pipboyFrmImages[PIPBOY_FRM_LITTLE_RED_BUTTON_UP].getData(),
|
||||||
gPipboyFrmData[PIPBOY_FRM_LITTLE_RED_BUTTON_DOWN],
|
_pipboyFrmImages[PIPBOY_FRM_LITTLE_RED_BUTTON_DOWN].getData(),
|
||||||
NULL,
|
NULL,
|
||||||
BUTTON_FLAG_TRANSPARENT);
|
BUTTON_FLAG_TRANSPARENT);
|
||||||
if (btn != -1) {
|
if (btn != -1) {
|
||||||
|
@ -605,10 +597,10 @@ static int pipboyWindowInit(int intent)
|
||||||
if (intent == PIPBOY_OPEN_INTENT_REST) {
|
if (intent == PIPBOY_OPEN_INTENT_REST) {
|
||||||
if (!_critter_can_obj_dude_rest()) {
|
if (!_critter_can_obj_dude_rest()) {
|
||||||
blitBufferToBufferTrans(
|
blitBufferToBufferTrans(
|
||||||
gPipboyFrmData[PIPBOY_FRM_LOGO],
|
_pipboyFrmImages[PIPBOY_FRM_LOGO].getData(),
|
||||||
gPipboyFrmSizes[PIPBOY_FRM_LOGO].width,
|
_pipboyFrmImages[PIPBOY_FRM_LOGO].getWidth(),
|
||||||
gPipboyFrmSizes[PIPBOY_FRM_LOGO].height,
|
_pipboyFrmImages[PIPBOY_FRM_LOGO].getHeight(),
|
||||||
gPipboyFrmSizes[PIPBOY_FRM_LOGO].width,
|
_pipboyFrmImages[PIPBOY_FRM_LOGO].getWidth(),
|
||||||
gPipboyWindowBuffer + PIPBOY_WINDOW_WIDTH * 156 + 323,
|
gPipboyWindowBuffer + PIPBOY_WINDOW_WIDTH * 156 + 323,
|
||||||
PIPBOY_WINDOW_WIDTH);
|
PIPBOY_WINDOW_WIDTH);
|
||||||
|
|
||||||
|
@ -632,7 +624,7 @@ static int pipboyWindowInit(int intent)
|
||||||
strcpy(holidayNameCopy, holidayName);
|
strcpy(holidayNameCopy, holidayName);
|
||||||
|
|
||||||
int len = fontGetStringWidth(holidayNameCopy);
|
int len = fontGetStringWidth(holidayNameCopy);
|
||||||
fontDrawText(gPipboyWindowBuffer + PIPBOY_WINDOW_WIDTH * (gPipboyFrmSizes[PIPBOY_FRM_LOGO].height + 174) + 6 + gPipboyFrmSizes[PIPBOY_FRM_LOGO].width / 2 + 323 - len / 2,
|
fontDrawText(gPipboyWindowBuffer + PIPBOY_WINDOW_WIDTH * (_pipboyFrmImages[PIPBOY_FRM_LOGO].getHeight() + 174) + 6 + _pipboyFrmImages[PIPBOY_FRM_LOGO].getWidth() / 2 + 323 - len / 2,
|
||||||
holidayNameCopy,
|
holidayNameCopy,
|
||||||
350,
|
350,
|
||||||
PIPBOY_WINDOW_WIDTH,
|
PIPBOY_WINDOW_WIDTH,
|
||||||
|
@ -650,10 +642,10 @@ static int pipboyWindowInit(int intent)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
blitBufferToBufferTrans(
|
blitBufferToBufferTrans(
|
||||||
gPipboyFrmData[PIPBOY_FRM_LOGO],
|
_pipboyFrmImages[PIPBOY_FRM_LOGO].getData(),
|
||||||
gPipboyFrmSizes[PIPBOY_FRM_LOGO].width,
|
_pipboyFrmImages[PIPBOY_FRM_LOGO].getWidth(),
|
||||||
gPipboyFrmSizes[PIPBOY_FRM_LOGO].height,
|
_pipboyFrmImages[PIPBOY_FRM_LOGO].getHeight(),
|
||||||
gPipboyFrmSizes[PIPBOY_FRM_LOGO].width,
|
_pipboyFrmImages[PIPBOY_FRM_LOGO].getWidth(),
|
||||||
gPipboyWindowBuffer + PIPBOY_WINDOW_WIDTH * 156 + 323,
|
gPipboyWindowBuffer + PIPBOY_WINDOW_WIDTH * 156 + 323,
|
||||||
PIPBOY_WINDOW_WIDTH);
|
PIPBOY_WINDOW_WIDTH);
|
||||||
|
|
||||||
|
@ -677,7 +669,7 @@ static int pipboyWindowInit(int intent)
|
||||||
strcpy(holidayNameCopy, holidayName);
|
strcpy(holidayNameCopy, holidayName);
|
||||||
|
|
||||||
int length = fontGetStringWidth(holidayNameCopy);
|
int length = fontGetStringWidth(holidayNameCopy);
|
||||||
fontDrawText(gPipboyWindowBuffer + PIPBOY_WINDOW_WIDTH * (gPipboyFrmSizes[PIPBOY_FRM_LOGO].height + 174) + 6 + gPipboyFrmSizes[PIPBOY_FRM_LOGO].width / 2 + 323 - length / 2,
|
fontDrawText(gPipboyWindowBuffer + PIPBOY_WINDOW_WIDTH * (_pipboyFrmImages[PIPBOY_FRM_LOGO].getHeight() + 174) + 6 + _pipboyFrmImages[PIPBOY_FRM_LOGO].getWidth() / 2 + 323 - length / 2,
|
||||||
holidayNameCopy,
|
holidayNameCopy,
|
||||||
350,
|
350,
|
||||||
PIPBOY_WINDOW_WIDTH,
|
PIPBOY_WINDOW_WIDTH,
|
||||||
|
@ -717,7 +709,7 @@ static void pipboyWindowFree()
|
||||||
holodiskFree();
|
holodiskFree();
|
||||||
|
|
||||||
for (int index = 0; index < PIPBOY_FRM_COUNT; index++) {
|
for (int index = 0; index < PIPBOY_FRM_COUNT; index++) {
|
||||||
artUnlock(gPipboyFrmHandles[index]);
|
_pipboyFrmImages[index].unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
pipboyWindowDestroyButtons();
|
pipboyWindowDestroyButtons();
|
||||||
|
@ -764,7 +756,7 @@ static void pipboyDrawNumber(int value, int digits, int x, int y)
|
||||||
int offset = PIPBOY_WINDOW_WIDTH * y + x + 9 * (digits - 1);
|
int offset = PIPBOY_WINDOW_WIDTH * y + x + 9 * (digits - 1);
|
||||||
|
|
||||||
for (int index = 0; index < digits; index++) {
|
for (int index = 0; index < digits; index++) {
|
||||||
blitBufferToBuffer(gPipboyFrmData[PIPBOY_FRM_NUMBERS] + 9 * (value % 10), 9, 17, 360, gPipboyWindowBuffer + offset, PIPBOY_WINDOW_WIDTH);
|
blitBufferToBuffer(_pipboyFrmImages[PIPBOY_FRM_NUMBERS].getData() + 9 * (value % 10), 9, 17, 360, gPipboyWindowBuffer + offset, PIPBOY_WINDOW_WIDTH);
|
||||||
offset -= 9;
|
offset -= 9;
|
||||||
value /= 10;
|
value /= 10;
|
||||||
}
|
}
|
||||||
|
@ -780,7 +772,7 @@ static void pipboyDrawDate()
|
||||||
gameTimeGetDate(&month, &day, &year);
|
gameTimeGetDate(&month, &day, &year);
|
||||||
pipboyDrawNumber(day, 2, PIPBOY_WINDOW_DAY_X, PIPBOY_WINDOW_DAY_Y);
|
pipboyDrawNumber(day, 2, PIPBOY_WINDOW_DAY_X, PIPBOY_WINDOW_DAY_Y);
|
||||||
|
|
||||||
blitBufferToBuffer(gPipboyFrmData[PIPBOY_FRM_MONTHS] + 435 * (month - 1), 29, 14, 29, gPipboyWindowBuffer + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_MONTH_Y + PIPBOY_WINDOW_MONTH_X, PIPBOY_WINDOW_WIDTH);
|
blitBufferToBuffer(_pipboyFrmImages[PIPBOY_FRM_MONTHS].getData() + 435 * (month - 1), 29, 14, 29, gPipboyWindowBuffer + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_MONTH_Y + PIPBOY_WINDOW_MONTH_X, PIPBOY_WINDOW_WIDTH);
|
||||||
|
|
||||||
pipboyDrawNumber(year, 4, PIPBOY_WINDOW_YEAR_X, PIPBOY_WINDOW_YEAR_Y);
|
pipboyDrawNumber(year, 4, PIPBOY_WINDOW_YEAR_X, PIPBOY_WINDOW_YEAR_Y);
|
||||||
}
|
}
|
||||||
|
@ -828,7 +820,7 @@ static void pipboyDrawBackButton(int color)
|
||||||
gPipboyCurrentLine = gPipboyLinesCount;
|
gPipboyCurrentLine = gPipboyLinesCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
blitBufferToBuffer(gPipboyFrmData[PIPBOY_FRM_BACKGROUND] + PIPBOY_WINDOW_WIDTH * 436 + 254, 350, 20, PIPBOY_WINDOW_WIDTH, gPipboyWindowBuffer + PIPBOY_WINDOW_WIDTH * 436 + 254, PIPBOY_WINDOW_WIDTH);
|
blitBufferToBuffer(_pipboyFrmImages[PIPBOY_FRM_BACKGROUND].getData() + PIPBOY_WINDOW_WIDTH * 436 + 254, 350, 20, PIPBOY_WINDOW_WIDTH, gPipboyWindowBuffer + PIPBOY_WINDOW_WIDTH * 436 + 254, PIPBOY_WINDOW_WIDTH);
|
||||||
|
|
||||||
// BACK
|
// BACK
|
||||||
const char* text = getmsg(&gPipboyMessageList, &gPipboyMessageListItem, 201);
|
const char* text = getmsg(&gPipboyMessageList, &gPipboyMessageListItem, 201);
|
||||||
|
@ -860,7 +852,7 @@ static void pipboyWindowHandleStatus(int a1)
|
||||||
{
|
{
|
||||||
if (a1 == 1024) {
|
if (a1 == 1024) {
|
||||||
pipboyWindowDestroyButtons();
|
pipboyWindowDestroyButtons();
|
||||||
blitBufferToBuffer(gPipboyFrmData[PIPBOY_FRM_BACKGROUND] + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
blitBufferToBuffer(_pipboyFrmImages[PIPBOY_FRM_BACKGROUND].getData() + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
||||||
PIPBOY_WINDOW_WIDTH,
|
PIPBOY_WINDOW_WIDTH,
|
||||||
|
@ -902,7 +894,7 @@ static void pipboyWindowHandleStatus(int a1)
|
||||||
if (_stat_flag == 0 && _holo_flag == 0) {
|
if (_stat_flag == 0 && _holo_flag == 0) {
|
||||||
if (gPipboyQuestLocationsCount != 0 && gPipboyMouseX < 429) {
|
if (gPipboyQuestLocationsCount != 0 && gPipboyMouseX < 429) {
|
||||||
soundPlayFile("ib1p1xx1");
|
soundPlayFile("ib1p1xx1");
|
||||||
blitBufferToBuffer(gPipboyFrmData[PIPBOY_FRM_BACKGROUND] + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
blitBufferToBuffer(_pipboyFrmImages[PIPBOY_FRM_BACKGROUND].getData() + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
||||||
PIPBOY_WINDOW_WIDTH,
|
PIPBOY_WINDOW_WIDTH,
|
||||||
|
@ -930,7 +922,7 @@ static void pipboyWindowHandleStatus(int a1)
|
||||||
}
|
}
|
||||||
_holodisk = index;
|
_holodisk = index;
|
||||||
|
|
||||||
blitBufferToBuffer(gPipboyFrmData[PIPBOY_FRM_BACKGROUND] + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
blitBufferToBuffer(_pipboyFrmImages[PIPBOY_FRM_BACKGROUND].getData() + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
||||||
PIPBOY_WINDOW_WIDTH,
|
PIPBOY_WINDOW_WIDTH,
|
||||||
|
@ -959,7 +951,7 @@ static void pipboyWindowHandleStatus(int a1)
|
||||||
if (gPipboyHolodiskLastPage <= _view_page) {
|
if (gPipboyHolodiskLastPage <= _view_page) {
|
||||||
if (a1 != 1026) {
|
if (a1 != 1026) {
|
||||||
soundPlayFile("ib1p1xx1");
|
soundPlayFile("ib1p1xx1");
|
||||||
blitBufferToBuffer(gPipboyFrmData[PIPBOY_FRM_BACKGROUND] + PIPBOY_WINDOW_WIDTH * 436 + 254, 350, 20, PIPBOY_WINDOW_WIDTH, gPipboyWindowBuffer + PIPBOY_WINDOW_WIDTH * 436 + 254, PIPBOY_WINDOW_WIDTH);
|
blitBufferToBuffer(_pipboyFrmImages[PIPBOY_FRM_BACKGROUND].getData() + PIPBOY_WINDOW_WIDTH * 436 + 254, 350, 20, PIPBOY_WINDOW_WIDTH, gPipboyWindowBuffer + PIPBOY_WINDOW_WIDTH * 436 + 254, PIPBOY_WINDOW_WIDTH);
|
||||||
|
|
||||||
if (gPipboyLinesCount >= 0) {
|
if (gPipboyLinesCount >= 0) {
|
||||||
gPipboyCurrentLine = gPipboyLinesCount;
|
gPipboyCurrentLine = gPipboyLinesCount;
|
||||||
|
@ -983,7 +975,7 @@ static void pipboyWindowHandleStatus(int a1)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
soundPlayFile("ib1p1xx1");
|
soundPlayFile("ib1p1xx1");
|
||||||
blitBufferToBuffer(gPipboyFrmData[PIPBOY_FRM_BACKGROUND] + PIPBOY_WINDOW_WIDTH * 436 + 254, 350, 20, PIPBOY_WINDOW_WIDTH, gPipboyWindowBuffer + PIPBOY_WINDOW_WIDTH * 436 + 254, PIPBOY_WINDOW_WIDTH);
|
blitBufferToBuffer(_pipboyFrmImages[PIPBOY_FRM_BACKGROUND].getData() + PIPBOY_WINDOW_WIDTH * 436 + 254, 350, 20, PIPBOY_WINDOW_WIDTH, gPipboyWindowBuffer + PIPBOY_WINDOW_WIDTH * 436 + 254, PIPBOY_WINDOW_WIDTH);
|
||||||
|
|
||||||
if (gPipboyLinesCount >= 0) {
|
if (gPipboyLinesCount >= 0) {
|
||||||
gPipboyCurrentLine = gPipboyLinesCount;
|
gPipboyCurrentLine = gPipboyLinesCount;
|
||||||
|
@ -1013,7 +1005,7 @@ static void pipboyWindowHandleStatus(int a1)
|
||||||
|
|
||||||
if (a1 == 1027) {
|
if (a1 == 1027) {
|
||||||
soundPlayFile("ib1p1xx1");
|
soundPlayFile("ib1p1xx1");
|
||||||
blitBufferToBuffer(gPipboyFrmData[PIPBOY_FRM_BACKGROUND] + PIPBOY_WINDOW_WIDTH * 436 + 254, 350, 20, PIPBOY_WINDOW_WIDTH, gPipboyWindowBuffer + PIPBOY_WINDOW_WIDTH * 436 + 254, PIPBOY_WINDOW_WIDTH);
|
blitBufferToBuffer(_pipboyFrmImages[PIPBOY_FRM_BACKGROUND].getData() + PIPBOY_WINDOW_WIDTH * 436 + 254, 350, 20, PIPBOY_WINDOW_WIDTH, gPipboyWindowBuffer + PIPBOY_WINDOW_WIDTH * 436 + 254, PIPBOY_WINDOW_WIDTH);
|
||||||
|
|
||||||
if (gPipboyLinesCount >= 0) {
|
if (gPipboyLinesCount >= 0) {
|
||||||
gPipboyCurrentLine = gPipboyLinesCount;
|
gPipboyCurrentLine = gPipboyLinesCount;
|
||||||
|
@ -1046,7 +1038,7 @@ static void pipboyWindowHandleStatus(int a1)
|
||||||
}
|
}
|
||||||
|
|
||||||
soundPlayFile("ib1p1xx1");
|
soundPlayFile("ib1p1xx1");
|
||||||
blitBufferToBuffer(gPipboyFrmData[PIPBOY_FRM_BACKGROUND] + PIPBOY_WINDOW_WIDTH * 436 + 254, 350, 20, PIPBOY_WINDOW_WIDTH, gPipboyWindowBuffer + PIPBOY_WINDOW_WIDTH * 436 + 254, PIPBOY_WINDOW_WIDTH);
|
blitBufferToBuffer(_pipboyFrmImages[PIPBOY_FRM_BACKGROUND].getData() + PIPBOY_WINDOW_WIDTH * 436 + 254, 350, 20, PIPBOY_WINDOW_WIDTH, gPipboyWindowBuffer + PIPBOY_WINDOW_WIDTH * 436 + 254, PIPBOY_WINDOW_WIDTH);
|
||||||
|
|
||||||
if (gPipboyLinesCount >= 0) {
|
if (gPipboyLinesCount >= 0) {
|
||||||
gPipboyCurrentLine = gPipboyLinesCount;
|
gPipboyCurrentLine = gPipboyLinesCount;
|
||||||
|
@ -1115,7 +1107,7 @@ static void pipboyWindowHandleStatus(int a1)
|
||||||
}
|
}
|
||||||
|
|
||||||
pipboyWindowDestroyButtons();
|
pipboyWindowDestroyButtons();
|
||||||
blitBufferToBuffer(gPipboyFrmData[PIPBOY_FRM_BACKGROUND] + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
blitBufferToBuffer(_pipboyFrmImages[PIPBOY_FRM_BACKGROUND].getData() + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
||||||
PIPBOY_WINDOW_WIDTH,
|
PIPBOY_WINDOW_WIDTH,
|
||||||
|
@ -1250,7 +1242,7 @@ static void pipboyWindowRenderQuestLocationList(int a1)
|
||||||
// 0x4988A0
|
// 0x4988A0
|
||||||
static void pipboyRenderHolodiskText()
|
static void pipboyRenderHolodiskText()
|
||||||
{
|
{
|
||||||
blitBufferToBuffer(gPipboyFrmData[PIPBOY_FRM_BACKGROUND] + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
blitBufferToBuffer(_pipboyFrmImages[PIPBOY_FRM_BACKGROUND].getData() + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
||||||
PIPBOY_WINDOW_WIDTH,
|
PIPBOY_WINDOW_WIDTH,
|
||||||
|
@ -1435,7 +1427,7 @@ static void pipboyWindowHandleAutomaps(int a1)
|
||||||
{
|
{
|
||||||
if (a1 == 1024) {
|
if (a1 == 1024) {
|
||||||
pipboyWindowDestroyButtons();
|
pipboyWindowDestroyButtons();
|
||||||
blitBufferToBuffer(gPipboyFrmData[PIPBOY_FRM_BACKGROUND] + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
blitBufferToBuffer(_pipboyFrmImages[PIPBOY_FRM_BACKGROUND].getData() + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
||||||
PIPBOY_WINDOW_WIDTH,
|
PIPBOY_WINDOW_WIDTH,
|
||||||
|
@ -1526,7 +1518,7 @@ static int _PrintAMelevList(int a1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
blitBufferToBuffer(gPipboyFrmData[PIPBOY_FRM_BACKGROUND] + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
blitBufferToBuffer(_pipboyFrmImages[PIPBOY_FRM_BACKGROUND].getData() + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
||||||
PIPBOY_WINDOW_WIDTH,
|
PIPBOY_WINDOW_WIDTH,
|
||||||
|
@ -1620,7 +1612,7 @@ static int _PrintAMList(int a1)
|
||||||
qsort(_sortlist, count, sizeof(*_sortlist), _qscmp);
|
qsort(_sortlist, count, sizeof(*_sortlist), _qscmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
blitBufferToBuffer(gPipboyFrmData[PIPBOY_FRM_BACKGROUND] + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
blitBufferToBuffer(_pipboyFrmImages[PIPBOY_FRM_BACKGROUND].getData() + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
||||||
PIPBOY_WINDOW_WIDTH,
|
PIPBOY_WINDOW_WIDTH,
|
||||||
|
@ -1700,7 +1692,7 @@ static int pipboyRenderVideoArchive(int a1)
|
||||||
int v8;
|
int v8;
|
||||||
int v9;
|
int v9;
|
||||||
|
|
||||||
blitBufferToBuffer(gPipboyFrmData[PIPBOY_FRM_BACKGROUND] + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
blitBufferToBuffer(_pipboyFrmImages[PIPBOY_FRM_BACKGROUND].getData() + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
||||||
PIPBOY_WINDOW_WIDTH,
|
PIPBOY_WINDOW_WIDTH,
|
||||||
|
@ -1830,7 +1822,7 @@ static void pipboyWindowRenderRestOptions(int a1)
|
||||||
{
|
{
|
||||||
const char* text;
|
const char* text;
|
||||||
|
|
||||||
blitBufferToBuffer(gPipboyFrmData[PIPBOY_FRM_BACKGROUND] + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
blitBufferToBuffer(_pipboyFrmImages[PIPBOY_FRM_BACKGROUND].getData() + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
||||||
PIPBOY_WINDOW_WIDTH,
|
PIPBOY_WINDOW_WIDTH,
|
||||||
|
@ -1877,7 +1869,7 @@ static void pipboyDrawHitPoints()
|
||||||
char msg[64];
|
char msg[64];
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
blitBufferToBuffer(gPipboyFrmData[PIPBOY_FRM_BACKGROUND] + 66 * PIPBOY_WINDOW_WIDTH + 254,
|
blitBufferToBuffer(_pipboyFrmImages[PIPBOY_FRM_BACKGROUND].getData() + 66 * PIPBOY_WINDOW_WIDTH + 254,
|
||||||
350,
|
350,
|
||||||
10,
|
10,
|
||||||
PIPBOY_WINDOW_WIDTH,
|
PIPBOY_WINDOW_WIDTH,
|
||||||
|
@ -2233,7 +2225,7 @@ static int pipboyRenderScreensaver()
|
||||||
buf,
|
buf,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH);
|
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH);
|
||||||
|
|
||||||
blitBufferToBuffer(gPipboyFrmData[PIPBOY_FRM_BACKGROUND] + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
blitBufferToBuffer(_pipboyFrmImages[PIPBOY_FRM_BACKGROUND].getData() + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
||||||
PIPBOY_WINDOW_WIDTH,
|
PIPBOY_WINDOW_WIDTH,
|
||||||
|
@ -2263,15 +2255,15 @@ static int pipboyRenderScreensaver()
|
||||||
|
|
||||||
if (index < PIPBOY_BOMB_COUNT) {
|
if (index < PIPBOY_BOMB_COUNT) {
|
||||||
PipboyBomb* bomb = &(bombs[index]);
|
PipboyBomb* bomb = &(bombs[index]);
|
||||||
int v27 = (350 - gPipboyFrmSizes[PIPBOY_FRM_BOMB].width / 4) + (406 - gPipboyFrmSizes[PIPBOY_FRM_BOMB].height / 4);
|
int v27 = (350 - _pipboyFrmImages[PIPBOY_FRM_BOMB].getWidth() / 4) + (406 - _pipboyFrmImages[PIPBOY_FRM_BOMB].getHeight() / 4);
|
||||||
int v5 = (int)((double)randomBetween(0, PIPBOY_RAND_MAX) / (double)PIPBOY_RAND_MAX * (double)v27);
|
int v5 = (int)((double)randomBetween(0, PIPBOY_RAND_MAX) / (double)PIPBOY_RAND_MAX * (double)v27);
|
||||||
int v6 = gPipboyFrmSizes[PIPBOY_FRM_BOMB].height / 4;
|
int v6 = _pipboyFrmImages[PIPBOY_FRM_BOMB].getHeight() / 4;
|
||||||
if (PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT - v6 >= v5) {
|
if (PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT - v6 >= v5) {
|
||||||
bomb->x = 602;
|
bomb->x = 602;
|
||||||
bomb->y = v5 + 48;
|
bomb->y = v5 + 48;
|
||||||
} else {
|
} else {
|
||||||
bomb->x = v5 - (PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT - v6) + PIPBOY_WINDOW_CONTENT_VIEW_X + gPipboyFrmSizes[PIPBOY_FRM_BOMB].width / 4;
|
bomb->x = v5 - (PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT - v6) + PIPBOY_WINDOW_CONTENT_VIEW_X + _pipboyFrmImages[PIPBOY_FRM_BOMB].getWidth() / 4;
|
||||||
bomb->y = PIPBOY_WINDOW_CONTENT_VIEW_Y - gPipboyFrmSizes[PIPBOY_FRM_BOMB].height + 2;
|
bomb->y = PIPBOY_WINDOW_CONTENT_VIEW_Y - _pipboyFrmImages[PIPBOY_FRM_BOMB].getHeight() + 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
bomb->field_10 = 1;
|
bomb->field_10 = 1;
|
||||||
|
@ -2281,7 +2273,7 @@ static int pipboyRenderScreensaver()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (v31 == 0) {
|
if (v31 == 0) {
|
||||||
blitBufferToBuffer(gPipboyFrmData[PIPBOY_FRM_BACKGROUND] + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
blitBufferToBuffer(_pipboyFrmImages[PIPBOY_FRM_BACKGROUND].getData() + PIPBOY_WINDOW_WIDTH * PIPBOY_WINDOW_CONTENT_VIEW_Y + PIPBOY_WINDOW_CONTENT_VIEW_X,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
PIPBOY_WINDOW_CONTENT_VIEW_WIDTH,
|
||||||
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
PIPBOY_WINDOW_CONTENT_VIEW_HEIGHT,
|
||||||
PIPBOY_WINDOW_WIDTH,
|
PIPBOY_WINDOW_WIDTH,
|
||||||
|
@ -2295,15 +2287,15 @@ static int pipboyRenderScreensaver()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
int srcWidth = gPipboyFrmSizes[PIPBOY_FRM_BOMB].width;
|
int srcWidth = _pipboyFrmImages[PIPBOY_FRM_BOMB].getWidth();
|
||||||
int srcHeight = gPipboyFrmSizes[PIPBOY_FRM_BOMB].height;
|
int srcHeight = _pipboyFrmImages[PIPBOY_FRM_BOMB].getHeight();
|
||||||
int destX = bomb->x;
|
int destX = bomb->x;
|
||||||
int destY = bomb->y;
|
int destY = bomb->y;
|
||||||
int srcY = 0;
|
int srcY = 0;
|
||||||
int srcX = 0;
|
int srcX = 0;
|
||||||
|
|
||||||
if (destX >= PIPBOY_WINDOW_CONTENT_VIEW_X) {
|
if (destX >= PIPBOY_WINDOW_CONTENT_VIEW_X) {
|
||||||
if (destX + gPipboyFrmSizes[PIPBOY_FRM_BOMB].width >= 604) {
|
if (destX + _pipboyFrmImages[PIPBOY_FRM_BOMB].getWidth() >= 604) {
|
||||||
srcWidth = 604 - destX;
|
srcWidth = 604 - destX;
|
||||||
if (srcWidth < 1) {
|
if (srcWidth < 1) {
|
||||||
bomb->field_10 = 0;
|
bomb->field_10 = 0;
|
||||||
|
@ -2311,36 +2303,36 @@ static int pipboyRenderScreensaver()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
srcX = PIPBOY_WINDOW_CONTENT_VIEW_X - destX;
|
srcX = PIPBOY_WINDOW_CONTENT_VIEW_X - destX;
|
||||||
if (srcX >= gPipboyFrmSizes[PIPBOY_FRM_BOMB].width) {
|
if (srcX >= _pipboyFrmImages[PIPBOY_FRM_BOMB].getWidth()) {
|
||||||
bomb->field_10 = 0;
|
bomb->field_10 = 0;
|
||||||
}
|
}
|
||||||
destX = PIPBOY_WINDOW_CONTENT_VIEW_X;
|
destX = PIPBOY_WINDOW_CONTENT_VIEW_X;
|
||||||
srcWidth = gPipboyFrmSizes[PIPBOY_FRM_BOMB].width - srcX;
|
srcWidth = _pipboyFrmImages[PIPBOY_FRM_BOMB].getWidth() - srcX;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (destY >= PIPBOY_WINDOW_CONTENT_VIEW_Y) {
|
if (destY >= PIPBOY_WINDOW_CONTENT_VIEW_Y) {
|
||||||
if (destY + gPipboyFrmSizes[PIPBOY_FRM_BOMB].height >= 452) {
|
if (destY + _pipboyFrmImages[PIPBOY_FRM_BOMB].getHeight() >= 452) {
|
||||||
srcHeight = 452 - destY;
|
srcHeight = 452 - destY;
|
||||||
if (srcHeight < 1) {
|
if (srcHeight < 1) {
|
||||||
bomb->field_10 = 0;
|
bomb->field_10 = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (destY + gPipboyFrmSizes[PIPBOY_FRM_BOMB].height < PIPBOY_WINDOW_CONTENT_VIEW_Y) {
|
if (destY + _pipboyFrmImages[PIPBOY_FRM_BOMB].getHeight() < PIPBOY_WINDOW_CONTENT_VIEW_Y) {
|
||||||
bomb->field_10 = 0;
|
bomb->field_10 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
srcY = PIPBOY_WINDOW_CONTENT_VIEW_Y - destY;
|
srcY = PIPBOY_WINDOW_CONTENT_VIEW_Y - destY;
|
||||||
srcHeight = gPipboyFrmSizes[PIPBOY_FRM_BOMB].height - srcY;
|
srcHeight = _pipboyFrmImages[PIPBOY_FRM_BOMB].getHeight() - srcY;
|
||||||
destY = PIPBOY_WINDOW_CONTENT_VIEW_Y;
|
destY = PIPBOY_WINDOW_CONTENT_VIEW_Y;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bomb->field_10 == 1 && v31 == 0) {
|
if (bomb->field_10 == 1 && v31 == 0) {
|
||||||
blitBufferToBufferTrans(
|
blitBufferToBufferTrans(
|
||||||
gPipboyFrmData[PIPBOY_FRM_BOMB] + gPipboyFrmSizes[PIPBOY_FRM_BOMB].width * srcY + srcX,
|
_pipboyFrmImages[PIPBOY_FRM_BOMB].getData() + _pipboyFrmImages[PIPBOY_FRM_BOMB].getWidth() * srcY + srcX,
|
||||||
srcWidth,
|
srcWidth,
|
||||||
srcHeight,
|
srcHeight,
|
||||||
gPipboyFrmSizes[PIPBOY_FRM_BOMB].width,
|
_pipboyFrmImages[PIPBOY_FRM_BOMB].getWidth(),
|
||||||
gPipboyWindowBuffer + PIPBOY_WINDOW_WIDTH * destY + destX,
|
gPipboyWindowBuffer + PIPBOY_WINDOW_WIDTH * destY + destX,
|
||||||
PIPBOY_WINDOW_WIDTH);
|
PIPBOY_WINDOW_WIDTH);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue