Add Carrington Institute from *Perfect Dark*

This commit is contained in:
RocketRobz 2020-07-13 02:27:01 -06:00
parent a3aa38c61b
commit 426e7fd2af
5 changed files with 45 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 KiB

View File

@ -0,0 +1 @@
-f rgba -z auto "bg_carringtonInstitute.png"

9
include/pdarkBgNames.h Normal file
View File

@ -0,0 +1,9 @@
const char* pdarkBgNames[] = {
"Carrington Institute",
"",
"",
};
int pdarkBgNums[] = {
48,
};

View File

@ -276,6 +276,9 @@ void GFX::loadBgSprite(void) {
case 47:
bgPath = "romfs:/gfx/bg_roseGarden2.t3x";
break;
case 48:
bgPath = "romfs:/gfx/bg_carringtonInstitute.t3x";
break;
}
FILE* bgFile = fopen(bgPath, "rb");
fread((void*)bgSpriteMem[0], 1, 0x200000, bgFile);
@ -482,7 +485,8 @@ void GFX::showCharSprite(int num, bool flipH, int zoomIn, int fadeAlpha, bool li
switch (studioBg) {
default:
break;
case 43:
case 43: // Hair Salon (Girls Mode/Style Savvy/Style Boutique)
case 48: // Carrington Institute (Perfect Dark)
C2D_PlainImageTint(&tint, C2D_Color32(255, 255, 255, 127), 0);
C2D_DrawImageAt(image, xPos, yPosRefl-(shiftBySubPixel ? 0.5f : 0), 0.5f, &tint, xScale, -((cinemaWide ? 0.7f : 1)/2));
break;

View File

@ -16,6 +16,7 @@
#include "import_ss2bgnames.h"
#include "import_ss3bgnames.h"
#include "import_ss4bgnames.h"
#include "pdarkBgNames.h"
#include <unistd.h>
@ -37,7 +38,11 @@ void PhotoStudio::getList() {
void PhotoStudio::getMaxChars() {
if (subScreenMode == 1) {
// Locations
if (photo_highlightedGame == 3) {
if (photo_highlightedGame == 5) {
import_totalCharacters = 0;
} else if (photo_highlightedGame == 4) {
import_totalCharacters = 0;
} else if (photo_highlightedGame == 3) {
import_totalCharacters = 11;
} else if (photo_highlightedGame == 2) {
import_totalCharacters = 8;
@ -411,6 +416,9 @@ void PhotoStudio::Draw(void) const {
// Game name
switch (photo_highlightedGame) {
case 5:
Gui::DrawStringCentered(0, 8, 0.50, WHITE, "Perfect Dark");
break;
case 4:
Gui::DrawStringCentered(0, 8, 0.50, WHITE, "Rocket Photo Shoot");
break;
@ -440,7 +448,11 @@ void PhotoStudio::Draw(void) const {
if (!displayNothing) {
int i2 = 48;
for (int i = import_bgShownFirst; i < import_bgShownFirst+3; i++) {
if (photo_highlightedGame == 3) {
if (photo_highlightedGame == 5) {
if (i >= 1) break;
GFX::DrawSprite(sprites_item_button_idx, 16, i2-20);
Gui::DrawString(32, i2, 0.65, WHITE, pdarkBgNames[i]);
} else if (photo_highlightedGame == 3) {
GFX::DrawSprite(sprites_item_button_idx, 16, i2-20);
Gui::DrawString(32, i2, 0.65, WHITE, import_ss4BgNames[i]);
} else if (photo_highlightedGame == 2) {
@ -702,6 +714,9 @@ void PhotoStudio::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
case 3:
studioBg = import_ss4BgNums[bgList_cursorPosition];
break;
case 5:
studioBg = pdarkBgNums[bgList_cursorPosition];
break;
}
displayStudioBg = false;
gspWaitForVBlank();
@ -739,6 +754,9 @@ void PhotoStudio::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
case 3:
studioBg = import_ss4BgNums[bgList_cursorPosition];
break;
case 5:
studioBg = pdarkBgNums[bgList_cursorPosition];
break;
}
displayStudioBg = false;
gspWaitForVBlank();
@ -759,14 +777,16 @@ void PhotoStudio::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
if (hDown & KEY_DLEFT) {
sndHighlight();
photo_highlightedGame--;
if (photo_highlightedGame < 0) photo_highlightedGame = 3;
if (photo_highlightedGame == 4) photo_highlightedGame--; // Skip Rocket Photo Shoot page for now
if (photo_highlightedGame < 0) photo_highlightedGame = 5;
getMaxChars();
}
if (hDown & KEY_DRIGHT) {
sndHighlight();
photo_highlightedGame++;
if (photo_highlightedGame > 3) photo_highlightedGame = 0;
if (photo_highlightedGame == 4) photo_highlightedGame++; // Skip Rocket Photo Shoot page for now
if (photo_highlightedGame > 5) photo_highlightedGame = 0;
getMaxChars();
}
@ -788,6 +808,9 @@ void PhotoStudio::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
case 3:
studioBg = import_ss4BgNums[bgList_cursorPosition];
break;
case 5:
studioBg = pdarkBgNums[bgList_cursorPosition];
break;
}
displayStudioBg = false;
gspWaitForVBlank();
@ -871,6 +894,9 @@ void PhotoStudio::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
case 3:
bgNum = import_ss4BgNums[bgList_cursorPosition];
break;
case 5:
bgNum = pdarkBgNums[bgList_cursorPosition];
break;
}
//if (studioBg != bgNum) {
showScrollingBg = false;