mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-05-29 08:52:49 -04:00
Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dd6a8b5084 | |||
| f4c871e35c | |||
| 8e808c4305 | |||
| 03c3eef193 | |||
| 42a5f46e5e | |||
| 7878b8f3e4 | |||
| 7906d70485 | |||
| dd62d0882e | |||
| 6e88a3706c | |||
| d102506fba | |||
| 7c7f032e0e | |||
| da8f80bb28 | |||
| 63f763a556 | |||
| 83541f4605 | |||
| 43b7ca96d7 | |||
| c00edb928b | |||
| b0510d78f8 | |||
| fd3872ae30 | |||
| aa00cba76e | |||
| 18208cc993 | |||
| b310d675f1 | |||
| eb081dc719 | |||
| e883f27436 | |||
| f563ac733f |
+2
-2
@@ -7,8 +7,8 @@ set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
|
|||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version" FORCE)
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version" FORCE)
|
||||||
|
|
||||||
project(Ship LANGUAGES C CXX
|
project(Ship LANGUAGES C CXX
|
||||||
VERSION 4.0.2)
|
VERSION 4.0.3)
|
||||||
set(PROJECT_BUILD_NAME "ZHORA CHARLIE" CACHE STRING "")
|
set(PROJECT_BUILD_NAME "ZHORA DELTA" CACHE STRING "")
|
||||||
set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "")
|
set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "")
|
||||||
|
|
||||||
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT soh)
|
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT soh)
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ enum {
|
|||||||
SHADER_TEXEL1,
|
SHADER_TEXEL1,
|
||||||
SHADER_TEXEL1A,
|
SHADER_TEXEL1A,
|
||||||
SHADER_1,
|
SHADER_1,
|
||||||
SHADER_COMBINED
|
SHADER_COMBINED,
|
||||||
|
SHADER_NOISE
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SHADER_OPT_ALPHA (1 << 0)
|
#define SHADER_OPT_ALPHA (1 << 0)
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ static void append_line(char *buf, size_t *len, const char *str) {
|
|||||||
buf[(*len)++] = '\n';
|
buf[(*len)++] = '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define RAND_NOISE "((random(float3(floor(screenSpace.xy * noise_scale), noise_frame)) + 1.0) / 2.0)"
|
||||||
|
|
||||||
static const char *shader_item_to_str(uint32_t item, bool with_alpha, bool only_alpha, bool inputs_have_alpha, bool hint_single_element) {
|
static const char *shader_item_to_str(uint32_t item, bool with_alpha, bool only_alpha, bool inputs_have_alpha, bool hint_single_element) {
|
||||||
if (!only_alpha) {
|
if (!only_alpha) {
|
||||||
switch (item) {
|
switch (item) {
|
||||||
@@ -41,6 +43,8 @@ static const char *shader_item_to_str(uint32_t item, bool with_alpha, bool only_
|
|||||||
return with_alpha ? "texVal1" : "texVal1.rgb";
|
return with_alpha ? "texVal1" : "texVal1.rgb";
|
||||||
case SHADER_COMBINED:
|
case SHADER_COMBINED:
|
||||||
return with_alpha ? "texel" : "texel.rgb";
|
return with_alpha ? "texel" : "texel.rgb";
|
||||||
|
case SHADER_NOISE:
|
||||||
|
return with_alpha ? "float4(" RAND_NOISE ", " RAND_NOISE ", " RAND_NOISE ", " RAND_NOISE ")" : "float3(" RAND_NOISE ", " RAND_NOISE ", " RAND_NOISE ")";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch (item) {
|
switch (item) {
|
||||||
@@ -67,10 +71,14 @@ static const char *shader_item_to_str(uint32_t item, bool with_alpha, bool only_
|
|||||||
return "texVal1.a";
|
return "texVal1.a";
|
||||||
case SHADER_COMBINED:
|
case SHADER_COMBINED:
|
||||||
return "texel.a";
|
return "texel.a";
|
||||||
|
case SHADER_NOISE:
|
||||||
|
return RAND_NOISE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef RAND_NOISE
|
||||||
|
|
||||||
static void append_formula(char *buf, size_t *len, const uint8_t c[2][4], bool do_single, bool do_multiply, bool do_mix, bool with_alpha, bool only_alpha, bool opt_alpha) {
|
static void append_formula(char *buf, size_t *len, const uint8_t c[2][4], bool do_single, bool do_multiply, bool do_mix, bool with_alpha, bool only_alpha, bool opt_alpha) {
|
||||||
if (do_single) {
|
if (do_single) {
|
||||||
append_str(buf, len, shader_item_to_str(c[only_alpha][3], with_alpha, only_alpha, opt_alpha, false));
|
append_str(buf, len, shader_item_to_str(c[only_alpha][3], with_alpha, only_alpha, opt_alpha, false));
|
||||||
@@ -106,9 +114,7 @@ void gfx_direct3d_common_build_shader(char buf[4096], size_t& len, size_t& num_f
|
|||||||
|
|
||||||
if (include_root_signature) {
|
if (include_root_signature) {
|
||||||
append_str(buf, &len, "#define RS \"RootFlags(ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT | DENY_VERTEX_SHADER_ROOT_ACCESS)");
|
append_str(buf, &len, "#define RS \"RootFlags(ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT | DENY_VERTEX_SHADER_ROOT_ACCESS)");
|
||||||
if (cc_features.opt_alpha && cc_features.opt_noise) {
|
append_str(buf, &len, ",CBV(b0, visibility = SHADER_VISIBILITY_PIXEL)");
|
||||||
append_str(buf, &len, ",CBV(b0, visibility = SHADER_VISIBILITY_PIXEL)");
|
|
||||||
}
|
|
||||||
if (cc_features.used_textures[0]) {
|
if (cc_features.used_textures[0]) {
|
||||||
append_str(buf, &len, ",DescriptorTable(SRV(t0), visibility = SHADER_VISIBILITY_PIXEL)");
|
append_str(buf, &len, ",DescriptorTable(SRV(t0), visibility = SHADER_VISIBILITY_PIXEL)");
|
||||||
append_str(buf, &len, ",DescriptorTable(Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL)");
|
append_str(buf, &len, ",DescriptorTable(Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL)");
|
||||||
@@ -161,17 +167,15 @@ void gfx_direct3d_common_build_shader(char buf[4096], size_t& len, size_t& num_f
|
|||||||
|
|
||||||
// Constant buffer and random function
|
// Constant buffer and random function
|
||||||
|
|
||||||
if (cc_features.opt_alpha && cc_features.opt_noise) {
|
append_line(buf, &len, "cbuffer PerFrameCB : register(b0) {");
|
||||||
append_line(buf, &len, "cbuffer PerFrameCB : register(b0) {");
|
append_line(buf, &len, " uint noise_frame;");
|
||||||
append_line(buf, &len, " uint noise_frame;");
|
append_line(buf, &len, " float noise_scale;");
|
||||||
append_line(buf, &len, " float noise_scale;");
|
append_line(buf, &len, "}");
|
||||||
append_line(buf, &len, "}");
|
|
||||||
|
|
||||||
append_line(buf, &len, "float random(in float3 value) {");
|
append_line(buf, &len, "float random(in float3 value) {");
|
||||||
append_line(buf, &len, " float random = dot(value, float3(12.9898, 78.233, 37.719));");
|
append_line(buf, &len, " float random = dot(value, float3(12.9898, 78.233, 37.719));");
|
||||||
append_line(buf, &len, " return frac(sin(random) * 143758.5453);");
|
append_line(buf, &len, " return frac(sin(random) * 143758.5453);");
|
||||||
append_line(buf, &len, "}");
|
append_line(buf, &len, "}");
|
||||||
}
|
|
||||||
|
|
||||||
// 3 point texture filtering
|
// 3 point texture filtering
|
||||||
// Original author: ArthurCarvalho
|
// Original author: ArthurCarvalho
|
||||||
@@ -248,11 +252,14 @@ void gfx_direct3d_common_build_shader(char buf[4096], size_t& len, size_t& num_f
|
|||||||
if (include_root_signature) {
|
if (include_root_signature) {
|
||||||
append_line(buf, &len, "[RootSignature(RS)]");
|
append_line(buf, &len, "[RootSignature(RS)]");
|
||||||
}
|
}
|
||||||
if (cc_features.opt_alpha && cc_features.opt_noise) {
|
append_line(buf, &len, "float4 PSMain(PSInput input, float4 screenSpace : SV_Position) : SV_TARGET {");
|
||||||
append_line(buf, &len, "float4 PSMain(PSInput input, float4 screenSpace : SV_Position) : SV_TARGET {");
|
|
||||||
} else {
|
// Reference approach to color wrapping as per GLideN64
|
||||||
append_line(buf, &len, "float4 PSMain(PSInput input) : SV_TARGET {");
|
// Return wrapped value of x in interval [low, high)
|
||||||
}
|
// Mod implementation of GLSL sourced from https://registry.khronos.org/OpenGL-Refpages/gl4/html/mod.xhtml
|
||||||
|
append_line(buf, &len, "#define MOD(x, y) ((x) - (y) * floor((x)/(y)))");
|
||||||
|
append_line(buf, &len, "#define WRAP(x, low, high) MOD((x)-(low), (high)-(low)) + (low)");
|
||||||
|
|
||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
if (cc_features.used_textures[i]) {
|
if (cc_features.used_textures[i]) {
|
||||||
len += sprintf(buf + len, " float2 tc%d = input.uv%d;\r\n", i, i);
|
len += sprintf(buf + len, " float2 tc%d = input.uv%d;\r\n", i, i);
|
||||||
@@ -294,11 +301,18 @@ void gfx_direct3d_common_build_shader(char buf[4096], size_t& len, size_t& num_f
|
|||||||
append_formula(buf, &len, cc_features.c[c], cc_features.do_single[c][0], cc_features.do_multiply[c][0], cc_features.do_mix[c][0], cc_features.opt_alpha, false, cc_features.opt_alpha);
|
append_formula(buf, &len, cc_features.c[c], cc_features.do_single[c][0], cc_features.do_multiply[c][0], cc_features.do_mix[c][0], cc_features.opt_alpha, false, cc_features.opt_alpha);
|
||||||
}
|
}
|
||||||
append_line(buf, &len, ";");
|
append_line(buf, &len, ";");
|
||||||
|
|
||||||
|
if (c == 0) {
|
||||||
|
append_str(buf, &len, "texel = WRAP(texel, -1.01, 1.01);");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cc_features.opt_texture_edge && cc_features.opt_alpha) {
|
if (cc_features.opt_texture_edge && cc_features.opt_alpha) {
|
||||||
append_line(buf, &len, " if (texel.a > 0.19) texel.a = 1.0; else discard;");
|
append_line(buf, &len, " if (texel.a > 0.19) texel.a = 1.0; else discard;");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
append_str(buf, &len, "texel = WRAP(texel, -0.51, 1.51);");
|
||||||
|
append_str(buf, &len, "texel = clamp(texel, 0.0, 1.0);");
|
||||||
// TODO discard if alpha is 0?
|
// TODO discard if alpha is 0?
|
||||||
if (cc_features.opt_fog) {
|
if (cc_features.opt_fog) {
|
||||||
if (cc_features.opt_alpha) {
|
if (cc_features.opt_alpha) {
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ struct ShaderProgram {
|
|||||||
GLint attrib_locations[16];
|
GLint attrib_locations[16];
|
||||||
uint8_t attrib_sizes[16];
|
uint8_t attrib_sizes[16];
|
||||||
uint8_t num_attribs;
|
uint8_t num_attribs;
|
||||||
bool used_noise;
|
|
||||||
GLint frame_count_location;
|
GLint frame_count_location;
|
||||||
GLint noise_scale_location;
|
GLint noise_scale_location;
|
||||||
};
|
};
|
||||||
@@ -104,10 +103,8 @@ static void gfx_opengl_vertex_array_set_attribs(struct ShaderProgram *prg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_opengl_set_uniforms(struct ShaderProgram *prg) {
|
static void gfx_opengl_set_uniforms(struct ShaderProgram *prg) {
|
||||||
if (prg->used_noise) {
|
glUniform1i(prg->frame_count_location, frame_count);
|
||||||
glUniform1i(prg->frame_count_location, frame_count);
|
glUniform1f(prg->noise_scale_location, current_noise_scale);
|
||||||
glUniform1f(prg->noise_scale_location, current_noise_scale);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_opengl_unload_shader(struct ShaderProgram *old_prg) {
|
static void gfx_opengl_unload_shader(struct ShaderProgram *old_prg) {
|
||||||
@@ -134,6 +131,8 @@ static void append_line(char *buf, size_t *len, const char *str) {
|
|||||||
buf[(*len)++] = '\n';
|
buf[(*len)++] = '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define RAND_NOISE "((random(vec3(floor(gl_FragCoord.xy * noise_scale), float(frame_count))) + 1.0) / 2.0)"
|
||||||
|
|
||||||
static const char *shader_item_to_str(uint32_t item, bool with_alpha, bool only_alpha, bool inputs_have_alpha, bool hint_single_element) {
|
static const char *shader_item_to_str(uint32_t item, bool with_alpha, bool only_alpha, bool inputs_have_alpha, bool hint_single_element) {
|
||||||
if (!only_alpha) {
|
if (!only_alpha) {
|
||||||
switch (item) {
|
switch (item) {
|
||||||
@@ -161,6 +160,8 @@ static const char *shader_item_to_str(uint32_t item, bool with_alpha, bool only_
|
|||||||
return with_alpha ? "texVal1" : "texVal1.rgb";
|
return with_alpha ? "texVal1" : "texVal1.rgb";
|
||||||
case SHADER_COMBINED:
|
case SHADER_COMBINED:
|
||||||
return with_alpha ? "texel" : "texel.rgb";
|
return with_alpha ? "texel" : "texel.rgb";
|
||||||
|
case SHADER_NOISE:
|
||||||
|
return with_alpha ? "vec4(" RAND_NOISE ", " RAND_NOISE ", " RAND_NOISE ", " RAND_NOISE ")" : "vec3(" RAND_NOISE ", " RAND_NOISE ", " RAND_NOISE ")";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch (item) {
|
switch (item) {
|
||||||
@@ -186,11 +187,15 @@ static const char *shader_item_to_str(uint32_t item, bool with_alpha, bool only_
|
|||||||
return "texVal1.a";
|
return "texVal1.a";
|
||||||
case SHADER_COMBINED:
|
case SHADER_COMBINED:
|
||||||
return "texel.a";
|
return "texel.a";
|
||||||
|
case SHADER_NOISE:
|
||||||
|
return RAND_NOISE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef RAND_NOISE
|
||||||
|
|
||||||
static void append_formula(char *buf, size_t *len, uint8_t c[2][4], bool do_single, bool do_multiply, bool do_mix, bool with_alpha, bool only_alpha, bool opt_alpha) {
|
static void append_formula(char *buf, size_t *len, uint8_t c[2][4], bool do_single, bool do_multiply, bool do_mix, bool with_alpha, bool only_alpha, bool opt_alpha) {
|
||||||
if (do_single) {
|
if (do_single) {
|
||||||
append_str(buf, len, shader_item_to_str(c[only_alpha][3], with_alpha, only_alpha, opt_alpha, false));
|
append_str(buf, len, shader_item_to_str(c[only_alpha][3], with_alpha, only_alpha, opt_alpha, false));
|
||||||
@@ -368,15 +373,13 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad
|
|||||||
append_line(fs_buf, &fs_len, "uniform sampler2D uTex1;");
|
append_line(fs_buf, &fs_len, "uniform sampler2D uTex1;");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cc_features.opt_alpha && cc_features.opt_noise) {
|
append_line(fs_buf, &fs_len, "uniform int frame_count;");
|
||||||
append_line(fs_buf, &fs_len, "uniform int frame_count;");
|
append_line(fs_buf, &fs_len, "uniform float noise_scale;");
|
||||||
append_line(fs_buf, &fs_len, "uniform float noise_scale;");
|
|
||||||
|
|
||||||
append_line(fs_buf, &fs_len, "float random(in vec3 value) {");
|
append_line(fs_buf, &fs_len, "float random(in vec3 value) {");
|
||||||
append_line(fs_buf, &fs_len, " float random = dot(sin(value), vec3(12.9898, 78.233, 37.719));");
|
append_line(fs_buf, &fs_len, " float random = dot(sin(value), vec3(12.9898, 78.233, 37.719));");
|
||||||
append_line(fs_buf, &fs_len, " return fract(sin(random) * 143758.5453);");
|
append_line(fs_buf, &fs_len, " return fract(sin(random) * 143758.5453);");
|
||||||
append_line(fs_buf, &fs_len, "}");
|
append_line(fs_buf, &fs_len, "}");
|
||||||
}
|
|
||||||
|
|
||||||
if (current_filter_mode == FILTER_THREE_POINT) {
|
if (current_filter_mode == FILTER_THREE_POINT) {
|
||||||
#if __APPLE__
|
#if __APPLE__
|
||||||
@@ -411,6 +414,10 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad
|
|||||||
|
|
||||||
append_line(fs_buf, &fs_len, "void main() {");
|
append_line(fs_buf, &fs_len, "void main() {");
|
||||||
|
|
||||||
|
// Reference approach to color wrapping as per GLideN64
|
||||||
|
// Return wrapped value of x in interval [low, high)
|
||||||
|
append_line(fs_buf, &fs_len, "#define WRAP(x, low, high) mod((x)-(low), (high)-(low)) + (low)");
|
||||||
|
|
||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
if (cc_features.used_textures[i]) {
|
if (cc_features.used_textures[i]) {
|
||||||
bool s = cc_features.clamp[i][0], t = cc_features.clamp[i][1];
|
bool s = cc_features.clamp[i][0], t = cc_features.clamp[i][1];
|
||||||
@@ -445,7 +452,14 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad
|
|||||||
append_formula(fs_buf, &fs_len, cc_features.c[c], cc_features.do_single[c][0], cc_features.do_multiply[c][0], cc_features.do_mix[c][0], cc_features.opt_alpha, false, cc_features.opt_alpha);
|
append_formula(fs_buf, &fs_len, cc_features.c[c], cc_features.do_single[c][0], cc_features.do_multiply[c][0], cc_features.do_mix[c][0], cc_features.opt_alpha, false, cc_features.opt_alpha);
|
||||||
}
|
}
|
||||||
append_line(fs_buf, &fs_len, ";");
|
append_line(fs_buf, &fs_len, ";");
|
||||||
|
|
||||||
|
if (c == 0) {
|
||||||
|
append_str(fs_buf, &fs_len, "texel = WRAP(texel, -1.01, 1.01);");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
append_str(fs_buf, &fs_len, "texel = WRAP(texel, -0.51, 1.51);");
|
||||||
|
append_str(fs_buf, &fs_len, "texel = clamp(texel, 0.0, 1.0);");
|
||||||
// TODO discard if alpha is 0?
|
// TODO discard if alpha is 0?
|
||||||
if (cc_features.opt_fog)
|
if (cc_features.opt_fog)
|
||||||
{
|
{
|
||||||
@@ -604,13 +618,8 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad
|
|||||||
glUniform1i(sampler_location, 1);
|
glUniform1i(sampler_location, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cc_features.opt_alpha && cc_features.opt_noise) {
|
prg->frame_count_location = glGetUniformLocation(shader_program, "frame_count");
|
||||||
prg->frame_count_location = glGetUniformLocation(shader_program, "frame_count");
|
prg->noise_scale_location = glGetUniformLocation(shader_program, "noise_scale");
|
||||||
prg->noise_scale_location = glGetUniformLocation(shader_program, "noise_scale");
|
|
||||||
prg->used_noise = true;
|
|
||||||
} else {
|
|
||||||
prg->used_noise = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return prg;
|
return prg;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -413,6 +413,9 @@ static void gfx_generate_cc(struct ColorCombiner *comb, uint64_t cc_id) {
|
|||||||
val = SHADER_TEXEL1A;
|
val = SHADER_TEXEL1A;
|
||||||
used_textures[1] = true;
|
used_textures[1] = true;
|
||||||
break;
|
break;
|
||||||
|
case G_CCMUX_NOISE:
|
||||||
|
val = SHADER_NOISE;
|
||||||
|
break;
|
||||||
case G_CCMUX_PRIMITIVE:
|
case G_CCMUX_PRIMITIVE:
|
||||||
case G_CCMUX_PRIMITIVE_ALPHA:
|
case G_CCMUX_PRIMITIVE_ALPHA:
|
||||||
case G_CCMUX_PRIM_LOD_FRAC:
|
case G_CCMUX_PRIM_LOD_FRAC:
|
||||||
|
|||||||
@@ -480,7 +480,7 @@ namespace Ship {
|
|||||||
WmApi = &gfx_dxgi_api;
|
WmApi = &gfx_dxgi_api;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_DX11
|
#ifdef ENABLE_DX11
|
||||||
RenderingApi = &gfx_direct3d11_api;
|
RenderingApi = &gfx_direct3d11_api;
|
||||||
WmApi = &gfx_dxgi_api;
|
WmApi = &gfx_dxgi_api;
|
||||||
#endif
|
#endif
|
||||||
#ifdef __WIIU__
|
#ifdef __WIIU__
|
||||||
|
|||||||
+1
-1
@@ -1953,7 +1953,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|||||||
TARGET ${PROJECT_NAME}
|
TARGET ${PROJECT_NAME}
|
||||||
PRE_BUILD
|
PRE_BUILD
|
||||||
COMMANDS
|
COMMANDS
|
||||||
COMMAND $<CONFIG:Debug> copy /b $<SHELL_PATH:${CMAKE_CURRENT_SOURCE_DIR}/>src\\boot\\build.c +,,
|
COMMAND $<CONFIG:Debug> copy /b $<SHELL_PATH:${CMAKE_BINARY_DIR}/>build.c +,,
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|||||||
@@ -38,8 +38,7 @@ typedef struct {
|
|||||||
} CsCmdBase; // size = 0x6
|
} CsCmdBase; // size = 0x6
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* 0x00 */ u8 unk_00;
|
/* 0x00 */ u16 setting;
|
||||||
/* 0x01 */ u8 setting;
|
|
||||||
/* 0x02 */ u16 startFrame;
|
/* 0x02 */ u16 startFrame;
|
||||||
/* 0x04 */ u16 endFrame;
|
/* 0x04 */ u16 endFrame;
|
||||||
} CsCmdEnvLighting; // size = 0x6
|
} CsCmdEnvLighting; // size = 0x6
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ void BootCommands_Init()
|
|||||||
{
|
{
|
||||||
CVar_RegisterS32("gDebugEnabled", 0);
|
CVar_RegisterS32("gDebugEnabled", 0);
|
||||||
CVar_RegisterS32("gLanguages", 0); //0 = English / 1 = German / 2 = French
|
CVar_RegisterS32("gLanguages", 0); //0 = English / 1 = German / 2 = French
|
||||||
CVar_RegisterS32("gHudColors", 1); //0 = N64 / 1 = NGC / 2 = Custom
|
CVar_RegisterS32("gHudColors", 0); //0 = N64 / 1 = NGC / 2 = Custom
|
||||||
CVar_RegisterS32("gInvertYAxis", 1);
|
CVar_RegisterS32("gInvertYAxis", 1);
|
||||||
CVar_RegisterS32("gTrailDuration", 4); // 4 = Default trail duration
|
CVar_RegisterS32("gTrailDuration", 4); // 4 = Default trail duration
|
||||||
if (ResourceMgr_IsGameMasterQuest()) {
|
if (ResourceMgr_IsGameMasterQuest()) {
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ const std::vector<FlagTable> flagTables = {
|
|||||||
{ 0xB7, "Spoke to Fado in Kokiri Forest as Child" },
|
{ 0xB7, "Spoke to Fado in Kokiri Forest as Child" },
|
||||||
{ 0xB8, "Spoke to Malon After Saving Ranch" },
|
{ 0xB8, "Spoke to Malon After Saving Ranch" },
|
||||||
{ 0xB9, "Spoke to Malon on Horseback" },
|
{ 0xB9, "Spoke to Malon on Horseback" },
|
||||||
{ 0xBC, "Spoke to Carpenter Boss by Tent" },
|
{ 0xBC, "Fado requested Odd Potion" },
|
||||||
{ 0xC0, "Spoke to Fat Woman by Market Potion Shop" },
|
{ 0xC0, "Spoke to Fat Woman by Market Potion Shop" },
|
||||||
{ 0xC1, "Spoke to Fat Woman After Zelda's Escape" },
|
{ 0xC1, "Spoke to Fat Woman After Zelda's Escape" },
|
||||||
{ 0xC2, "Spoke to Burly Man About Talon Search" },
|
{ 0xC2, "Spoke to Burly Man About Talon Search" },
|
||||||
|
|||||||
+11
-17
@@ -298,6 +298,8 @@ namespace GameMenuBar {
|
|||||||
CVar_SetS32("gCrouchStabHammerFix", 0);
|
CVar_SetS32("gCrouchStabHammerFix", 0);
|
||||||
// Fix all crouch stab
|
// Fix all crouch stab
|
||||||
CVar_SetS32("gCrouchStabFix", 0);
|
CVar_SetS32("gCrouchStabFix", 0);
|
||||||
|
// Fix Gerudo Warrior's clothing colors
|
||||||
|
CVar_SetS32("gGerudoWarriorClothingFix", 0);
|
||||||
|
|
||||||
// Red Ganon blood
|
// Red Ganon blood
|
||||||
CVar_SetS32("gRedGanonBlood", 0);
|
CVar_SetS32("gRedGanonBlood", 0);
|
||||||
@@ -1078,6 +1080,8 @@ namespace GameMenuBar {
|
|||||||
UIWidgets::PaddedEnhancementCheckbox("Remove power crouch stab", "gCrouchStabFix", true, false);
|
UIWidgets::PaddedEnhancementCheckbox("Remove power crouch stab", "gCrouchStabFix", true, false);
|
||||||
UIWidgets::Tooltip("Make crouch stabbing always do the same damage as a regular slash");
|
UIWidgets::Tooltip("Make crouch stabbing always do the same damage as a regular slash");
|
||||||
}
|
}
|
||||||
|
UIWidgets::PaddedEnhancementCheckbox("Fix Gerudo Warrior's clothing colors", "gGerudoWarriorClothingFix", true, false);
|
||||||
|
UIWidgets::Tooltip("Prevent the Gerudo Warrior's clothes changing color when changing Link's tunic or using bombs in front of her");
|
||||||
|
|
||||||
ImGui::EndMenu();
|
ImGui::EndMenu();
|
||||||
}
|
}
|
||||||
@@ -1112,12 +1116,7 @@ namespace GameMenuBar {
|
|||||||
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0, 0));
|
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0, 0));
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f);
|
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f);
|
||||||
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.22f, 0.38f, 0.56f, 1.0f));
|
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.22f, 0.38f, 0.56f, 1.0f));
|
||||||
#ifdef __WIIU__
|
if (ImGui::Button(GetWindowButtonText("Cosmetics Editor", CVar_GetS32("gCosmeticsEditorEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
|
||||||
static ImVec2 buttonSize(200.0f * 2.0f, 0.0f);
|
|
||||||
#else
|
|
||||||
static ImVec2 buttonSize(200.0f, 0.0f);
|
|
||||||
#endif
|
|
||||||
if (ImGui::Button(GetWindowButtonText("Cosmetics Editor", CVar_GetS32("gCosmeticsEditorEnabled", 0)).c_str(), buttonSize))
|
|
||||||
{
|
{
|
||||||
bool currentValue = CVar_GetS32("gCosmeticsEditorEnabled", 0);
|
bool currentValue = CVar_GetS32("gCosmeticsEditorEnabled", 0);
|
||||||
CVar_SetS32("gCosmeticsEditorEnabled", !currentValue);
|
CVar_SetS32("gCosmeticsEditorEnabled", !currentValue);
|
||||||
@@ -1246,7 +1245,7 @@ namespace GameMenuBar {
|
|||||||
UIWidgets::Tooltip("The Kokiri are mystical beings that fade into view when approached\nEnabling this will remove their draw distance");
|
UIWidgets::Tooltip("The Kokiri are mystical beings that fade into view when approached\nEnabling this will remove their draw distance");
|
||||||
}
|
}
|
||||||
UIWidgets::PaddedEnhancementCheckbox("Skip Text", "gSkipText", true, false);
|
UIWidgets::PaddedEnhancementCheckbox("Skip Text", "gSkipText", true, false);
|
||||||
UIWidgets::Tooltip("Holding down B skips text\nKnown to cause a cutscene softlock in Water Temple\nSoftlock can be fixed by pressing D-Right in Debug mode");
|
UIWidgets::Tooltip("Holding down B skips text");
|
||||||
UIWidgets::PaddedEnhancementCheckbox("Free Camera", "gFreeCamera", true, false);
|
UIWidgets::PaddedEnhancementCheckbox("Free Camera", "gFreeCamera", true, false);
|
||||||
UIWidgets::Tooltip("Enables camera control\nNote: You must remap C buttons off of the right stick in the controller config menu, and map the camera stick to the right stick.");
|
UIWidgets::Tooltip("Enables camera control\nNote: You must remap C buttons off of the right stick in the controller config menu, and map the camera stick to the right stick.");
|
||||||
|
|
||||||
@@ -1408,12 +1407,7 @@ namespace GameMenuBar {
|
|||||||
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0,0));
|
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0,0));
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f);
|
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f);
|
||||||
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.22f, 0.38f, 0.56f, 1.0f));
|
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.22f, 0.38f, 0.56f, 1.0f));
|
||||||
#ifdef __WIIU__
|
if (ImGui::Button(GetWindowButtonText("Stats", CVar_GetS32("gStatsEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
|
||||||
static ImVec2 buttonSize(160.0f * 2.0f, 0.0f);
|
|
||||||
#else
|
|
||||||
static ImVec2 buttonSize(160.0f, 0.0f);
|
|
||||||
#endif
|
|
||||||
if (ImGui::Button(GetWindowButtonText("Stats", CVar_GetS32("gStatsEnabled", 0)).c_str(), buttonSize))
|
|
||||||
{
|
{
|
||||||
bool currentValue = CVar_GetS32("gStatsEnabled", 0);
|
bool currentValue = CVar_GetS32("gStatsEnabled", 0);
|
||||||
CVar_SetS32("gStatsEnabled", !currentValue);
|
CVar_SetS32("gStatsEnabled", !currentValue);
|
||||||
@@ -1422,7 +1416,7 @@ namespace GameMenuBar {
|
|||||||
}
|
}
|
||||||
UIWidgets::Tooltip("Shows the stats window, with your FPS and frametimes, and the OS you're playing on");
|
UIWidgets::Tooltip("Shows the stats window, with your FPS and frametimes, and the OS you're playing on");
|
||||||
UIWidgets::Spacer(0);
|
UIWidgets::Spacer(0);
|
||||||
if (ImGui::Button(GetWindowButtonText("Console", CVar_GetS32("gConsoleEnabled", 0)).c_str(), buttonSize))
|
if (ImGui::Button(GetWindowButtonText("Console", CVar_GetS32("gConsoleEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
|
||||||
{
|
{
|
||||||
bool currentValue = CVar_GetS32("gConsoleEnabled", 0);
|
bool currentValue = CVar_GetS32("gConsoleEnabled", 0);
|
||||||
CVar_SetS32("gConsoleEnabled", !currentValue);
|
CVar_SetS32("gConsoleEnabled", !currentValue);
|
||||||
@@ -1431,7 +1425,7 @@ namespace GameMenuBar {
|
|||||||
}
|
}
|
||||||
UIWidgets::Tooltip("Enables the console window, allowing you to input commands, type help for some examples");
|
UIWidgets::Tooltip("Enables the console window, allowing you to input commands, type help for some examples");
|
||||||
UIWidgets::Spacer(0);
|
UIWidgets::Spacer(0);
|
||||||
if (ImGui::Button(GetWindowButtonText("Save Editor", CVar_GetS32("gSaveEditorEnabled", 0)).c_str(), buttonSize))
|
if (ImGui::Button(GetWindowButtonText("Save Editor", CVar_GetS32("gSaveEditorEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
|
||||||
{
|
{
|
||||||
bool currentValue = CVar_GetS32("gSaveEditorEnabled", 0);
|
bool currentValue = CVar_GetS32("gSaveEditorEnabled", 0);
|
||||||
CVar_SetS32("gSaveEditorEnabled", !currentValue);
|
CVar_SetS32("gSaveEditorEnabled", !currentValue);
|
||||||
@@ -1439,7 +1433,7 @@ namespace GameMenuBar {
|
|||||||
SohImGui::EnableWindow("Save Editor", CVar_GetS32("gSaveEditorEnabled", 0));
|
SohImGui::EnableWindow("Save Editor", CVar_GetS32("gSaveEditorEnabled", 0));
|
||||||
}
|
}
|
||||||
UIWidgets::Spacer(0);
|
UIWidgets::Spacer(0);
|
||||||
if (ImGui::Button(GetWindowButtonText("Collision Viewer", CVar_GetS32("gCollisionViewerEnabled", 0)).c_str(), buttonSize))
|
if (ImGui::Button(GetWindowButtonText("Collision Viewer", CVar_GetS32("gCollisionViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
|
||||||
{
|
{
|
||||||
bool currentValue = CVar_GetS32("gCollisionViewerEnabled", 0);
|
bool currentValue = CVar_GetS32("gCollisionViewerEnabled", 0);
|
||||||
CVar_SetS32("gCollisionViewerEnabled", !currentValue);
|
CVar_SetS32("gCollisionViewerEnabled", !currentValue);
|
||||||
@@ -1447,7 +1441,7 @@ namespace GameMenuBar {
|
|||||||
SohImGui::EnableWindow("Collision Viewer", CVar_GetS32("gCollisionViewerEnabled", 0));
|
SohImGui::EnableWindow("Collision Viewer", CVar_GetS32("gCollisionViewerEnabled", 0));
|
||||||
}
|
}
|
||||||
UIWidgets::Spacer(0);
|
UIWidgets::Spacer(0);
|
||||||
if (ImGui::Button(GetWindowButtonText("Actor Viewer", CVar_GetS32("gActorViewerEnabled", 0)).c_str(), buttonSize))
|
if (ImGui::Button(GetWindowButtonText("Actor Viewer", CVar_GetS32("gActorViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
|
||||||
{
|
{
|
||||||
bool currentValue = CVar_GetS32("gActorViewerEnabled", 0);
|
bool currentValue = CVar_GetS32("gActorViewerEnabled", 0);
|
||||||
CVar_SetS32("gActorViewerEnabled", !currentValue);
|
CVar_SetS32("gActorViewerEnabled", !currentValue);
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ void SaveManager::LoadRandomizerVersion1() {
|
|||||||
|
|
||||||
std::shared_ptr<Randomizer> randomizer = OTRGlobals::Instance->gRandomizer;
|
std::shared_ptr<Randomizer> randomizer = OTRGlobals::Instance->gRandomizer;
|
||||||
|
|
||||||
|
randomizer->LoadRandomizerSettings("");
|
||||||
size_t merchantPricesSize = 0;
|
size_t merchantPricesSize = 0;
|
||||||
if (randomizer->GetRandoSettingValue(RSK_SHUFFLE_SCRUBS) > 0) {
|
if (randomizer->GetRandoSettingValue(RSK_SHUFFLE_SCRUBS) > 0) {
|
||||||
merchantPricesSize += NUM_SCRUBS;
|
merchantPricesSize += NUM_SCRUBS;
|
||||||
|
|||||||
+1
-1
@@ -370,7 +370,7 @@ void GameState_Update(GameState* gameState) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Bombchus (max: 50, no upgrades)
|
// Bombchus (max: 50, no upgrades)
|
||||||
if (AMMO(ITEM_BOMBCHU) < 50) {
|
if (INV_CONTENT(ITEM_BOMBCHU) == ITEM_BOMBCHU && AMMO(ITEM_BOMBCHU) < 50) {
|
||||||
AMMO(ITEM_BOMBCHU) = 50;
|
AMMO(ITEM_BOMBCHU) = 50;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2484,13 +2484,6 @@ u8 Item_CheckObtainability(u8 item) {
|
|||||||
} else {
|
} else {
|
||||||
return ITEM_NONE;
|
return ITEM_NONE;
|
||||||
}
|
}
|
||||||
} else if ( gSaveContext.n64ddFlag &&
|
|
||||||
((item >= RG_GERUDO_FORTRESS_SMALL_KEY) && (item <= RG_GANONS_CASTLE_SMALL_KEY) ||
|
|
||||||
(item >= RG_FOREST_TEMPLE_BOSS_KEY) && (item <= RG_GANONS_CASTLE_BOSS_KEY) ||
|
|
||||||
(item >= RG_DEKU_TREE_MAP) && (item <= RG_ICE_CAVERN_MAP) ||
|
|
||||||
(item >= RG_DEKU_TREE_COMPASS) && (item <= RG_ICE_CAVERN_COMPASS))
|
|
||||||
) {
|
|
||||||
return ITEM_NONE;
|
|
||||||
} else if ((item == ITEM_KEY_BOSS) || (item == ITEM_COMPASS) || (item == ITEM_DUNGEON_MAP)) {
|
} else if ((item == ITEM_KEY_BOSS) || (item == ITEM_COMPASS) || (item == ITEM_DUNGEON_MAP)) {
|
||||||
return ITEM_NONE;
|
return ITEM_NONE;
|
||||||
} else if (item == ITEM_KEY_SMALL) {
|
} else if (item == ITEM_KEY_SMALL) {
|
||||||
|
|||||||
@@ -2006,7 +2006,7 @@ s32 func_800C0DB4(GlobalContext* globalCtx, Vec3f* pos) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Gameplay_PerformSave(GlobalContext* globalCtx) {
|
void Gameplay_PerformSave(GlobalContext* globalCtx) {
|
||||||
if (globalCtx != NULL) {
|
if (globalCtx != NULL && gSaveContext.fileNum != 0xFF) {
|
||||||
Gameplay_SaveSceneFlags(globalCtx);
|
Gameplay_SaveSceneFlags(globalCtx);
|
||||||
gSaveContext.savedSceneNum = globalCtx->sceneNum;
|
gSaveContext.savedSceneNum = globalCtx->sceneNum;
|
||||||
if (gSaveContext.temporaryWeapon) {
|
if (gSaveContext.temporaryWeapon) {
|
||||||
|
|||||||
@@ -1242,8 +1242,12 @@ void LinkAnimation_Change(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAn
|
|||||||
if (ResourceMgr_OTRSigCheck(animation) != 0)
|
if (ResourceMgr_OTRSigCheck(animation) != 0)
|
||||||
animation = ResourceMgr_LoadAnimByName(animation);
|
animation = ResourceMgr_LoadAnimByName(animation);
|
||||||
|
|
||||||
|
AnimationHeader* currentAnimation = (AnimationHeader*)skelAnime->animation;
|
||||||
|
if (ResourceMgr_OTRSigCheck(currentAnimation) != 0)
|
||||||
|
currentAnimation = ResourceMgr_LoadAnimByName(currentAnimation);
|
||||||
|
|
||||||
skelAnime->mode = mode;
|
skelAnime->mode = mode;
|
||||||
if ((morphFrames != 0.0f) && ((animation != skelAnime->animation) || (startFrame != skelAnime->curFrame))) {
|
if ((morphFrames != 0.0f) && ((animation != currentAnimation) || (startFrame != skelAnime->curFrame))) {
|
||||||
if (morphFrames < 0) {
|
if (morphFrames < 0) {
|
||||||
LinkAnimation_SetUpdateFunction(skelAnime);
|
LinkAnimation_SetUpdateFunction(skelAnime);
|
||||||
SkelAnime_CopyFrameTable(skelAnime, skelAnime->morphTable, skelAnime->jointTable);
|
SkelAnime_CopyFrameTable(skelAnime, skelAnime->morphTable, skelAnime->jointTable);
|
||||||
@@ -1687,8 +1691,17 @@ s32 SkelAnime_Once(SkelAnime* skelAnime) {
|
|||||||
*/
|
*/
|
||||||
void Animation_ChangeImpl(SkelAnime* skelAnime, AnimationHeader* animation, f32 playSpeed, f32 startFrame, f32 endFrame,
|
void Animation_ChangeImpl(SkelAnime* skelAnime, AnimationHeader* animation, f32 playSpeed, f32 startFrame, f32 endFrame,
|
||||||
u8 mode, f32 morphFrames, s8 taper) {
|
u8 mode, f32 morphFrames, s8 taper) {
|
||||||
|
LinkAnimationHeader* ogAnim = animation;
|
||||||
|
|
||||||
|
if (ResourceMgr_OTRSigCheck(animation) != 0)
|
||||||
|
animation = ResourceMgr_LoadAnimByName(animation);
|
||||||
|
|
||||||
|
AnimationHeader* currentAnimation = (AnimationHeader*)skelAnime->animation;
|
||||||
|
if (ResourceMgr_OTRSigCheck(currentAnimation) != 0)
|
||||||
|
currentAnimation = ResourceMgr_LoadAnimByName(currentAnimation);
|
||||||
|
|
||||||
skelAnime->mode = mode;
|
skelAnime->mode = mode;
|
||||||
if ((morphFrames != 0.0f) && ((animation != skelAnime->animation) || (startFrame != skelAnime->curFrame))) {
|
if ((morphFrames != 0.0f) && ((animation != currentAnimation) || (startFrame != skelAnime->curFrame))) {
|
||||||
if (morphFrames < 0) {
|
if (morphFrames < 0) {
|
||||||
SkelAnime_SetUpdate(skelAnime);
|
SkelAnime_SetUpdate(skelAnime);
|
||||||
SkelAnime_CopyFrameTable(skelAnime, skelAnime->morphTable, skelAnime->jointTable);
|
SkelAnime_CopyFrameTable(skelAnime, skelAnime->morphTable, skelAnime->jointTable);
|
||||||
@@ -1710,7 +1723,7 @@ void Animation_ChangeImpl(SkelAnime* skelAnime, AnimationHeader* animation, f32
|
|||||||
skelAnime->morphWeight = 0.0f;
|
skelAnime->morphWeight = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
skelAnime->animation = animation;
|
skelAnime->animation = ogAnim;
|
||||||
skelAnime->startFrame = startFrame;
|
skelAnime->startFrame = startFrame;
|
||||||
skelAnime->endFrame = endFrame;
|
skelAnime->endFrame = endFrame;
|
||||||
skelAnime->animLength = Animation_GetLength(animation);
|
skelAnime->animLength = Animation_GetLength(animation);
|
||||||
|
|||||||
@@ -577,6 +577,14 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) {
|
|||||||
BossGanon2_SetObjectSegment(this, globalCtx, OBJECT_GANON_ANIME3, false);
|
BossGanon2_SetObjectSegment(this, globalCtx, OBJECT_GANON_ANIME3, false);
|
||||||
func_8002DF54(globalCtx, &this->actor, 0x54);
|
func_8002DF54(globalCtx, &this->actor, 0x54);
|
||||||
this->unk_314 = 3;
|
this->unk_314 = 3;
|
||||||
|
|
||||||
|
// At this point, the actor has Ganon's skeleton but is still playing an animation for Ganondorf. This
|
||||||
|
// causes issues when trying to access the limb posotions as Ganon has more limbs than Ganondorf. When
|
||||||
|
// animating, data from past the end of the animation data is accessed. This is a hack solution so
|
||||||
|
// that we are at least playing an animation meant for Ganon. There is no visible change since Ganon is
|
||||||
|
// off-screen. There is actually 1 frame where he is visible, and in the vanilla game he is an
|
||||||
|
// explosion of limbs since half of them are in random positions from the junk data accessed.
|
||||||
|
Animation_PlayOnce(&this->skelAnime, &gGanonUncurlAndFlailAnim);
|
||||||
}
|
}
|
||||||
// fake, tricks the compiler into using stack the way we need it to
|
// fake, tricks the compiler into using stack the way we need it to
|
||||||
if (zero) {
|
if (zero) {
|
||||||
|
|||||||
@@ -249,28 +249,30 @@ s32 EnGe3_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
|
|||||||
case GELDB_LIMB_HEAD:
|
case GELDB_LIMB_HEAD:
|
||||||
rot->x += this->headRot.y;
|
rot->x += this->headRot.y;
|
||||||
|
|
||||||
// This is a hack to fix the color-changing clothes this Gerudo has on N64 versions
|
|
||||||
default:
|
default:
|
||||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
if (CVar_GetS32("gGerudoWarriorClothingFix", 0)) {
|
||||||
switch (limbIndex) {
|
// This is a hack to fix the color-changing clothes this Gerudo has on N64 versions
|
||||||
case GELDB_LIMB_NECK:
|
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||||
break;
|
switch (limbIndex) {
|
||||||
case GELDB_LIMB_HEAD:
|
case GELDB_LIMB_NECK:
|
||||||
gDPPipeSync(POLY_OPA_DISP++);
|
break;
|
||||||
gDPSetEnvColor(POLY_OPA_DISP++, 80, 60, 10, 255);
|
case GELDB_LIMB_HEAD:
|
||||||
break;
|
gDPPipeSync(POLY_OPA_DISP++);
|
||||||
case GELDB_LIMB_R_SWORD:
|
gDPSetEnvColor(POLY_OPA_DISP++, 80, 60, 10, 255);
|
||||||
case GELDB_LIMB_L_SWORD:
|
break;
|
||||||
gDPPipeSync(POLY_OPA_DISP++);
|
case GELDB_LIMB_R_SWORD:
|
||||||
gDPSetEnvColor(POLY_OPA_DISP++, 140, 170, 230, 255);
|
case GELDB_LIMB_L_SWORD:
|
||||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255);
|
gDPPipeSync(POLY_OPA_DISP++);
|
||||||
break;
|
gDPSetEnvColor(POLY_OPA_DISP++, 140, 170, 230, 255);
|
||||||
default:
|
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255);
|
||||||
gDPPipeSync(POLY_OPA_DISP++);
|
break;
|
||||||
gDPSetEnvColor(POLY_OPA_DISP++, 140, 0, 0, 255);
|
default:
|
||||||
break;
|
gDPPipeSync(POLY_OPA_DISP++);
|
||||||
|
gDPSetEnvColor(POLY_OPA_DISP++, 140, 0, 0, 255);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||||
}
|
}
|
||||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1348,6 +1348,11 @@ void EnGo2_RollingAnimation(EnGo2* this, GlobalContext* globalCtx) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void EnGo2_WakeUp(EnGo2* this, GlobalContext* globalCtx) {
|
void EnGo2_WakeUp(EnGo2* this, GlobalContext* globalCtx) {
|
||||||
|
if (CVar_GetS32("gUnfixGoronSpin", 0)) {
|
||||||
|
// Trick SkelAnime into thinking the current animation is changing so that it morphs between the same position,
|
||||||
|
// making the goron do a spin
|
||||||
|
this->skelAnime.animation = NULL;
|
||||||
|
}
|
||||||
if (this->skelAnime.playSpeed == 0.0f) {
|
if (this->skelAnime.playSpeed == 0.0f) {
|
||||||
if ((this->actor.params & 0x1F) != GORON_DMT_BIGGORON) {
|
if ((this->actor.params & 0x1F) != GORON_DMT_BIGGORON) {
|
||||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_WAKE_UP);
|
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_WAKE_UP);
|
||||||
|
|||||||
@@ -401,7 +401,7 @@ void func_80ABA9B8(EnNiwLady* this, GlobalContext* globalCtx) {
|
|||||||
} else {
|
} else {
|
||||||
// TODO: get-item-rework Adult trade sequence
|
// TODO: get-item-rework Adult trade sequence
|
||||||
this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_ANJU_AS_ADULT, GI_POCKET_EGG);
|
this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_ANJU_AS_ADULT, GI_POCKET_EGG);
|
||||||
GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, 200.0f, 100.0f);
|
gSaveContext.itemGetInf[2] |= 0x1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->actionFunc = func_80ABAC00;
|
this->actionFunc = func_80ABAC00;
|
||||||
@@ -431,7 +431,14 @@ void func_80ABAB08(EnNiwLady* this, GlobalContext* globalCtx) {
|
|||||||
case 0:
|
case 0:
|
||||||
Message_CloseTextbox(globalCtx);
|
Message_CloseTextbox(globalCtx);
|
||||||
this->actor.parent = NULL;
|
this->actor.parent = NULL;
|
||||||
func_8002F434(&this->actor, globalCtx, GI_COJIRO, 200.0f, 100.0f);
|
if (!gSaveContext.n64ddFlag) {
|
||||||
|
func_8002F434(&this->actor, globalCtx, GI_COJIRO, 200.0f, 100.0f);
|
||||||
|
} else {
|
||||||
|
// TODO: get-item-rework Adult trade sequence
|
||||||
|
this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_TRADE_POCKET_CUCCO, GI_COJIRO);
|
||||||
|
Randomizer_ConsumeAdultTradeItem(globalCtx, ITEM_POCKET_CUCCO);
|
||||||
|
gSaveContext.itemGetInf[2] |= 0x4000;
|
||||||
|
}
|
||||||
this->actionFunc = func_80ABAC00;
|
this->actionFunc = func_80ABAC00;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
@@ -455,18 +462,14 @@ void func_80ABAC00(EnNiwLady* this, GlobalContext* globalCtx) {
|
|||||||
} else {
|
} else {
|
||||||
getItemId = this->getItemId;
|
getItemId = this->getItemId;
|
||||||
if (LINK_IS_ADULT) {
|
if (LINK_IS_ADULT) {
|
||||||
getItemId = !(gSaveContext.itemGetInf[2] & 0x1000) ? GI_POCKET_EGG : GI_COJIRO;
|
if (!gSaveContext.n64ddFlag) {
|
||||||
|
getItemId = !(gSaveContext.itemGetInf[2] & 0x1000) ? GI_POCKET_EGG : GI_COJIRO;
|
||||||
if (gSaveContext.n64ddFlag) {
|
} else {
|
||||||
if (getItemId == GI_POCKET_EGG) {
|
// TODO: get-item-rework Adult trade sequence
|
||||||
// TODO: get-item-rework Adult trade sequence
|
getItemId = this->getItemEntry.getItemId;
|
||||||
this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_ANJU_AS_ADULT, GI_POCKET_EGG);
|
GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, 200.0f, 100.0f);
|
||||||
GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, 200.0f, 100.0f);
|
// Skip setting item flags because that was done earlier
|
||||||
} else {
|
this->actionFunc = func_80ABA778;
|
||||||
this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_TRADE_POCKET_CUCCO, GI_COJIRO);
|
|
||||||
Randomizer_ConsumeAdultTradeItem(globalCtx, ITEM_POCKET_CUCCO);
|
|
||||||
GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, 200.0f, 100.0f);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this->getItemEntry.getItemId == GI_NONE) {
|
if (this->getItemEntry.getItemId == GI_NONE) {
|
||||||
|
|||||||
@@ -634,13 +634,13 @@ s32 func_80AF383C(EnRu2* this, GlobalContext* globalCtx) {
|
|||||||
void func_80AF3878(EnRu2* this, GlobalContext* globalCtx) {
|
void func_80AF3878(EnRu2* this, GlobalContext* globalCtx) {
|
||||||
if (func_80AF383C(this, globalCtx) && !Gameplay_InCsMode(globalCtx)) {
|
if (func_80AF383C(this, globalCtx) && !Gameplay_InCsMode(globalCtx)) {
|
||||||
this->action = 16;
|
this->action = 16;
|
||||||
OnePointCutscene_Init(globalCtx, 3130, -99, &this->actor, MAIN_CAM);
|
this->subCamId = OnePointCutscene_Init(globalCtx, 3130, -99, &this->actor, MAIN_CAM);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80AF38D0(EnRu2* this, GlobalContext* globalCtx) {
|
void func_80AF38D0(EnRu2* this, GlobalContext* globalCtx) {
|
||||||
this->action = 16;
|
this->action = 16;
|
||||||
OnePointCutscene_Init(globalCtx, 3130, -99, &this->actor, MAIN_CAM);
|
this->subCamId = OnePointCutscene_Init(globalCtx, 3130, -99, &this->actor, MAIN_CAM);
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80AF390C(EnRu2* this, GlobalContext* globalCtx) {
|
void func_80AF390C(EnRu2* this, GlobalContext* globalCtx) {
|
||||||
@@ -703,6 +703,7 @@ void func_80AF3ADC(EnRu2* this, GlobalContext* globalCtx) {
|
|||||||
void func_80AF3B74(EnRu2* this, GlobalContext* globalCtx) {
|
void func_80AF3B74(EnRu2* this, GlobalContext* globalCtx) {
|
||||||
if (this->unk_2C0 > ((((u16)(kREG(3) + 0x28)) + ((u16)(kREG(2) + 0x96))) & 0xFFFF)) {
|
if (this->unk_2C0 > ((((u16)(kREG(3) + 0x28)) + ((u16)(kREG(2) + 0x96))) & 0xFFFF)) {
|
||||||
Actor_Kill(&this->actor);
|
Actor_Kill(&this->actor);
|
||||||
|
OnePointCutscene_EndCutscene(globalCtx, this->subCamId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -789,6 +790,7 @@ void EnRu2_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||||||
|
|
||||||
this->unk_2C2 = 0;
|
this->unk_2C2 = 0;
|
||||||
this->unk_2C3 = TEXT_STATE_DONE_FADING;
|
this->unk_2C3 = TEXT_STATE_DONE_FADING;
|
||||||
|
this->subCamId = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80AF3F14(EnRu2* this, GlobalContext* globalCtx) {
|
void func_80AF3F14(EnRu2* this, GlobalContext* globalCtx) {
|
||||||
@@ -818,6 +820,19 @@ void func_80AF3F20(EnRu2* this, GlobalContext* globalCtx) {
|
|||||||
void EnRu2_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
void EnRu2_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||||
EnRu2* this = (EnRu2*)thisx;
|
EnRu2* this = (EnRu2*)thisx;
|
||||||
|
|
||||||
|
// FAST3D: This is a hack for the issue of both TEXEL0 and TEXEL1 using the same texture with different settings.
|
||||||
|
// Ruto's earring uses both TEXEL0 and TEXEL1 to render. The issue is that it never loads anything into TEXEL1, so
|
||||||
|
// it reuses whatever happens to be there, which is the water temple brick texture. It just so happens that the
|
||||||
|
// earring texture loads into the same place in tmem as the brick texture, so when it comes to rendering, TEXEL1
|
||||||
|
// uses the earring texture with diffrent clamp settings, and it displays without noticeable error. However, both
|
||||||
|
// texel samplers are not intended to be used for the same texture with different settings, so this misuse confuses
|
||||||
|
// our texture cache, and we load the wrong settings for the earrings texture. This patch is a hack that replaces
|
||||||
|
// TEXEL1 with TEXEL0, which is most likely the original intention, and all is well.
|
||||||
|
Gfx* gfx = ResourceMgr_LoadGfxByName(gAdultRutoHeadDL);
|
||||||
|
Gfx patch = gsDPSetCombineLERP(TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, ENVIRONMENT, 0, 0, 0, 0, COMBINED, TEXEL0, 0,
|
||||||
|
PRIM_LOD_FRAC, COMBINED);
|
||||||
|
gfx[0xA2] = patch;
|
||||||
|
|
||||||
if ((this->drawConfig < 0) || (this->drawConfig >= ARRAY_COUNT(sDrawFuncs)) ||
|
if ((this->drawConfig < 0) || (this->drawConfig >= ARRAY_COUNT(sDrawFuncs)) ||
|
||||||
(sDrawFuncs[this->drawConfig] == 0)) {
|
(sDrawFuncs[this->drawConfig] == 0)) {
|
||||||
// "Draw Mode is improper!"
|
// "Draw Mode is improper!"
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ typedef struct EnRu2 {
|
|||||||
/* 0x02C3 */ u8 unk_2C3;
|
/* 0x02C3 */ u8 unk_2C3;
|
||||||
/* 0x02C4 */ f32 unk_2C4;
|
/* 0x02C4 */ f32 unk_2C4;
|
||||||
/* 0x02C8 */ ColliderCylinder collider;
|
/* 0x02C8 */ ColliderCylinder collider;
|
||||||
|
/* 0x02C8 */ s16 subCamId;
|
||||||
} EnRu2; // size = 0x0314
|
} EnRu2; // size = 0x0314
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -6246,23 +6246,27 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 drop = giEntry.objectId;
|
// Show the cutscene for picking up an item. In vanilla, this happens in bombchu bowling alley (because getting bombchus need to show the cutscene)
|
||||||
|
// and whenever the player doesn't have the item yet. In rando, we're overruling this because we need to keep showing the cutscene
|
||||||
|
// because those items can be randomized and thus it's important to keep showing the cutscene.
|
||||||
|
uint8_t showItemCutscene = globalCtx->sceneNum == SCENE_BOWLING || Item_CheckObtainability(giEntry.itemId) == ITEM_NONE || gSaveContext.n64ddFlag;
|
||||||
|
|
||||||
if (gSaveContext.n64ddFlag || (globalCtx->sceneNum == SCENE_BOWLING) ||
|
// Only skip cutscenes for drops when they're items/consumables from bushes/rocks/enemies.
|
||||||
!(CVar_GetS32("gFastDrops", 0) &&
|
uint8_t isDropToSkip = (interactedActor->id == ACTOR_EN_ITEM00 && interactedActor->params != 6 && interactedActor->params != 17) ||
|
||||||
((drop == OBJECT_GI_BOMB_1) || (drop == OBJECT_GI_NUTS) || (drop == OBJECT_GI_STICK) ||
|
interactedActor->id == ACTOR_EN_KAREBABA ||
|
||||||
(drop == OBJECT_GI_SEED) || (drop == OBJECT_GI_MAGICPOT) || (drop == OBJECT_GI_ARROW))) &&
|
interactedActor->id == ACTOR_EN_DEKUBABA;
|
||||||
(Item_CheckObtainability(giEntry.itemId) == ITEM_NONE)) {
|
|
||||||
|
|
||||||
if (gSaveContext.n64ddFlag &&
|
// Skip cutscenes from picking up consumables with "Fast Pickup Text" enabled, even when the player never picked it up before.
|
||||||
((interactedActor->id == ACTOR_EN_ITEM00 &&
|
// But only for bushes/rocks/enemies because otherwise it can lead to softlocks in deku mask theatre and potentially other places.
|
||||||
(interactedActor->params != 6 && interactedActor->params != 17)) ||
|
uint8_t skipItemCutscene = CVar_GetS32("gFastDrops", 0) && isDropToSkip;
|
||||||
(interactedActor->id == ACTOR_EN_KAREBABA || interactedActor->id == ACTOR_EN_DEKUBABA))) {
|
|
||||||
func_8083E4C4(globalCtx, this, &giEntry);
|
// Same as above but for rando. Rando is different because we want to enable cutscenes for items that the player already has because
|
||||||
this->getItemId = GI_NONE;
|
// those items could be a randomized item coming from scrubs, freestanding PoH's and keys. So we need to once again overrule
|
||||||
this->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
// this specifically for items coming from bushes/rocks/enemies when the player has already picked that item up.
|
||||||
return 0;
|
uint8_t skipItemCutsceneRando = gSaveContext.n64ddFlag && Item_CheckObtainability(giEntry.itemId) != ITEM_NONE && isDropToSkip;
|
||||||
}
|
|
||||||
|
// Show cutscene when picking up a item.
|
||||||
|
if (showItemCutscene && !skipItemCutscene && !skipItemCutsceneRando) {
|
||||||
|
|
||||||
func_808323B4(globalCtx, this);
|
func_808323B4(globalCtx, this);
|
||||||
func_8083AE40(this, giEntry.objectId);
|
func_8083AE40(this, giEntry.objectId);
|
||||||
@@ -6278,6 +6282,7 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't show cutscene when picking up an item.
|
||||||
func_8083E4C4(globalCtx, this, &giEntry);
|
func_8083E4C4(globalCtx, this, &giEntry);
|
||||||
this->getItemId = GI_NONE;
|
this->getItemId = GI_NONE;
|
||||||
this->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
this->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||||
@@ -10967,11 +10972,14 @@ void Player_DrawGameplay(GlobalContext* globalCtx, Player* this, s32 lod, Gfx* c
|
|||||||
this);
|
this);
|
||||||
|
|
||||||
if ((overrideLimbDraw == func_80090014) && (this->currentMask != PLAYER_MASK_NONE)) {
|
if ((overrideLimbDraw == func_80090014) && (this->currentMask != PLAYER_MASK_NONE)) {
|
||||||
|
// Fixes a bug in vanilla where ice traps are rendered extremely large while wearing a bunny hood
|
||||||
|
if (CVar_GetS32("gFixIceTrapWithBunnyHood", 1)) Matrix_Push();
|
||||||
Mtx* sp70 = Graph_Alloc(globalCtx->state.gfxCtx, 2 * sizeof(Mtx));
|
Mtx* sp70 = Graph_Alloc(globalCtx->state.gfxCtx, 2 * sizeof(Mtx));
|
||||||
|
|
||||||
if (this->currentMask == PLAYER_MASK_BUNNY) {
|
if (this->currentMask == PLAYER_MASK_BUNNY) {
|
||||||
Vec3s sp68;
|
Vec3s sp68;
|
||||||
|
|
||||||
|
FrameInterpolation_RecordActorPosRotMatrix();
|
||||||
gSPSegment(POLY_OPA_DISP++, 0x0B, sp70);
|
gSPSegment(POLY_OPA_DISP++, 0x0B, sp70);
|
||||||
|
|
||||||
sp68.x = D_80858AC8.unk_02 + 0x3E2;
|
sp68.x = D_80858AC8.unk_02 + 0x3E2;
|
||||||
@@ -10988,6 +10996,7 @@ void Player_DrawGameplay(GlobalContext* globalCtx, Player* this, s32 lod, Gfx* c
|
|||||||
}
|
}
|
||||||
|
|
||||||
gSPDisplayList(POLY_OPA_DISP++, sMaskDlists[this->currentMask - 1]);
|
gSPDisplayList(POLY_OPA_DISP++, sMaskDlists[this->currentMask - 1]);
|
||||||
|
if (CVar_GetS32("gFixIceTrapWithBunnyHood", 1)) Matrix_Pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((this->currentBoots == PLAYER_BOOTS_HOVER) && !(this->actor.bgCheckFlags & 1) &&
|
if ((this->currentBoots == PLAYER_BOOTS_HOVER) && !(this->actor.bgCheckFlags & 1) &&
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ void Opening_SetupTitleScreen(OpeningContext* this) {
|
|||||||
gSaveContext.gameMode = 1;
|
gSaveContext.gameMode = 1;
|
||||||
this->state.running = false;
|
this->state.running = false;
|
||||||
gSaveContext.linkAge = 0;
|
gSaveContext.linkAge = 0;
|
||||||
|
gSaveContext.fileNum = 0xFF;
|
||||||
Sram_InitDebugSave();
|
Sram_InitDebugSave();
|
||||||
gSaveContext.cutsceneIndex = 0xFFF3;
|
gSaveContext.cutsceneIndex = 0xFFF3;
|
||||||
gSaveContext.sceneSetupIndex = 7;
|
gSaveContext.sceneSetupIndex = 7;
|
||||||
|
|||||||
@@ -307,6 +307,7 @@ void Title_Init(GameState* thisx) {
|
|||||||
Randomizer_LoadSettings("");
|
Randomizer_LoadSettings("");
|
||||||
Randomizer_LoadHintLocations("");
|
Randomizer_LoadHintLocations("");
|
||||||
Randomizer_LoadItemLocations("", true);
|
Randomizer_LoadItemLocations("", true);
|
||||||
|
Randomizer_LoadMerchantMessages("");
|
||||||
gSaveContext.gameMode = 0;
|
gSaveContext.gameMode = 0;
|
||||||
gSaveContext.magic = gSaveContext.magic;
|
gSaveContext.magic = gSaveContext.magic;
|
||||||
SET_NEXT_GAMESTATE(&this->state, Gameplay_Init, GlobalContext);
|
SET_NEXT_GAMESTATE(&this->state, Gameplay_Init, GlobalContext);
|
||||||
|
|||||||
@@ -381,7 +381,8 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) {
|
|||||||
--INV_CONTENT(ITEM_TRADE_CHILD);
|
--INV_CONTENT(ITEM_TRADE_CHILD);
|
||||||
} else if ((pauseCtx->stickRelX < -30 || pauseCtx->stickRelX > 30 || pauseCtx->stickRelY < -30 || pauseCtx->stickRelY > 30) ||
|
} else if ((pauseCtx->stickRelX < -30 || pauseCtx->stickRelX > 30 || pauseCtx->stickRelY < -30 || pauseCtx->stickRelY > 30) ||
|
||||||
dpad && CHECK_BTN_ANY(input->press.button, BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT)) {
|
dpad && CHECK_BTN_ANY(input->press.button, BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT)) {
|
||||||
if (INV_CONTENT(ITEM_TRADE_CHILD) == ITEM_LETTER_ZELDA) {
|
// Change to keaton mask if no mask is in child trade slot. Catches Zelda's letter and bottle duping over this slot.
|
||||||
|
if (INV_CONTENT(ITEM_TRADE_CHILD) < ITEM_MASK_KEATON || INV_CONTENT(ITEM_TRADE_CHILD) > ITEM_MASK_TRUTH) {
|
||||||
INV_CONTENT(ITEM_TRADE_CHILD) = ITEM_MASK_KEATON;
|
INV_CONTENT(ITEM_TRADE_CHILD) = ITEM_MASK_KEATON;
|
||||||
} else {
|
} else {
|
||||||
INV_CONTENT(ITEM_TRADE_CHILD) ^= ITEM_MASK_KEATON ^ ITEM_MASK_TRUTH;
|
INV_CONTENT(ITEM_TRADE_CHILD) ^= ITEM_MASK_KEATON ^ ITEM_MASK_TRUTH;
|
||||||
|
|||||||
@@ -1134,6 +1134,7 @@ void KaleidoScope_DrawPages(GlobalContext* globalCtx, GraphicsContext* gfxCtx) {
|
|||||||
static s16 D_8082AD48 = 0;
|
static s16 D_8082AD48 = 0;
|
||||||
static s16 D_8082AD4C = 0;
|
static s16 D_8082AD4C = 0;
|
||||||
static s16 D_8082AD50 = 0;
|
static s16 D_8082AD50 = 0;
|
||||||
|
const Color_RGB8 A_cursor = CVar_GetRGB("gCCABtnPrim", A_BTN_ori);
|
||||||
PauseContext* pauseCtx = &globalCtx->pauseCtx;
|
PauseContext* pauseCtx = &globalCtx->pauseCtx;
|
||||||
Input* input = &globalCtx->state.input[0];
|
Input* input = &globalCtx->state.input[0];
|
||||||
s16 stepR;
|
s16 stepR;
|
||||||
@@ -1508,7 +1509,7 @@ void KaleidoScope_DrawPages(GlobalContext* globalCtx, GraphicsContext* gfxCtx) {
|
|||||||
} else if (CVar_GetS32("gHudColors", 1) == 1) {
|
} else if (CVar_GetS32("gHudColors", 1) == 1) {
|
||||||
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 100, 255, 100, VREG(61));
|
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 100, 255, 100, VREG(61));
|
||||||
} else if (CVar_GetS32("gHudColors", 1) == 2) {
|
} else if (CVar_GetS32("gHudColors", 1) == 2) {
|
||||||
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetRGB("gCCABtnPrim", A_BTN_ori).r, CVar_GetRGB("gCCABtnPrim", A_BTN_ori).g, CVar_GetRGB("gCCABtnPrim", A_BTN_ori).b, VREG(61)); //Save prompt cursor colour
|
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, A_cursor.r, A_cursor.g, A_cursor.b, VREG(61)); //Save prompt cursor colour
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pauseCtx->promptChoice == 0) {
|
if (pauseCtx->promptChoice == 0) {
|
||||||
@@ -1533,7 +1534,13 @@ void KaleidoScope_DrawPages(GlobalContext* globalCtx, GraphicsContext* gfxCtx) {
|
|||||||
|
|
||||||
gDPSetCombineLERP(POLY_KAL_DISP++, 1, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, 1, 0, PRIMITIVE, 0,
|
gDPSetCombineLERP(POLY_KAL_DISP++, 1, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, 1, 0, PRIMITIVE, 0,
|
||||||
TEXEL0, 0, PRIMITIVE, 0);
|
TEXEL0, 0, PRIMITIVE, 0);
|
||||||
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 100, 255, 100, VREG(61));
|
if (CVar_GetS32("gHudColors", 1) == 0) { //Continue prompt cursor colour
|
||||||
|
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 100, 100, 255, VREG(61));
|
||||||
|
} else if (CVar_GetS32("gHudColors", 1) == 1) {
|
||||||
|
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 100, 255, 100, VREG(61));
|
||||||
|
} else if (CVar_GetS32("gHudColors", 1) == 2) {
|
||||||
|
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, A_cursor.r, A_cursor.g, A_cursor.b, VREG(61)); //Continue prompt cursor colour
|
||||||
|
}
|
||||||
|
|
||||||
if (pauseCtx->promptChoice == 0) {
|
if (pauseCtx->promptChoice == 0) {
|
||||||
gSPDisplayList(POLY_KAL_DISP++, gPromptCursorLeftDL);
|
gSPDisplayList(POLY_KAL_DISP++, gPromptCursorLeftDL);
|
||||||
|
|||||||
Reference in New Issue
Block a user