Wii U: Try to fix water renderering

This commit is contained in:
UnknownShadow200 2025-03-07 17:32:11 +11:00
parent a2c7ad85fb
commit 4f10d814c6
3 changed files with 19 additions and 0 deletions

View File

@ -1416,11 +1416,15 @@ void Audio_FreeChunks(struct AudioChunk* chunks, int numChunks) {
*-------------------------------------------------------Wii U backend-----------------------------------------------------*
*#########################################################################################################################*/
#include <sndcore2/core.h>
static cc_bool ax_inited;
struct AudioContext { int count; };
#define AUDIO_COMMON_ALLOC
cc_bool AudioBackend_Init(void) {
if (ax_inited) return true;
ax_inited = true;
AXInit();
return true;
}

View File

@ -211,9 +211,20 @@ void Gfx_SetDepthWrite(cc_bool enabled) {
}
static void SetColorWrite(cc_bool r, cc_bool g, cc_bool b, cc_bool a) {
GX2ChannelMask mask = 0;
if (r) mask |= GX2_CHANNEL_MASK_R;
if (g) mask |= GX2_CHANNEL_MASK_G;
if (b) mask |= GX2_CHANNEL_MASK_B;
if (a) mask |= GX2_CHANNEL_MASK_A;
// TODO: use GX2SetColorControl to disable all writing ???
GX2SetTargetChannelMasks(mask, 0,0,0, 0,0,0,0);
}
void Gfx_DepthOnlyRendering(cc_bool depthOnly) {
cc_bool enabled = !depthOnly;
SetColorWrite(enabled & gfx_colorMask[0], enabled & gfx_colorMask[1],
enabled & gfx_colorMask[2], enabled & gfx_colorMask[3]);
}

View File

@ -10,6 +10,7 @@
#include "Utils.h"
#include "Errors.h"
#include "PackedCol.h"
#include "Audio.h"
#include <errno.h>
#include <time.h>
#include <stdlib.h>
@ -454,6 +455,9 @@ cc_bool Platform_DescribeError(cc_result res, cc_string* dst) {
void Platform_Init(void) {
WHBProcInit();
// Otherwise loading sound gets stuck endlessly repeating
AudioBackend_Init();
mkdir("ClassiCube", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
}