Merge pull request #9 from Cheezepin/master

haveyourcake (made by wiseguy, ported by me)
This commit is contained in:
Reonu
2021-06-27 15:09:28 +01:00
committed by GitHub
5 changed files with 1682 additions and 576 deletions

752
haveyourcake2.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -21,9 +21,7 @@ const GeoLayout ending_geo_000050[] = {
GEO_OPEN_NODE(),
GEO_NODE_ORTHO(100),
GEO_OPEN_NODE(),
#ifdef VERSION_EU
GEO_BACKGROUND_COLOR(0x0001),
#endif
GEO_ASM(0, geo_exec_cake_end_screen),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -49,8 +49,8 @@ static const ImageProps IMAGE_PROPERTIES[ImageType_MAX][2] = {
{256, 256, 32, 32, 8, 8, true, true},
},
[Cake] = {
{316, 228, 79, 19, 4, 12, false, false},
{320, 240, 80, 20, 4, 12, false, false},
{316, 228, 63, 29, 5, 8, false, false},
{320, 240, 64, 30, 5, 8, false, false},
},
[CakeEU] = {
{320, 224, 64, 32, 5, 7, false, false},
@@ -64,7 +64,7 @@ typedef struct {
static const TableDimension TABLE_DIMENSIONS[ImageType_MAX] = {
[Skybox] = {8, 10},
[Cake] = {4, 12},
[Cake] = {5, 8},
[CakeEU] = {5, 7},
};
@@ -106,15 +106,26 @@ static void split_tile(int col, int row, rgba *image, bool expanded) {
int tileWidth = props.tileWidth;
int tileHeight = props.tileHeight;
int imageWidth = props.imageWidth;
int imageHeight = props.imageHeight;
int numCols = props.numCols;
int expandedWidth = IMAGE_PROPERTIES[type][true].tileWidth;
rgba black = {0, 0, 0, 0};
for (int y = 0; y < tileHeight; y++) {
for (int x = 0; x < tileWidth; x++) {
int ny = row * tileHeight + y;
int nx = col * tileWidth + x;
tiles[row * numCols + col].px[y * expandedWidth + x] = image[(ny * imageWidth + nx)];
if (nx < imageWidth && ny < imageHeight)
{
tiles[row * numCols + col].px[y * expandedWidth + x] = image[(ny * imageWidth + nx)];
}
else
{
tiles[row * numCols + col].px[y * expandedWidth + x] = black;
}
}
}
}
@@ -339,11 +350,13 @@ static void write_cake_c() {
}
int numTiles = TABLE_DIMENSIONS[type].cols * TABLE_DIMENSIONS[type].rows;
fprintf(cFile, "ALIGNED8 static const Texture cake_end_texture_%sdata[] = {\n", euSuffx);
for (int i = 0; i < numTiles; ++i) {
fprintf(cFile, "ALIGNED8 static const Texture cake_end_texture_%s%d[] = {\n", euSuffx, i);
print_raw_data(cFile, &tiles[i]);
fputs("};\n\n", cFile);
fputc(',', cFile);
fputc('\n', cFile);
}
fputs("};\n\n", cFile);
fclose(cFile);
}