small cleanup to progress-draw.gc and set-font-color (#2653)

This commit is contained in:
ManDude
2023-05-15 20:45:28 +01:00
committed by GitHub
parent e30ecb361f
commit cf048a9e37
65 changed files with 1622 additions and 1498 deletions
+1 -1
View File
@@ -393,7 +393,7 @@ TP_Type SimpleExpression::get_type_int2(const TypeState& input,
int size = 64 - m_args[1].get_int();
int start_bit = end_bit - size;
if (start_bit < 0) {
throw std::runtime_error("Bad bitfield start bit");
throw std::runtime_error("get_type_int2: Bad bitfield start bit");
}
auto type = dts.ts.lookup_type(arg0_type.get_bitfield_type());
+17 -4
View File
@@ -489,18 +489,31 @@ FormElement* BitfieldAccessElement::push_step(const BitfieldManip step,
int size = 64 - step.amount;
int start_bit = end_bit - size;
bool neg = false;
if (start_bit < 0) {
throw std::runtime_error("Bad bitfield start bit");
// throw std::runtime_error("push_step: Bad bitfield start bit");
size += start_bit;
start_bit = 0;
neg = true;
}
auto type = ts.lookup_type(m_type);
auto as_bitfield = dynamic_cast<BitFieldType*>(type);
ASSERT(as_bitfield);
auto field = find_field(ts, as_bitfield, start_bit, size, is_unsigned);
auto result =
auto deref =
pool.alloc_element<DerefElement>(m_base, false, DerefToken::make_field_name(field.name()));
result->inline_nested();
return result;
deref->inline_nested();
if (neg) {
ASSERT(is_unsigned);
auto result = pool.alloc_element<GenericElement>(
GenericOperator::make_fixed(FixedOperatorKind::SHL),
pool.form<CastElement>(TypeSpec("int"), pool.alloc_single_form(nullptr, deref)),
pool.form<SimpleAtomElement>(SimpleAtom::make_int_constant(64 - step.amount)));
return result;
} else {
return deref;
}
}
if (m_steps.empty() && step.kind == BitfieldManip::Kind::LOGAND_WITH_CONSTANT_INT) {
+15 -15
View File
@@ -6455,7 +6455,7 @@
(define-extern *font-default-matrix* matrix)
(define-extern *font-work* font-work)
(define-extern font-set-tex0 (function (pointer gs-tex0) texture int int int none))
(define-extern set-font-color (function int int int int int none))
(define-extern set-font-color (function font-color int rgba rgba rgba int))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; decomp-h ;;
@@ -21931,7 +21931,7 @@
:flag-assert #xc00000030
(:methods
(respond-progress "Handle progress menu navigation logic." (_type_ progress object) int :behavior progress 9)
(menu-option-method-10 (_type_ progress font-context int symbol) none 10)
(draw-option (_type_ progress font-context int symbol) none 10)
(menu-option-method-11 () none 11)
)
)
@@ -26884,7 +26884,7 @@
in a single text group and file."
(function int none))
(define-extern draw-debug-text-box "Draws some lines" (function font-context none))
(define-extern print-game-text-scaled "Print text, with a given scaling" (function string float font-context int none))
(define-extern print-game-text-scaled "Print text, with a given scaling" (function string float font-context bucket-id none))
(define-extern print-game-text "Print text." (function string font-context symbol int bucket-id float))
(define-extern disable-level-text-file-loading "Disables [[*level-text-file-load-flag*]]" (function none))
(define-extern enable-level-text-file-loading "Disables [[*level-text-file-load-flag*]]" (function none))
@@ -30849,24 +30849,24 @@
:flag-assert #x900000028
)
(define-extern progress-selected (function int int :behavior progress))
(define-extern draw-percent-bar (function int int float rgba none)) ;;
(define-extern progress-selected (function int font-color :behavior progress))
(define-extern draw-percent-bar (function int int float rgba none))
(define-extern draw-highlight (function int int float pointer))
(define-extern draw-busy-loading (function font-context float :behavior progress))
(define-extern draw-previous-next (function menu-highscores-option font-context symbol none))
(define-extern draw-up-down (function font-context none))
(define-extern draw-missions-up-down (function font-context none))
(define-extern draw-scene-up-down (function font-context none))
(define-extern begin-scissor (function hud-box progress none))
(define-extern end-scissor (function hud-box float none))
(define-extern begin-scissor-secret (function hud-box progress none))
(define-extern end-scissor-secret (function hud-box float none))
(define-extern begin-scissor-missions (function hud-box float none))
(define-extern end-scissor-missions (function hud-box float none))
(define-extern begin-scissor-scene (function hud-box none))
(define-extern end-scissor-scene (function hud-box float none))
(define-extern begin-scissor-level (function hud-box none))
(define-extern end-scissor-level (function hud-box float none))
(define-extern begin-scissor (function hud-box progress int))
(define-extern end-scissor (function hud-box float int))
(define-extern begin-scissor-secret (function hud-box progress int))
(define-extern end-scissor-secret (function hud-box float int))
(define-extern begin-scissor-missions (function hud-box int))
(define-extern end-scissor-missions (function hud-box float int))
(define-extern begin-scissor-scene (function hud-box int))
(define-extern end-scissor-scene (function hud-box float int))
(define-extern begin-scissor-level (function hud-box int))
(define-extern end-scissor-level (function hud-box float int))
(define-extern print-language-name (function text-id font-context int symbol none))
(define-extern unlocked-secret-menu? (function game-secrets symbol))
(define-extern memcard-unlocked-secrets? (function symbol game-secrets))
+1 -1
View File
@@ -10,7 +10,7 @@
"dgo_names": [
// "CGO/ART.CGO",
"CGO/KERNEL.CGO",
"CGO/ENGINE.CGO",
// "CGO/ENGINE.CGO",
"CGO/GAME.CGO",
// "CGO/COMMON.CGO",
"DGO/LWIDEB.DGO",
@@ -4230,5 +4230,13 @@
"a3-0": "shadow-geo",
"t0-0": "dist"
}
},
"progress-selected": {
"vars": {
"gp-0": ["color", "font-color"]
}
},
"set-font-color": {
"args": ["color", "vert", "rgba-red", "rgba-green", "rgba-blue"]
}
}
+3 -1
View File
@@ -469,7 +469,9 @@ void types2_for_right_shift(types2::Type& type_out,
int size = 64 - expr.get_arg(1).get_int();
int start_bit = end_bit - size;
if (start_bit < 0) {
throw std::runtime_error("Bad bitfield start bit");
// throw std::runtime_error("Bad bitfield start bit");
size += start_bit;
start_bit = 0;
}
auto type = dts.ts.lookup_type(arg0_type.get_bitfield_type());
+1
View File
@@ -78,6 +78,7 @@ ShaderLibrary::ShaderLibrary(GameVersion version) {
at(ShaderId::SOLID_COLOR) = {"solid_color", version};
at(ShaderId::DIRECT_BASIC) = {"direct_basic", version};
at(ShaderId::DIRECT_BASIC_TEXTURED) = {"direct_basic_textured", version};
at(ShaderId::DIRECT_BASIC_TEXTURED_MULTI_UNIT) = {"direct_basic_textured_multi_unit", version};
at(ShaderId::DEBUG_RED) = {"debug_red", version};
at(ShaderId::SPRITE) = {"sprite_3d", version};
at(ShaderId::SKY) = {"sky", version};
+1
View File
@@ -57,6 +57,7 @@ enum class ShaderId {
ETIE_BASE = 30,
ETIE = 31,
SHADOW2 = 32,
DIRECT_BASIC_TEXTURED_MULTI_UNIT = 33,
MAX_SHADERS
};
@@ -5,6 +5,6 @@ out vec4 color;
in vec4 fragment_color;
void main() {
if (fragment_color.a <= 0) discard;
color = fragment_color;
if (fragment_color.a <= 0) discard;
color = fragment_color;
}
@@ -38,84 +38,84 @@ bool logtest(uint a, uint b) { return (a & b) != 0; }
bool logtesta(uint a, uint b) { return (a & b) == b; }
layout(std140) uniform PatColors {
vec4 pat_mode_colors[0x8];
vec4 pat_material_colors[0x40];
vec4 pat_event_colors[0x40];
vec4 pat_mode_colors[0x8];
vec4 pat_material_colors[0x40];
vec4 pat_event_colors[0x40];
};
void main() {
// Step 3, the camera transform
vec4 transformed = -camera[3].xyzw;
transformed += -camera[0] * position_in.x;
transformed += -camera[1] * position_in.y;
transformed += -camera[2] * position_in.z;
// Step 3, the camera transform
vec4 transformed = -camera[3].xyzw;
transformed += -camera[0] * position_in.x;
transformed += -camera[1] * position_in.y;
transformed += -camera[2] * position_in.z;
// compute Q
float Q = fog_constant / transformed[3];
// compute Q
float Q = fog_constant / transformed[3];
// perspective divide!
transformed.xyz *= Q;
// perspective divide!
transformed.xyz *= Q;
// offset
transformed.xyz += hvdf_offset.xyz;
// offset
transformed.xyz += hvdf_offset.xyz;
// correct xy offset
transformed.xy -= (2048.);
// correct xy offset
transformed.xy -= (2048.);
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
// hack
transformed.xyz *= transformed.w;
// hack
transformed.xyz *= transformed.w;
gl_Position = transformed;
// scissoring area adjust
gl_Position.y *= SCISSOR_ADJUST;
gl_Position = transformed;
// scissoring area adjust
gl_Position.y *= SCISSOR_ADJUST;
// wireframe check
if (wireframe == 0) {
// lighting check
vec3 to_cam = camera_position.xyz - position_in;
float dist_from_cam = length(to_cam);
vec3 to_cam_n = to_cam / dist_from_cam;
float cam_dot = abs(dot(to_cam_n, normal_in));
// wireframe check
if (wireframe == 0) {
// lighting check
vec3 to_cam = camera_position.xyz - position_in;
float dist_from_cam = length(to_cam);
vec3 to_cam_n = to_cam / dist_from_cam;
float cam_dot = abs(dot(to_cam_n, normal_in));
// base colors
fragment_color = vec4(0.5, 0.5, 0.5, 1);
fragment_color.xyz *= (pow(cam_dot, 2) * 0.5 + 0.5);
// pat checks
uint pMode = pat_get_mode(pat);
uint pMat = pat_get_material(pat);
uint pEvent = pat_get_event(pat);
if (logtest(collision_mode_mask[pMode/32], 1 << (pMode & 0x1f)) &&
logtest(collision_material_mask[pMat/32], 1 << (pMat & 0x1f)) &&
logtest(collision_event_mask[pEvent/32], 1 << (pEvent & 0x1f)) &&
logtesta(collision_skip_mask, pat)) {
// fancy colors
if (mode == MODE_MODE) {
fragment_color.rgb *= pat_mode_colors[pMode].rgb;
} else if (mode == MODE_EVENT) {
fragment_color.rgb *= pat_event_colors[pEvent].rgb;
} else if (mode == MODE_MATERIAL) {
fragment_color.rgb *= pat_material_colors[pMat].rgb;
} else {
fragment_color = vec4((normal_in + 1)*.5, 1);
fragment_color.rgb *= (pow(cam_dot, 2) * 0.5 + 0.5);
}
if (fragment_color.r < 0 || fragment_color.g < 0 || fragment_color.b < 0) {
fragment_color.rgb = vec3(1, 0, 1);
}
} else {
// filtered out. goodbye!
fragment_color.rgba = vec4(0);
}
// base colors
fragment_color = vec4(0.5, 0.5, 0.5, 1);
fragment_color.xyz *= (pow(cam_dot, 2) * 0.5 + 0.5);
// pat checks
uint pMode = pat_get_mode(pat);
uint pMat = pat_get_material(pat);
uint pEvent = pat_get_event(pat);
if (logtest(collision_mode_mask[pMode/32], 1 << (pMode & 0x1f)) &&
logtest(collision_material_mask[pMat/32], 1 << (pMat & 0x1f)) &&
logtest(collision_event_mask[pEvent/32], 1 << (pEvent & 0x1f)) &&
logtesta(collision_skip_mask, pat)) {
// fancy colors
if (mode == MODE_MODE) {
fragment_color.rgb *= pat_mode_colors[pMode].rgb;
} else if (mode == MODE_EVENT) {
fragment_color.rgb *= pat_event_colors[pEvent].rgb;
} else if (mode == MODE_MATERIAL) {
fragment_color.rgb *= pat_material_colors[pMat].rgb;
} else {
fragment_color = vec4((normal_in + 1)*.5, 1);
fragment_color.rgb *= (pow(cam_dot, 2) * 0.5 + 0.5);
}
if (fragment_color.r < 0 || fragment_color.g < 0 || fragment_color.b < 0) {
fragment_color.rgb = vec3(1, 0, 1);
}
} else {
fragment_color = vec4(0.12, 0.12, 0.12, 0.5);
// filtered out. goodbye!
fragment_color.rgba = vec4(0);
}
} else {
fragment_color = vec4(0.12, 0.12, 0.12, 0.5);
}
}
@@ -8,6 +8,6 @@ uniform sampler2D tex;
out vec4 out_color;
void main() {
// sample texture
out_color = fragment_color * texture(tex, tex_coord);
// sample texture
out_color = fragment_color * texture(tex, tex_coord);
}
@@ -10,18 +10,18 @@ out flat vec4 fragment_color;
out vec2 tex_coord;
void main() {
// Calculate color
vec4 color = u_color;
color *= 2; // correct
fragment_color = color;
// Calculate color
vec4 color = u_color;
color *= 2; // correct
fragment_color = color;
// Pass on texture coord
tex_coord = st;
// Pass on texture coord
tex_coord = st;
// Calculate vertex position
vec4 position = vec4(xy.x, xy.y, u_depth, 1.0);
position.xyz = (position.xyz * 2) - 1.0; // convert from [0,1] to clip-space
// Calculate vertex position
vec4 position = vec4(xy.x, xy.y, u_depth, 1.0);
position.xyz = (position.xyz * 2) - 1.0; // convert from [0,1] to clip-space
gl_Position = position;
gl_Position = position;
}
@@ -24,52 +24,52 @@ layout (binding = 9) uniform sampler2D tex_T9;
vec4 sample_tex(vec2 coord, uint unit) {
switch (unit) {
case 0: return texture(tex_T0, coord);
case 1: return texture(tex_T1, coord);
case 2: return texture(tex_T2, coord);
case 3: return texture(tex_T3, coord);
case 4: return texture(tex_T4, coord);
case 5: return texture(tex_T5, coord);
case 6: return texture(tex_T6, coord);
case 7: return texture(tex_T7, coord);
case 8: return texture(tex_T8, coord);
case 9: return texture(tex_T9, coord);
default : return vec4(1.0, 0, 1.0, 1.0);
}
switch (unit) {
case 0: return texture(tex_T0, coord);
case 1: return texture(tex_T1, coord);
case 2: return texture(tex_T2, coord);
case 3: return texture(tex_T3, coord);
case 4: return texture(tex_T4, coord);
case 5: return texture(tex_T5, coord);
case 6: return texture(tex_T6, coord);
case 7: return texture(tex_T7, coord);
case 8: return texture(tex_T8, coord);
case 9: return texture(tex_T9, coord);
default : return vec4(1.0, 0, 1.0, 1.0);
}
}
void main() {
vec4 T0 = sample_tex(tex_coord.xy / tex_coord.z, tex_info.x);
// y is tcc
// z is decal
vec4 T0 = sample_tex(tex_coord.xy / tex_coord.z, tex_info.x);
// y is tcc
// z is decal
if ((tex_info.y & 1u) == 0) {
if ((tex_info.y & 2u) == 0) {
// modulate + no tcc
color.xyz = fragment_color.xyz * T0.xyz;
color.w = fragment_color.w;
} else {
// decal + no tcc
color.xyz = T0.xyz * 0.5;
color.w = fragment_color.w;
}
if ((tex_info.y & 1u) == 0) {
if ((tex_info.y & 2u) == 0) {
// modulate + no tcc
color.xyz = fragment_color.xyz * T0.xyz;
color.w = fragment_color.w;
} else {
if ((tex_info.y & 2u) == 0) {
// modulate + tcc
color = fragment_color * T0;
} else {
// decal + tcc
color.xyz = T0.xyz * 0.5;
color.w = T0.w;
}
// decal + no tcc
color.xyz = T0.xyz * 0.5;
color.w = fragment_color.w;
}
color *= 2;
color.xyz *= color_mult;
if (color.a < alpha_reject) {
discard;
}
if ((tex_info.y & 4u) != 0) {
color.xyz = mix(color.xyz, fog_color.rgb, clamp(fog_color.a * fog, 0, 1));
} else {
if ((tex_info.y & 2u) == 0) {
// modulate + tcc
color = fragment_color * T0;
} else {
// decal + tcc
color.xyz = T0.xyz * 0.5;
color.w = T0.w;
}
}
color *= 2;
color.xyz *= color_mult;
if (color.a < alpha_reject) {
discard;
}
if ((tex_info.y & 4u) != 0) {
color.xyz = mix(color.xyz, fog_color.rgb, clamp(fog_color.a * fog, 0, 1));
}
}
@@ -14,13 +14,13 @@ out float fog;
out flat uvec2 tex_info;
void main() {
gl_Position = vec4((position_in.x - 0x8000) / 0x1000,
-(position_in.y - 0x8000) / 0x800,
position_in.z / 0x800000 - 1., 1.0);
// scissoring area adjust
gl_Position.y *= SCISSOR_ADJUST;
fragment_color = vec4(rgba_in.x, rgba_in.y, rgba_in.z, rgba_in.w * 2.);
tex_coord = tex_coord_in;
tex_info = byte_info.xy;
fog = 255 - byte_info.z;
gl_Position = vec4((position_in.x - 0x8000) / 0x1000,
-(position_in.y - 0x8000) / 0x800,
position_in.z / 0x800000 - 1., 1.0);
// scissoring area adjust
gl_Position.y *= SCISSOR_ADJUST;
fragment_color = vec4(rgba_in.x, rgba_in.y, rgba_in.z, rgba_in.w * 2.);
tex_coord = tex_coord_in;
tex_info = byte_info.xy;
fog = 255 - byte_info.z;
}
@@ -3,7 +3,24 @@
out vec4 color;
in vec4 fragment_color;
in vec4 gs_scissor;
uniform int scissor_enable;
// game width, game height, viewport width, viewport height
uniform vec4 game_sizes;
void main() {
if (scissor_enable == 1) {
float x = gl_FragCoord.x;
float y = gl_FragCoord.y;
float w = (game_sizes.z / game_sizes.x);
float h = (game_sizes.w / game_sizes.y);
float scax0 = gs_scissor.x * w + 0.5;
float scax1 = gs_scissor.y * w + 0.5;
float scay0 = (game_sizes.y - gs_scissor.w) * h + 0.5;
float scay1 = (game_sizes.y - gs_scissor.z) * h + 0.5;
if (x < scax0 || x > scax1) discard;
if (y < scay0 || y > scay1) discard;
}
color = fragment_color;
}
@@ -1,11 +1,11 @@
// Shader for the DirectRenderer. Inputs are RGBA + position.
#version 430 core
layout (location = 0) in vec3 position_in;
layout (location = 1) in vec4 rgba_in;
layout (location = 5) in vec4 gs_scissor_in;
out vec4 fragment_color;
out vec4 gs_scissor;
void main() {
// Note: position.y is multiplied by 32 instead of 16 to undo the half-height for interlacing stuff.
@@ -13,4 +13,5 @@ void main() {
// scissoring area adjust
gl_Position.y *= SCISSOR_ADJUST;
fragment_color = vec4(rgba_in.x, rgba_in.y, rgba_in.z, rgba_in.w * 2.);
gs_scissor = gs_scissor_in;
}
@@ -21,105 +21,72 @@ in flat uvec4 tex_info;
in float fog;
layout (binding = 20) uniform sampler2D tex_T0;
layout (binding = 21) uniform sampler2D tex_T1;
layout (binding = 22) uniform sampler2D tex_T2;
layout (binding = 23) uniform sampler2D tex_T3;
layout (binding = 24) uniform sampler2D tex_T4;
layout (binding = 25) uniform sampler2D tex_T5;
layout (binding = 26) uniform sampler2D tex_T6;
layout (binding = 27) uniform sampler2D tex_T7;
layout (binding = 28) uniform sampler2D tex_T8;
layout (binding = 29) uniform sampler2D tex_T9;
vec4 sample_tex(vec2 coord, uint unit) {
switch (unit) {
case 0: return texture(tex_T0, coord);
case 1: return texture(tex_T1, coord);
case 2: return texture(tex_T2, coord);
case 3: return texture(tex_T3, coord);
case 4: return texture(tex_T4, coord);
case 5: return texture(tex_T5, coord);
case 6: return texture(tex_T6, coord);
case 7: return texture(tex_T7, coord);
case 8: return texture(tex_T8, coord);
case 9: return texture(tex_T9, coord);
default : return vec4(1.0, 0, 1.0, 1.0);
}
return texture(tex_T0, coord);
}
vec4 sample_tex_px(vec2 coordf, uint unit) {
ivec2 coord;
coord.x = int(coordf.x / 16);
coord.y = int(coordf.y / 16);
switch (unit) {
case 0: return texelFetch(tex_T0, coord, 0);
case 1: return texelFetch(tex_T1, coord, 0);
case 2: return texelFetch(tex_T2, coord, 0);
case 3: return texelFetch(tex_T3, coord, 0);
case 4: return texelFetch(tex_T4, coord, 0);
case 5: return texelFetch(tex_T5, coord, 0);
case 6: return texelFetch(tex_T6, coord, 0);
case 7: return texelFetch(tex_T7, coord, 0);
case 8: return texelFetch(tex_T8, coord, 0);
case 9: return texelFetch(tex_T9, coord, 0);
default : return vec4(1.0, 0, 1.0, 1.0);
}
ivec2 coord;
coord.x = int(coordf.x / 16);
coord.y = int(coordf.y / 16);
return texelFetch(tex_T0, coord, 0);
}
void main() {
if (scissor_enable == 1) {
float x = gl_FragCoord.x;
float y = gl_FragCoord.y;
float w = (game_sizes.z / game_sizes.x);
float h = (game_sizes.w / game_sizes.y);
float scax0 = gs_scissor.x * w + 0.5;
float scax1 = gs_scissor.y * w + 0.5;
float scay0 = (game_sizes.y - gs_scissor.w) * h + 0.5;
float scay1 = (game_sizes.y - gs_scissor.z) * h + 0.5;
if (x < scax0 || x > scax1) discard;
if (y < scay0 || y > scay1) discard;
}
if (scissor_enable == 1) {
float x = gl_FragCoord.x;
float y = gl_FragCoord.y;
float w = (game_sizes.z / game_sizes.x);
float h = (game_sizes.w / game_sizes.y);
float scax0 = gs_scissor.x * w + 0.5;
float scax1 = gs_scissor.y * w + 0.5;
float scay0 = (game_sizes.y - gs_scissor.w) * h + 0.5;
float scay1 = (game_sizes.y - gs_scissor.z) * h + 0.5;
if (x < scax0 || x > scax1) discard;
if (y < scay0 || y > scay1) discard;
}
vec4 T0;
if (use_uv == 1) {
T0 = sample_tex_px(tex_coord.xy, tex_info.x);
} else {
T0 = sample_tex(tex_coord.xy / tex_coord.z, tex_info.x);
}
// y is tcc
// z is decal
if (T0.w == 0) {
T0.w = ta0;
}
vec4 T0;
if (use_uv == 1) {
T0 = sample_tex_px(tex_coord.xy, tex_info.x);
} else {
T0 = sample_tex(tex_coord.xy / tex_coord.z, tex_info.x);
}
// y is tcc
// z is decal
if (T0.w == 0) {
T0.w = ta0;
}
if (tex_info.y == 0) {
if (tex_info.z == 0) {
// modulate + no tcc
color.xyz = fragment_color.xyz * T0.xyz;
color.w = fragment_color.w;
} else {
// decal + no tcc
color.xyz = T0.xyz * 0.5;
color.w = fragment_color.w;
}
if (tex_info.y == 0) {
if (tex_info.z == 0) {
// modulate + no tcc
color.xyz = fragment_color.xyz * T0.xyz;
color.w = fragment_color.w;
} else {
if (tex_info.z == 0) {
// modulate + tcc
color = fragment_color * T0;
} else {
// decal + tcc
color.xyz = T0.xyz * 0.5;
color.w = T0.w;
}
// decal + no tcc
color.xyz = T0.xyz * 0.5;
color.w = fragment_color.w;
}
color *= 2;
color.xyz *= color_mult;
color.w *= alpha_mult;
if (color.a < alpha_reject) {
discard;
}
if (tex_info.w == 1) {
color.xyz = mix(color.xyz, fog_color.rgb, clamp(fog_color.a * fog, 0, 1));
} else {
if (tex_info.z == 0) {
// modulate + tcc
color = fragment_color * T0;
} else {
// decal + tcc
color.xyz = T0.xyz * 0.5;
color.w = T0.w;
}
}
color *= 2;
color.xyz *= color_mult;
color.w *= alpha_mult;
if (color.a < alpha_reject) {
discard;
}
if (tex_info.w == 1) {
color.xyz = mix(color.xyz, fog_color.rgb, clamp(fog_color.a * fog, 0, 1));
}
}
@@ -0,0 +1,125 @@
#version 430 core
out vec4 color;
in vec4 fragment_color;
in vec3 tex_coord;
in flat uint use_uv;
in vec4 gs_scissor;
uniform float alpha_reject;
uniform float color_mult;
uniform float alpha_mult;
uniform float alpha_sub;
uniform float ta0;
uniform int scissor_enable;
// game width, game height, viewport width, viewport height
uniform vec4 game_sizes;
uniform vec4 fog_color;
in flat uvec4 tex_info;
in float fog;
layout (binding = 20) uniform sampler2D tex_T0;
layout (binding = 21) uniform sampler2D tex_T1;
layout (binding = 22) uniform sampler2D tex_T2;
layout (binding = 23) uniform sampler2D tex_T3;
layout (binding = 24) uniform sampler2D tex_T4;
layout (binding = 25) uniform sampler2D tex_T5;
layout (binding = 26) uniform sampler2D tex_T6;
layout (binding = 27) uniform sampler2D tex_T7;
layout (binding = 28) uniform sampler2D tex_T8;
layout (binding = 29) uniform sampler2D tex_T9;
vec4 sample_tex(vec2 coord, uint unit) {
switch (unit) {
case 0: return texture(tex_T0, coord);
case 1: return texture(tex_T1, coord);
case 2: return texture(tex_T2, coord);
case 3: return texture(tex_T3, coord);
case 4: return texture(tex_T4, coord);
case 5: return texture(tex_T5, coord);
case 6: return texture(tex_T6, coord);
case 7: return texture(tex_T7, coord);
case 8: return texture(tex_T8, coord);
case 9: return texture(tex_T9, coord);
default : return vec4(1.0, 0, 1.0, 1.0);
}
}
vec4 sample_tex_px(vec2 coordf, uint unit) {
ivec2 coord;
coord.x = int(coordf.x / 16);
coord.y = int(coordf.y / 16);
switch (unit) {
case 0: return texelFetch(tex_T0, coord, 0);
case 1: return texelFetch(tex_T1, coord, 0);
case 2: return texelFetch(tex_T2, coord, 0);
case 3: return texelFetch(tex_T3, coord, 0);
case 4: return texelFetch(tex_T4, coord, 0);
case 5: return texelFetch(tex_T5, coord, 0);
case 6: return texelFetch(tex_T6, coord, 0);
case 7: return texelFetch(tex_T7, coord, 0);
case 8: return texelFetch(tex_T8, coord, 0);
case 9: return texelFetch(tex_T9, coord, 0);
default : return vec4(1.0, 0, 1.0, 1.0);
}
}
void main() {
if (scissor_enable == 1) {
float x = gl_FragCoord.x;
float y = gl_FragCoord.y;
float w = (game_sizes.z / game_sizes.x);
float h = (game_sizes.w / game_sizes.y);
float scax0 = gs_scissor.x * w + 0.5;
float scax1 = gs_scissor.y * w + 0.5;
float scay0 = (game_sizes.y - gs_scissor.w) * h + 0.5;
float scay1 = (game_sizes.y - gs_scissor.z) * h + 0.5;
if (x < scax0 || x > scax1) discard;
if (y < scay0 || y > scay1) discard;
}
vec4 T0;
if (use_uv == 1) {
T0 = sample_tex_px(tex_coord.xy, tex_info.x);
} else {
T0 = sample_tex(tex_coord.xy / tex_coord.z, tex_info.x);
}
// y is tcc
// z is decal
if (T0.w == 0) {
T0.w = ta0;
}
if (tex_info.y == 0) {
if (tex_info.z == 0) {
// modulate + no tcc
color.xyz = fragment_color.xyz * T0.xyz;
color.w = fragment_color.w;
} else {
// decal + no tcc
color.xyz = T0.xyz * 0.5;
color.w = fragment_color.w;
}
} else {
if (tex_info.z == 0) {
// modulate + tcc
color = fragment_color * T0;
} else {
// decal + tcc
color.xyz = T0.xyz * 0.5;
color.w = T0.w;
}
}
color *= 2;
color.xyz *= color_mult;
color.w *= alpha_mult;
if (color.a < alpha_reject) {
discard;
}
if (tex_info.w == 1) {
color.xyz = mix(color.xyz, fog_color.rgb, clamp(fog_color.a * fog, 0, 1));
}
}
@@ -0,0 +1,35 @@
#version 430 core
layout (location = 0) in vec4 position_in;
layout (location = 1) in vec4 rgba_in;
layout (location = 2) in vec3 tex_coord_in;
layout (location = 5) in vec4 gs_scissor_in;
out vec4 fragment_color;
out vec3 tex_coord;
out float fog;
out vec4 gs_scissor;
// putting all texture info stuff here so it's easier to copy-paste
layout (location = 3) in uvec4 tex_info_in;
layout (location = 4) in uint use_uv_in;
out flat uvec4 tex_info;
out flat uint use_uv;
uniform int offscreen_mode;
void main() {
if (offscreen_mode == 1) {
gl_Position = vec4((position_in.x - 0.453125) * 64., (position_in.y - 0.5 + (2.25 / 64)) * 64, position_in.z * 2 - 1., 1.0);
} else {
gl_Position = vec4((position_in.x - 0.5) * 16., -(position_in.y - 0.5) * 32 * HEIGHT_SCALE, position_in.z * 2 - 1., 1.0);
// scissoring area adjust
gl_Position.y *= SCISSOR_ADJUST;
}
fragment_color = vec4(rgba_in.x, rgba_in.y, rgba_in.z, rgba_in.w * 2.);
tex_coord = tex_coord_in;
tex_info = tex_info_in;
fog = 255 - position_in.w;
use_uv = use_uv_in;
gs_scissor = gs_scissor_in;
}
@@ -17,14 +17,14 @@ uniform int gfx_hack_no_tex;
void main() {
if (gfx_hack_no_tex == 0) {
vec4 T0 = texture(tex_T0, vtx_st);
if (gfx_hack_no_tex == 0) {
vec4 T0 = texture(tex_T0, vtx_st);
color.a = T0.a;
color.rgb = T0.rgb * vtx_color;
color *= 2;
} else {
color.rgb = vtx_color;
color.a = 1;
}
color.a = T0.a;
color.rgb = T0.rgb * vtx_color;
color *= 2;
} else {
color.rgb = vtx_color;
color.a = 1;
}
}
@@ -23,106 +23,106 @@ out vec2 vtx_st;
out float fog;
struct MercMatrixData {
mat4 X;
mat3 R;
vec4 pad;
mat4 X;
mat3 R;
vec4 pad;
};
layout (std140, binding = 1) uniform ub_bones {
MercMatrixData bones[128];
MercMatrixData bones[128];
};
void main() {
vec4 p = vec4(position_in, 1);
vec4 vtx_pos = -bones[mats[0]].X * p * weights_in[0];
vec3 rotated_nrm = bones[mats[0]].R * normal_in * weights_in[0];
vec4 p = vec4(position_in, 1);
vec4 vtx_pos = -bones[mats[0]].X * p * weights_in[0];
vec3 rotated_nrm = bones[mats[0]].R * normal_in * weights_in[0];
// game may send garbage bones if the weight is 0, don't let NaNs sneak in.
if (weights_in[1] > 0) {
vtx_pos += -bones[mats[1]].X * p * weights_in[1];
rotated_nrm += bones[mats[1]].R * normal_in * weights_in[1];
}
if (weights_in[2] > 0) {
vtx_pos += -bones[mats[2]].X * p * weights_in[2];
rotated_nrm += bones[mats[2]].R * normal_in * weights_in[2];
}
// game may send garbage bones if the weight is 0, don't let NaNs sneak in.
if (weights_in[1] > 0) {
vtx_pos += -bones[mats[1]].X * p * weights_in[1];
rotated_nrm += bones[mats[1]].R * normal_in * weights_in[1];
}
if (weights_in[2] > 0) {
vtx_pos += -bones[mats[2]].X * p * weights_in[2];
rotated_nrm += bones[mats[2]].R * normal_in * weights_in[2];
}
vec4 transformed = perspective_matrix * vtx_pos;
vec4 transformed = perspective_matrix * vtx_pos;
rotated_nrm = normalize(rotated_nrm);
rotated_nrm = normalize(rotated_nrm);
float Q = fog_constants.x / transformed[3];
fog = 255 - clamp(-transformed.w + hvdf_offset.w, fog_constants.y, fog_constants.z);
float Q = fog_constants.x / transformed[3];
fog = 255 - clamp(-transformed.w + hvdf_offset.w, fog_constants.y, fog_constants.z);
// emerc
vec2 st_mod = st_in;
{
vec4 vf10 = vec4(rotated_nrm, 1); // ??
// vf08 = transformed
vec4 vf08 = transformed;
// vf23 = unperspect
// unperspect (1/P(0, 0), 1/P(1, 1), 0.5, 1/P(2, 3))
vec4 vf23 = vec4(1. / perspective_matrix[0][0],
1. / perspective_matrix[1][1],
0.5,
1. / perspective_matrix[2][3]);
// vf14 = rgba-fade
vec4 vf14 = fade;
// vf24 = normal st
// mul.xyzw vf09, vf08, vf23 ;; do unperspect
vec4 vf09 = vf08 * vf23;
//subw.z vf10, vf10, vf00 ;; subtract 1 from z
vf10.z -= 1;
//addw.z vf09, vf00, vf09 ;; xyww the unperspected thing
vf09.z = vf09.w;
//mul.xyz vf15, vf09, vf10 ;;
vec3 vf15 = vf09.xyz * vf10.xyz;
//adday.xyzw vf15, vf15
//maddz.x vf15, vf21, vf15
float vf15_x = vf15.x + vf15.y + vf15.z;
//div Q, vf15.x, vf10.z
float qq = vf15_x / vf10.z;
//mulaw.xyzw ACC, vf09, vf00
vec4 ACC = vf09;
//mul.xyzw vf09, vf08, vf23
vf09 = vf08 * vf23;
//madd.xyzw vf10, vf10, Q
vf10 = ACC + vf10 * qq;
//eleng.xyz P, vf10
float P = length(vf10.xyz);
//mfp.w vf10, P
//div Q, vf23.z, vf10.w
float qqq = vf23.z / P;
//addaz.xyzw vf00, vf23
ACC = vec4(vf23.z, vf23.z, vf23.z, vf23.z + 1.);
//madd.xyzw vf10, vf10, Q
vf10 = ACC + vf10 * qqq;
st_mod = vf10.xy;
// emerc
vec2 st_mod = st_in;
{
vec4 vf10 = vec4(rotated_nrm, 1); // ??
// vf08 = transformed
vec4 vf08 = transformed;
// vf23 = unperspect
// unperspect (1/P(0, 0), 1/P(1, 1), 0.5, 1/P(2, 3))
vec4 vf23 = vec4(1. / perspective_matrix[0][0],
1. / perspective_matrix[1][1],
0.5,
1. / perspective_matrix[2][3]);
// vf14 = rgba-fade
vec4 vf14 = fade;
// vf24 = normal st
// mul.xyzw vf09, vf08, vf23 ;; do unperspect
vec4 vf09 = vf08 * vf23;
//subw.z vf10, vf10, vf00 ;; subtract 1 from z
vf10.z -= 1;
//addw.z vf09, vf00, vf09 ;; xyww the unperspected thing
vf09.z = vf09.w;
//mul.xyz vf15, vf09, vf10 ;;
vec3 vf15 = vf09.xyz * vf10.xyz;
//adday.xyzw vf15, vf15
//maddz.x vf15, vf21, vf15
float vf15_x = vf15.x + vf15.y + vf15.z;
//div Q, vf15.x, vf10.z
float qq = vf15_x / vf10.z;
//mulaw.xyzw ACC, vf09, vf00
vec4 ACC = vf09;
//mul.xyzw vf09, vf08, vf23
vf09 = vf08 * vf23;
//madd.xyzw vf10, vf10, Q
vf10 = ACC + vf10 * qq;
//eleng.xyz P, vf10
float P = length(vf10.xyz);
//mfp.w vf10, P
//div Q, vf23.z, vf10.w
float qqq = vf23.z / P;
//addaz.xyzw vf00, vf23
ACC = vec4(vf23.z, vf23.z, vf23.z, vf23.z + 1.);
//madd.xyzw vf10, vf10, Q
vf10 = ACC + vf10 * qqq;
st_mod = vf10.xy;
// this is required to make jak 1's envmapping look right
// otherwise it behaves like the envmap texture is mirrored.
// this is because we flip vtx_pos above with a negative sign.
st_mod.x = 1 - vf10.x;
st_mod.y = 1 - vf10.y;
// this is required to make jak 1's envmapping look right
// otherwise it behaves like the envmap texture is mirrored.
// this is because we flip vtx_pos above with a negative sign.
st_mod.x = 1 - vf10.x;
st_mod.y = 1 - vf10.y;
//mulz.xy vf24, vf10, vf24 ;; mul tex by q
}
//mulz.xy vf24, vf10, vf24 ;; mul tex by q
}
transformed.xyz *= Q;
transformed.xyz += hvdf_offset.xyz;
transformed.xy -= (2048.);
transformed.z /= (8388608);
transformed.z -= 1;
transformed.x /= (256);
transformed.y /= -(128);
transformed.xyz *= transformed.w;
transformed.y *= SCISSOR_ADJUST * HEIGHT_SCALE;
gl_Position = transformed;
transformed.xyz *= Q;
transformed.xyz += hvdf_offset.xyz;
transformed.xy -= (2048.);
transformed.z /= (8388608);
transformed.z -= 1;
transformed.x /= (256);
transformed.y /= -(128);
transformed.xyz *= transformed.w;
transformed.y *= SCISSOR_ADJUST * HEIGHT_SCALE;
gl_Position = transformed;
vtx_color = fade.xyz;
vtx_st = st_mod;
vtx_color = fade.xyz;
vtx_st = st_mod;
}
+11 -11
View File
@@ -15,17 +15,17 @@ uniform int gfx_hack_no_tex;
void main() {
if (gfx_hack_no_tex == 0) {
//vec4 T0 = texture(tex_T0, tex_coord);
vec4 T0 = texture(tex_T0, tex_coord.xy);
color = fragment_color * T0;
} else {
color = fragment_color/2;
}
if (gfx_hack_no_tex == 0) {
//vec4 T0 = texture(tex_T0, tex_coord);
vec4 T0 = texture(tex_T0, tex_coord.xy);
color = fragment_color * T0;
} else {
color = fragment_color/2;
}
if (color.a < alpha_min || color.a > alpha_max) {
discard;
}
if (color.a < alpha_min || color.a > alpha_max) {
discard;
}
color.rgb = mix(color.rgb, fog_color.rgb, clamp(fogginess * fog_color.a, 0, 1));
color.rgb = mix(color.rgb, fog_color.rgb, clamp(fogginess * fog_color.a, 0, 1));
}
+114 -114
View File
@@ -25,137 +25,137 @@ uniform vec4 persp1;
uniform mat4 cam_no_persp;
void main() {
fogginess = 0;
fogginess = 0;
// rotate the normal
vec3 nrm_vf23 = cam_no_persp[0].xyz * normal.x
+ cam_no_persp[1].xyz * normal.y
+ cam_no_persp[2].xyz * normal.z;
vec3 r_nrm = nrm_vf23;
// rotate the normal
vec3 nrm_vf23 = cam_no_persp[0].xyz * normal.x
+ cam_no_persp[1].xyz * normal.y
+ cam_no_persp[2].xyz * normal.z;
vec3 r_nrm = nrm_vf23;
// transform the point
vec4 vf17 = cam_no_persp[3];
vf17 += cam_no_persp[0] * position_in.x;
vf17 += cam_no_persp[1] * position_in.y;
vf17 += cam_no_persp[2] * position_in.z;
// transform the point
vec4 vf17 = cam_no_persp[3];
vf17 += cam_no_persp[0] * position_in.x;
vf17 += cam_no_persp[1] * position_in.y;
vf17 += cam_no_persp[2] * position_in.z;
// This is the ETIE math.
// It seems right only if the nrm_vf23 is normalized first
// (and in this case it's identical the emerc math below)
// There is no reason to prefer the emerc version over etie - they are identical.
// likely on PS2, their normal transformation matrix was scaled correctly.
// ours isn't. (yes, the camera matrix is a pure rotation and that doesn't matter, but the
// instance matrix used to de-instance the mesh needs the correction, and we don't have it)
{
nrm_vf23 = nrm_vf23;
// nrm.z -= 1
//subw.z vf23, vf23, vf00
nrm_vf23.z -= 1.f;
// This is the ETIE math.
// It seems right only if the nrm_vf23 is normalized first
// (and in this case it's identical the emerc math below)
// There is no reason to prefer the emerc version over etie - they are identical.
// likely on PS2, their normal transformation matrix was scaled correctly.
// ours isn't. (yes, the camera matrix is a pure rotation and that doesn't matter, but the
// instance matrix used to de-instance the mesh needs the correction, and we don't have it)
{
nrm_vf23 = nrm_vf23;
// nrm.z -= 1
//subw.z vf23, vf23, vf00
nrm_vf23.z -= 1.f;
// dot = nrm.xyz * pt.xyz
//mul.xyz vf13, vf17, vf23
//esum.xyzw P, vf13
//mfp.x vf13, P
float nrm_dot = dot(vf17.xyz, nrm_vf23);
// dot = nrm.xyz * pt.xyz
//mul.xyz vf13, vf17, vf23
//esum.xyzw P, vf13
//mfp.x vf13, P
float nrm_dot = dot(vf17.xyz, nrm_vf23);
// rfl = pt.xzy * nrm.z
//mulz.xyz vf14, vf17, vf23
vec3 rfl_vf14 = vf17.xyz * nrm_vf23.z;
// rfl = pt.xzy * nrm.z
//mulz.xyz vf14, vf17, vf23
vec3 rfl_vf14 = vf17.xyz * nrm_vf23.z;
//;; Q_envmap = vf02.w / norm(rfl.xyz)
//esadd.xyz P, vf14
//mfp.x vf30, P
//rsqrt Q, vf02.w, vf30.x
float Q_envmap = -0.5 / length(rfl_vf14);
//;; Q_envmap = vf02.w / norm(rfl.xyz)
//esadd.xyz P, vf14
//mfp.x vf30, P
//rsqrt Q, vf02.w, vf30.x
float Q_envmap = -0.5 / length(rfl_vf14);
//
//;; nrm.xy *= dot.x
//mulx.xy vf23, vf23, vf13
nrm_vf23.xy *= nrm_dot;
//
//;; nrm.xy *= dot.x
//mulx.xy vf23, vf23, vf13
nrm_vf23.xy *= nrm_dot;
//
//;; nrm.xy += rfl.xy
//add.xy vf23, vf23, vf14
nrm_vf23.xy += rfl_vf14.xy;
//
//;; nrm.z = 1.0
//addw.z vf23, vf00, vf00
nrm_vf23.z = 1.0;
//
//;; nrm.xy *= Q_envmap
//mul.xy vf23, vf23, Q
nrm_vf23.xy *= Q_envmap;
//
//
//;; nrm.xy += rfl.xy
//add.xy vf23, vf23, vf14
nrm_vf23.xy += rfl_vf14.xy;
//
//;; nrm.z = 1.0
//addw.z vf23, vf00, vf00
nrm_vf23.z = 1.0;
//
//;; nrm.xy *= Q_envmap
//mul.xy vf23, vf23, Q
nrm_vf23.xy *= Q_envmap;
//
//
//;; nrm.xy += vf03.w
//addw.xy vf23, vf23, vf03
nrm_vf23.xy += 0.5;
tex_coord = nrm_vf23;
}
//
//;; nrm.xy += vf03.w
//addw.xy vf23, vf23, vf03
nrm_vf23.xy += 0.5;
tex_coord = nrm_vf23;
}
//;; perspective transform
//mula.xy ACC, vf10, vf17 ;; acc build 1
//mulaw.zw ACC, vf10, vf00 ;; acc build 2
vec4 p_proj = vec4(persp1.x * vf17.x, persp1.y * vf17.y, persp1.z, persp1.w);
//;; perspective transform
//mula.xy ACC, vf10, vf17 ;; acc build 1
//mulaw.zw ACC, vf10, vf00 ;; acc build 2
vec4 p_proj = vec4(persp1.x * vf17.x, persp1.y * vf17.y, persp1.z, persp1.w);
//maddz.xyzw vf18, vf09, vf17 ;; acc star
p_proj += persp0 * vf17.z;
//maddz.xyzw vf18, vf09, vf17 ;; acc star
p_proj += persp0 * vf17.z;
//;; perspective divide
//div Q, vf00.w, vf18.w
float pQ = 1.f / p_proj.w;
//;; perspective divide
//div Q, vf00.w, vf18.w
float pQ = 1.f / p_proj.w;
// EMERC version of the math
// {
// // emerc hack
// vec3 vf10 = normalize(r_nrm);
// //subw.z vf10, vf10, vf00 ;; subtract 1 from z
// vf10.z -= 1;
// //addw.z vf09, vf00, vf09 ;; xyww the unperspected thing
// vec4 vf09 = vf17;
// //mul.xyz vf15, vf09, vf10 ;;
// vec3 vf15 = vf09.xyz * vf10.xyz;
// //adday.xyzw vf15, vf15
// //maddz.x vf15, vf21, vf15
// float vf15_x = vf15.x + vf15.y + vf15.z;
// //div Q, vf15.x, vf10.z
// float qq = vf15_x / vf10.z;
// //mulaw.xyzw ACC, vf09, vf00
// vec3 ACC = vf09.xyz;
// //madd.xyzw vf10, vf10, Q
// vf10 = ACC + vf10 * qq;
// //eleng.xyz P, vf10
// float P = length(vf10.xyz);
// //mfp.w vf10, P
// //div Q, vf23.z, vf10.w
// float qqq = 0.5 / P;
// //addaz.xyzw vf00, vf23
// ACC = vec3(0.5, 0.5, 0.5);
// //madd.xyzw vf10, vf10, Q
// vf10 = ACC + vf10 * qqq;
// tex_coord = vf10.xyz;
// }
// EMERC version of the math
// {
// // emerc hack
// vec3 vf10 = normalize(r_nrm);
// //subw.z vf10, vf10, vf00 ;; subtract 1 from z
// vf10.z -= 1;
// //addw.z vf09, vf00, vf09 ;; xyww the unperspected thing
// vec4 vf09 = vf17;
// //mul.xyz vf15, vf09, vf10 ;;
// vec3 vf15 = vf09.xyz * vf10.xyz;
// //adday.xyzw vf15, vf15
// //maddz.x vf15, vf21, vf15
// float vf15_x = vf15.x + vf15.y + vf15.z;
// //div Q, vf15.x, vf10.z
// float qq = vf15_x / vf10.z;
// //mulaw.xyzw ACC, vf09, vf00
// vec3 ACC = vf09.xyz;
// //madd.xyzw vf10, vf10, Q
// vf10 = ACC + vf10 * qq;
// //eleng.xyz P, vf10
// float P = length(vf10.xyz);
// //mfp.w vf10, P
// //div Q, vf23.z, vf10.w
// float qqq = 0.5 / P;
// //addaz.xyzw vf00, vf23
// ACC = vec3(0.5, 0.5, 0.5);
// //madd.xyzw vf10, vf10, Q
// vf10 = ACC + vf10 * qqq;
// tex_coord = vf10.xyz;
// }
vec4 transformed = p_proj * pQ;
transformed.w = p_proj.w;
vec4 transformed = p_proj * pQ;
transformed.w = p_proj.w;
// correct xy offset
transformed.xy -= (2048.);
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
// hack
transformed.xyz *= transformed.w;
// scissoring area adjust
transformed.y *= SCISSOR_ADJUST * HEIGHT_SCALE;
gl_Position = transformed;
// correct xy offset
transformed.xy -= (2048.);
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
// hack
transformed.xyz *= transformed.w;
// scissoring area adjust
transformed.y *= SCISSOR_ADJUST * HEIGHT_SCALE;
gl_Position = transformed;
fragment_color = proto_tint * envmap_tod_tint;
fragment_color = proto_tint * envmap_tod_tint;
}
@@ -15,18 +15,18 @@ uniform int gfx_hack_no_tex;
void main() {
if (gfx_hack_no_tex == 0) {
//vec4 T0 = texture(tex_T0, tex_coord);
vec4 T0 = texture(tex_T0, tex_coord.xy);
color = fragment_color * T0;
} else {
color = fragment_color/2;
}
if (gfx_hack_no_tex == 0) {
//vec4 T0 = texture(tex_T0, tex_coord);
vec4 T0 = texture(tex_T0, tex_coord.xy);
color = fragment_color * T0;
} else {
color = fragment_color/2;
}
if (color.a < alpha_min || color.a > alpha_max) {
discard;
}
if (color.a < alpha_min || color.a > alpha_max) {
discard;
}
color.rgb = mix(color.rgb, fog_color.rgb, clamp(fogginess * fog_color.a, 0, 1));
color.rgb = mix(color.rgb, fog_color.rgb, clamp(fogginess * fog_color.a, 0, 1));
}
@@ -23,51 +23,51 @@ uniform vec4 persp1;
uniform mat4 cam_no_persp;
void main() {
float fog1 = camera[3].w + camera[0].w * position_in.x + camera[1].w * position_in.y + camera[2].w * position_in.z;
fogginess = 255 - clamp(fog1 + hvdf_offset.w, fog_min, fog_max);
vec4 vf17 = cam_no_persp[3];
vf17 += cam_no_persp[0] * position_in.x;
vf17 += cam_no_persp[1] * position_in.y;
vf17 += cam_no_persp[2] * position_in.z;
vec4 p_proj = vec4(persp1.x * vf17.x, persp1.y * vf17.y, persp1.z, persp1.w);
p_proj += persp0 * vf17.z;
float fog1 = camera[3].w + camera[0].w * position_in.x + camera[1].w * position_in.y + camera[2].w * position_in.z;
fogginess = 255 - clamp(fog1 + hvdf_offset.w, fog_min, fog_max);
vec4 vf17 = cam_no_persp[3];
vf17 += cam_no_persp[0] * position_in.x;
vf17 += cam_no_persp[1] * position_in.y;
vf17 += cam_no_persp[2] * position_in.z;
vec4 p_proj = vec4(persp1.x * vf17.x, persp1.y * vf17.y, persp1.z, persp1.w);
p_proj += persp0 * vf17.z;
float pQ = 1.f / p_proj.w;
vec4 transformed = p_proj * pQ;
transformed.w = p_proj.w;
float pQ = 1.f / p_proj.w;
vec4 transformed = p_proj * pQ;
transformed.w = p_proj.w;
// correct xy offset
transformed.xy -= (2048.);
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
// hack
transformed.xyz *= transformed.w;
// scissoring area adjust
transformed.y *= SCISSOR_ADJUST * HEIGHT_SCALE;
gl_Position = transformed;
// correct xy offset
transformed.xy -= (2048.);
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
// hack
transformed.xyz *= transformed.w;
// scissoring area adjust
transformed.y *= SCISSOR_ADJUST * HEIGHT_SCALE;
gl_Position = transformed;
if (decal == 1) {
fragment_color = vec4(1.0, 1.0, 1.0, 1.0);
} else {
// time of day lookup
fragment_color = texelFetch(tex_T1, time_of_day_index, 0);
// color adjustment
fragment_color *= 2;
fragment_color.a *= 2;
}
if (decal == 1) {
fragment_color = vec4(1.0, 1.0, 1.0, 1.0);
} else {
// time of day lookup
fragment_color = texelFetch(tex_T1, time_of_day_index, 0);
// color adjustment
fragment_color *= 2;
fragment_color.a *= 2;
}
// fog hack
if (fragment_color.r < fog_hack_threshold &&
fragment_color.g < fog_hack_threshold &&
fragment_color.b < fog_hack_threshold) {
fogginess = 0;
}
// fog hack
if (fragment_color.r < fog_hack_threshold &&
fragment_color.g < fog_hack_threshold &&
fragment_color.b < fog_hack_threshold) {
fogginess = 0;
}
tex_coord = tex_coord_in;
tex_coord = tex_coord_in;
}
@@ -5,6 +5,6 @@ in vec2 st;
uniform sampler2D tex_T0;
void main() {
color = texture(tex_T0, st);
color.w *= 2;
}
color = texture(tex_T0, st);
color.w *= 2;
}
@@ -4,6 +4,6 @@ layout (location = 0) in vec4 xyst_in;
out vec2 st;
void main() {
gl_Position = vec4((xyst_in.x - 768.f) / 256.f, (xyst_in.y - 768.f) / 256.f, 0, 1);
st = xyst_in.zw;
gl_Position = vec4((xyst_in.x - 768.f) / 256.f, (xyst_in.y - 768.f) / 256.f, 0, 1);
st = xyst_in.zw;
}
@@ -15,90 +15,67 @@ in flat uvec2 tex_info;
uniform int gfx_hack_no_tex;
layout (binding = 0) uniform sampler2D tex_T0;
layout (binding = 1) uniform sampler2D tex_T1;
layout (binding = 2) uniform sampler2D tex_T2;
layout (binding = 3) uniform sampler2D tex_T3;
layout (binding = 4) uniform sampler2D tex_T4;
layout (binding = 5) uniform sampler2D tex_T5;
layout (binding = 6) uniform sampler2D tex_T6;
layout (binding = 7) uniform sampler2D tex_T7;
layout (binding = 8) uniform sampler2D tex_T8;
layout (binding = 9) uniform sampler2D tex_T9;
vec4 sample_tex(vec2 coord, uint unit) {
return texture(tex_T0, coord);
// switch (unit) {
// case 0: return texture(tex_T0, coord);
// case 1: return texture(tex_T1, coord);
// case 2: return texture(tex_T2, coord);
// case 3: return texture(tex_T3, coord);
// case 4: return texture(tex_T4, coord);
// case 5: return texture(tex_T5, coord);
// case 6: return texture(tex_T6, coord);
// case 7: return texture(tex_T7, coord);
// case 8: return texture(tex_T8, coord);
// case 9: return texture(tex_T9, coord);
// default : return vec4(1.0, 0, 1.0, 1.0);
// }
return texture(tex_T0, coord);
}
void main() {
// 0x1 is tcc
// 0x2 is decal
// 0x4 is fog
// 0x1 is tcc
// 0x2 is decal
// 0x4 is fog
if (gfx_hack_no_tex == 0) {
vec4 T0 = sample_tex(tex_coord.xy, tex_info.x);
if ((tex_info.y & 1u) == 0) {
if ((tex_info.y & 2u) == 0) {
// modulate + no tcc
color.rgb = fragment_color.rgb * T0.rgb;
color.a = fragment_color.a;
} else {
// decal + no tcc
color.rgb = T0.rgb * 0.5;
color.a = fragment_color.a;
}
if (gfx_hack_no_tex == 0) {
vec4 T0 = sample_tex(tex_coord.xy, tex_info.x);
if ((tex_info.y & 1u) == 0) {
if ((tex_info.y & 2u) == 0) {
// modulate + no tcc
color.rgb = fragment_color.rgb * T0.rgb;
color.a = fragment_color.a;
} else {
if ((tex_info.y & 2u) == 0) {
// modulate + tcc
color = fragment_color * T0;
} else {
// decal + tcc
color.rgb = T0.rgb * 0.5;
color.a = T0.a;
}
// decal + no tcc
color.rgb = T0.rgb * 0.5;
color.a = fragment_color.a;
}
color *= 2;
} else {
if ((tex_info.y & 1u) == 0) {
if ((tex_info.y & 2u) == 0) {
// modulate + no tcc
color.rgb = fragment_color.rgb;
color.a = fragment_color.a * 2;
} else {
// decal + no tcc
color.rgb = vec3(1);
color.a = fragment_color.a * 2;
}
if ((tex_info.y & 2u) == 0) {
// modulate + tcc
color = fragment_color * T0;
} else {
if ((tex_info.y & 2u) == 0) {
// modulate + tcc
color = fragment_color;
} else {
// decal + tcc
color.rgb = vec3(0.5);
color.a = 1.0;
}
// decal + tcc
color.rgb = T0.rgb * 0.5;
color.a = T0.a;
}
}
color.rgb *= color_mult;
color *= 2;
} else {
if ((tex_info.y & 1u) == 0) {
if ((tex_info.y & 2u) == 0) {
// modulate + no tcc
color.rgb = fragment_color.rgb;
color.a = fragment_color.a * 2;
} else {
// decal + no tcc
color.rgb = vec3(1);
color.a = fragment_color.a * 2;
}
} else {
if ((tex_info.y & 2u) == 0) {
// modulate + tcc
color = fragment_color;
} else {
// decal + tcc
color.rgb = vec3(0.5);
color.a = 1.0;
}
}
}
color.rgb *= color_mult;
if (color.a < alpha_reject) {
discard;
}
if ((tex_info.y & 4u) != 0) {
color.xyz = mix(color.xyz, fog_color.rgb, clamp(fog_color.a * fog, 0, 1));
}
if (color.a < alpha_reject) {
discard;
}
if ((tex_info.y & 4u) != 0) {
color.xyz = mix(color.xyz, fog_color.rgb, clamp(fog_color.a * fog, 0, 1));
}
}
@@ -20,75 +20,74 @@ out float fog;
out flat uvec2 tex_info;
const float warp_off = 1.f - (416.f/512.f);
const float warp_mult = 512.f/416.f;
const float warp_off = 1.0f - (SCISSOR_HEIGHT / 512.0f);
void main() {
// lq.xy vf22, 0(vi10) texture load?
// lq_buffer(Mask::xy, vu.vf22, vu.vi10);
// lq.xy vf22, 0(vi10) texture load?
// lq_buffer(Mask::xy, vu.vf22, vu.vi10);
// lq.xyz vf16, 2(vi10) vertex load
// lq_buffer(Mask::xyz, gen.vtx_load0, vu.vi10 + 2);
// lq.xyz vf16, 2(vi10) vertex load
// lq_buffer(Mask::xyz, gen.vtx_load0, vu.vi10 + 2);
// mtir vi02, vf22.x grab s coordinate of texture
// vu.vi02 = vu.vf22.x_as_u16();
// mtir vi02, vf22.x grab s coordinate of texture
// vu.vi02 = vu.vf22.x_as_u16();
// mulaw.xyzw ACC, vf11, vf00 matrix multiply W
// vu.acc.mula(Mask::xyzw, gen.mat3, vu.vf00.w());
vec4 transformed;
// mulaw.xyzw ACC, vf11, vf00 matrix multiply W
// vu.acc.mula(Mask::xyzw, gen.mat3, vu.vf00.w());
vec4 transformed;
// maddax.xyzw ACC, vf08, vf16 matrix multiply X
// vu.acc.madda(Mask::xyzw, gen.mat0, gen.vtx_load0.x());
transformed.xyz = position_in * scale.xyz;
transformed.z += mat_32;
transformed.w = mat_23 * position_in.z + mat_33;
// maddax.xyzw ACC, vf08, vf16 matrix multiply X
// vu.acc.madda(Mask::xyzw, gen.mat0, gen.vtx_load0.x());
transformed.xyz = position_in * scale.xyz;
transformed.z += mat_32;
transformed.w = mat_23 * position_in.z + mat_33;
transformed *= -1; // todo?
transformed *= -1; // todo?
// div Q, vf01.x, vf12.w perspective divide
// vu.Q = gen.fog.x() / gen.vtx_p0.w();
float Q = fog_constants.x / transformed.w;
// div Q, vf01.x, vf12.w perspective divide
// vu.Q = gen.fog.x() / gen.vtx_p0.w();
float Q = fog_constants.x / transformed.w;
fog = 255 - clamp(-transformed.w + hvdf_offset.w, fog_constants.y, fog_constants.z);
fog = 255 - clamp(-transformed.w + hvdf_offset.w, fog_constants.y, fog_constants.z);
// itof12.xyz vf18, vf22 texture int to float
// vu.vf18.itof12(Mask::xyz, vu.vf22);
tex_coord = tex_coord_in / 4096.f;
// itof12.xyz vf18, vf22 texture int to float
// vu.vf18.itof12(Mask::xyz, vu.vf22);
tex_coord = tex_coord_in / 4096.f;
if (warp_sample_mode == 1) {
tex_coord = vec2(tex_coord.x, (1.0f - tex_coord.y - warp_off) * warp_mult);
}
if (warp_sample_mode == 1) {
tex_coord = vec2(tex_coord.x, (1.0f - tex_coord.y - warp_off) * SCISSOR_ADJUST);
}
// mul.xyz vf12, vf12, Q persepective divide
// gen.vtx_p0.mul(Mask::xyz, gen.vtx_p0, vu.Q);
transformed.xyz *= Q;
// mul.xyz vf12, vf12, Q persepective divide
// gen.vtx_p0.mul(Mask::xyz, gen.vtx_p0, vu.Q);
transformed.xyz *= Q;
// mul.xyz vf18, vf18, Q texture perspective divide
// vu.vf18.mul(Mask::xyz, vu.vf18, vu.Q);
// mul.xyz vf18, vf18, Q texture perspective divide
// vu.vf18.mul(Mask::xyz, vu.vf18, vu.Q);
// add.xyzw vf12, vf12, vf04 apply hvdf
// gen.vtx_p0.add(Mask::xyzw, gen.vtx_p0, gen.hvdf_off);
transformed.xyz += hvdf_offset.xyz;
// add.xyzw vf12, vf12, vf04 apply hvdf
// gen.vtx_p0.add(Mask::xyzw, gen.vtx_p0, gen.hvdf_off);
transformed.xyz += hvdf_offset.xyz;
// correct xy offset
transformed.xy -= (2048.);
// correct xy offset
transformed.xy -= (2048.);
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
// hack
transformed.xyz *= transformed.w;
// hack
transformed.xyz *= transformed.w;
gl_Position = transformed;
// scissoring area adjust
gl_Position.y *= SCISSOR_ADJUST * HEIGHT_SCALE;
gl_Position = transformed;
// scissoring area adjust
gl_Position.y *= SCISSOR_ADJUST * HEIGHT_SCALE;
fragment_color = vec4(rgba_in.rgb, rgba_in.a * 2);
tex_info = byte_info.xy;
fragment_color = vec4(rgba_in.rgb, rgba_in.a * 2);
tex_info = byte_info.xy;
}
@@ -16,25 +16,25 @@ uniform int decal_enable;
uniform int gfx_hack_no_tex;
void main() {
if (gfx_hack_no_tex == 0) {
vec4 T0 = texture(tex_T0, vtx_st);
// all merc is tcc=rgba and modulate
if (decal_enable == 0) {
color = vtx_color * T0 * 2;
} else {
color = T0;
}
color.a *= 2;
//color.a = T0.a * 4;
if (gfx_hack_no_tex == 0) {
vec4 T0 = texture(tex_T0, vtx_st);
// all merc is tcc=rgba and modulate
if (decal_enable == 0) {
color = vtx_color * T0 * 2;
} else {
color.rgb = vtx_color.rgb;
color.a = 1;
color = T0;
}
color.a *= 2;
//color.a = T0.a * 4;
} else {
color.rgb = vtx_color.rgb;
color.a = 1;
}
if (ignore_alpha == 0 && color.w < 0.128) {
discard;
}
if (ignore_alpha == 0 && color.w < 0.128) {
discard;
}
color.xyz = mix(color.xyz, fog_color.rgb, clamp(fog_color.a * fog, 0, 1));
}
@@ -30,13 +30,13 @@ out vec2 vtx_st;
out float fog;
struct MercMatrixData {
mat4 X;
mat3 R;
vec4 pad;
mat4 X;
mat3 R;
vec4 pad;
};
layout (std140, binding = 1) uniform ub_bones {
MercMatrixData bones[128];
MercMatrixData bones[128];
};
@@ -56,59 +56,59 @@ maddz.xyzw vf26, vf28, vf25
```
*/
void main() {
// vec4 transformed = -perspective3.xyzw;
// transformed += -perspective0 * position_in.x;
// transformed += -perspective1 * position_in.y;
// transformed += -perspective2 * position_in.z;
// vec4 transformed = -perspective3.xyzw;
// transformed += -perspective0 * position_in.x;
// transformed += -perspective1 * position_in.y;
// transformed += -perspective2 * position_in.z;
// vec4 transformed = -hmat3.xyzw;
// transformed += -hmat0 * position_in.x;
// transformed += -hmat1 * position_in.y;
// transformed += -hmat2 * position_in.z;
// vec4 transformed = -hmat3.xyzw;
// transformed += -hmat0 * position_in.x;
// transformed += -hmat1 * position_in.y;
// transformed += -hmat2 * position_in.z;
vec4 p = vec4(position_in, 1);
vec4 vtx_pos = -bones[mats[0]].X * p * weights_in[0];
vec3 rotated_nrm = bones[mats[0]].R * normal_in * weights_in[0];
vec4 p = vec4(position_in, 1);
vec4 vtx_pos = -bones[mats[0]].X * p * weights_in[0];
vec3 rotated_nrm = bones[mats[0]].R * normal_in * weights_in[0];
// game may send garbage bones if the weight is 0, don't let NaNs sneak in.
if (weights_in[1] > 0) {
vtx_pos += -bones[mats[1]].X * p * weights_in[1];
rotated_nrm += bones[mats[1]].R * normal_in * weights_in[1];
}
if (weights_in[2] > 0) {
vtx_pos += -bones[mats[2]].X * p * weights_in[2];
rotated_nrm += bones[mats[2]].R * normal_in * weights_in[2];
}
// game may send garbage bones if the weight is 0, don't let NaNs sneak in.
if (weights_in[1] > 0) {
vtx_pos += -bones[mats[1]].X * p * weights_in[1];
rotated_nrm += bones[mats[1]].R * normal_in * weights_in[1];
}
if (weights_in[2] > 0) {
vtx_pos += -bones[mats[2]].X * p * weights_in[2];
rotated_nrm += bones[mats[2]].R * normal_in * weights_in[2];
}
vec4 transformed = perspective_matrix * vtx_pos;
vec4 transformed = perspective_matrix * vtx_pos;
rotated_nrm = normalize(rotated_nrm);
vec3 light_intensity = light_dir0 * rotated_nrm.x + light_dir1 * rotated_nrm.y + light_dir2 * rotated_nrm.z;
light_intensity = max(light_intensity, vec3(0, 0, 0));
rotated_nrm = normalize(rotated_nrm);
vec3 light_intensity = light_dir0 * rotated_nrm.x + light_dir1 * rotated_nrm.y + light_dir2 * rotated_nrm.z;
light_intensity = max(light_intensity, vec3(0, 0, 0));
vec4 light_color = light_ambient
+ light_intensity.x * light_col0
+ light_intensity.y * light_col1
+ light_intensity.z * light_col2;
vec4 light_color = light_ambient
+ light_intensity.x * light_col0
+ light_intensity.y * light_col1
+ light_intensity.z * light_col2;
float Q = fog_constants.x / transformed[3];
fog = 255 - clamp(-transformed.w + hvdf_offset.w, fog_constants.y, fog_constants.z);
float Q = fog_constants.x / transformed[3];
fog = 255 - clamp(-transformed.w + hvdf_offset.w, fog_constants.y, fog_constants.z);
transformed.xyz *= Q;
transformed.xyz += hvdf_offset.xyz;
transformed.xy -= (2048.);
transformed.z /= (8388608);
transformed.z -= 1;
transformed.x /= (256);
transformed.y /= -(128);
transformed.xyz *= transformed.w;
transformed.y *= SCISSOR_ADJUST * HEIGHT_SCALE;
gl_Position = transformed;
transformed.xyz *= Q;
transformed.xyz += hvdf_offset.xyz;
transformed.xy -= (2048.);
transformed.z /= (8388608);
transformed.z -= 1;
transformed.x /= (256);
transformed.y /= -(128);
transformed.xyz *= transformed.w;
transformed.y *= SCISSOR_ADJUST * HEIGHT_SCALE;
gl_Position = transformed;
vtx_color = rgba * light_color;
vtx_st = st_in;
vtx_color = rgba * light_color;
vtx_st = st_in;
}
@@ -15,16 +15,16 @@ in float fog;
uniform sampler2D tex_T0;
void main() {
vec4 T0 = texture(tex_T0, tex_coord.xy / tex_coord.z);
if (bucket == 0) {
color.rgb = fragment_color.rgb * T0.rgb;
color.a = fragment_color.a;
color.rgb = mix(color.rgb, fog_color.rgb, clamp(fog_color.a * fog, 0, 1));
} else if (bucket == 1 || bucket == 2 || bucket == 4) {
color = fragment_color * T0;
} else if (bucket == 3) {
color = fragment_color * T0;
color.rgb = mix(color.rgb, fog_color.rgb, clamp(fog_color.a * fog, 0, 1));
}
vec4 T0 = texture(tex_T0, tex_coord.xy / tex_coord.z);
if (bucket == 0) {
color.rgb = fragment_color.rgb * T0.rgb;
color.a = fragment_color.a;
color.rgb = mix(color.rgb, fog_color.rgb, clamp(fog_color.a * fog, 0, 1));
} else if (bucket == 1 || bucket == 2 || bucket == 4) {
color = fragment_color * T0;
} else if (bucket == 3) {
color = fragment_color * T0;
color.rgb = mix(color.rgb, fog_color.rgb, clamp(fog_color.a * fog, 0, 1));
}
}
@@ -12,18 +12,18 @@ out float fog;
uniform int bucket;
void main() {
gl_Position = vec4((position_in.x - 0.5) * 16., -(position_in.y - 0.5) * 32, position_in.z * 2 - 1., 1.0);
// scissoring area adjust
gl_Position.y *= SCISSOR_ADJUST * HEIGHT_SCALE;
fragment_color = vec4(rgba_in.rgb, rgba_in.a * 2);
tex_coord = tex_coord_in;
fog = 255 - fog_in;
if (bucket == 0) {
fragment_color.rgb *= 2;
} else if (bucket == 1 || bucket == 3) {
fragment_color *= 2;
} else if (bucket == 4) {
fragment_color.a = 0;
}
gl_Position = vec4((position_in.x - 0.5) * 16., -(position_in.y - 0.5) * 32, position_in.z * 2 - 1., 1.0);
// scissoring area adjust
gl_Position.y *= SCISSOR_ADJUST * HEIGHT_SCALE;
fragment_color = vec4(rgba_in.rgb, rgba_in.a * 2);
tex_coord = tex_coord_in;
fog = 255 - fog_in;
if (bucket == 0) {
fragment_color.rgb *= 2;
} else if (bucket == 1 || bucket == 3) {
fragment_color *= 2;
} else if (bucket == 4) {
fragment_color.a = 0;
}
}
@@ -7,6 +7,6 @@ in vec4 fragment_color;
uniform sampler2D tex_T0;
void main() {
vec4 tex = texture(tex_T0, tex_coord);
color = fragment_color * tex;
vec4 tex = texture(tex_T0, tex_coord);
color = fragment_color * tex;
}
@@ -8,8 +8,8 @@ out vec4 fragment_color;
out vec2 tex_coord;
void main() {
// inputs are 0 - 2048.
gl_Position = vec4((position_in.x - 1024) / 1024, (position_in.y - 1024) / 1024, 0.5, 1.0);
fragment_color = vec4(rgba_in.rgb * 2, 1);
tex_coord = tex_coord_in;
// inputs are 0 - 2048.
gl_Position = vec4((position_in.x - 1024) / 1024, (position_in.y - 1024) / 1024, 0.5, 1.0);
fragment_color = vec4(rgba_in.rgb * 2, 1);
tex_coord = tex_coord_in;
}
@@ -7,7 +7,7 @@ uniform float alpha_intensity;
uniform sampler2D tex_T0;
void main() {
vec4 tex = texture(tex_T0, tex_coord);
tex.w *= alpha_intensity;
color = tex;
}
vec4 tex = texture(tex_T0, tex_coord);
tex.w *= alpha_intensity;
color = tex;
}
@@ -6,6 +6,6 @@ layout (location = 1) in vec2 tex_coord_in;
out vec2 tex_coord;
uniform float scale;
void main() {
gl_Position = vec4(position_in.x * scale - (1 - scale), position_in.y * scale - (1 - scale), 0.5, 1.0);
tex_coord = tex_coord_in;
gl_Position = vec4(position_in.x * scale - (1 - scale), position_in.y * scale - (1 - scale), 0.5, 1.0);
tex_coord = tex_coord_in;
}
@@ -3,8 +3,8 @@
layout (location = 0) in vec3 position_in;
void main() {
// Note: position.y is multiplied by 32 instead of 16 to undo the half-height for interlacing stuff.
gl_Position = vec4((position_in.x - 0.5) * 16., -(position_in.y - 0.5) * 32, position_in.z * 2 - 1., 1.0);
// scissoring area adjust
gl_Position.y *= SCISSOR_ADJUST;
// Note: position.y is multiplied by 32 instead of 16 to undo the half-height for interlacing stuff.
gl_Position = vec4((position_in.x - 0.5) * 16., -(position_in.y - 0.5) * 32, position_in.z * 2 - 1., 1.0);
// scissoring area adjust
gl_Position.y *= SCISSOR_ADJUST;
}
@@ -14,16 +14,16 @@ uniform vec4 fog_color;
uniform int gfx_hack_no_tex;
void main() {
if (gfx_hack_no_tex == 0) {
vec4 T0 = texture(tex_T0, tex_coord.xy);
color = fragment_color * T0;
} else {
color = fragment_color;
}
if (gfx_hack_no_tex == 0) {
vec4 T0 = texture(tex_T0, tex_coord.xy);
color = fragment_color * T0;
} else {
color = fragment_color;
}
if (color.a < alpha_min || color.a > alpha_max) {
discard;
}
if (color.a < alpha_min || color.a > alpha_max) {
discard;
}
color.xyz = mix(color.xyz, fog_color.rgb, clamp(fogginess * fog_color.a, 0, 1));
color.xyz = mix(color.xyz, fog_color.rgb, clamp(fogginess * fog_color.a, 0, 1));
}
@@ -18,65 +18,63 @@ out vec3 tex_coord;
out float fogginess;
void main() {
// old system:
// - load vf12
// - itof0 vf12
// - multiply with camera matrix (add trans)
// - let Q = fogx / vf12.w
// - xyz *= Q
// - xyzw += hvdf_offset
// - clip w.
// - ftoi4 vf12
// use in gs.
// gs is 12.4 fixed point, set up with 2048.0 as the center.
// the itof0 is done in the preprocessing step. now we have floats.
// Step 3, the camera transform
vec4 transformed = -camera[3];
transformed -= camera[0] * position_in.x;
transformed -= camera[1] * position_in.y;
transformed -= camera[2] * position_in.z;
// old system:
// - load vf12
// - itof0 vf12
// - multiply with camera matrix (add trans)
// - let Q = fogx / vf12.w
// - xyz *= Q
// - xyzw += hvdf_offset
// - clip w.
// - ftoi4 vf12
// use in gs.
// gs is 12.4 fixed point, set up with 2048.0 as the center.
// compute Q
float Q = fog_constant / transformed.w;
// the itof0 is done in the preprocessing step. now we have floats.
// Step 3, the camera transform
vec4 transformed = -camera[3];
transformed -= camera[0] * position_in.x;
transformed -= camera[1] * position_in.y;
transformed -= camera[2] * position_in.z;
// do fog!
fogginess = 255 - clamp(-transformed.w + hvdf_offset.w, fog_min, fog_max);
// compute Q
float Q = fog_constant / transformed.w;
// perspective divide!
transformed.xyz *= Q;
// offset
transformed.xyz += hvdf_offset.xyz;
// correct xy offset
transformed.xy -= (2048.);
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
// hack
transformed.xyz *= transformed.w;
// scissoring area adjust
transformed.y *= SCISSOR_ADJUST * HEIGHT_SCALE;
gl_Position = transformed;
// do fog!
fogginess = 255 - clamp(-transformed.w + hvdf_offset.w, fog_min, fog_max);
// time of day lookup
// start with the vertex color (only rgb, VIF filled in the 255.)
fragment_color = vec4(rgba_base, 1);
// get the time of day multiplier
vec4 tod_color = texelFetch(tex_T1, time_of_day_index, 0);
// combine
fragment_color *= tod_color * 4;
fragment_color.a *= 2;
// perspective divide!
transformed.xyz *= Q;
// offset
transformed.xyz += hvdf_offset.xyz;
// correct xy offset
transformed.xy -= (2048.);
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
// hack
transformed.xyz *= transformed.w;
// scissoring area adjust
transformed.y *= SCISSOR_ADJUST * HEIGHT_SCALE;
gl_Position = transformed;
if (decal == 1) {
fragment_color.xyz = vec3(1.0, 1.0, 1.0);
}
// time of day lookup
// start with the vertex color (only rgb, VIF filled in the 255.)
fragment_color = vec4(rgba_base, 1);
// get the time of day multiplier
vec4 tod_color = texelFetch(tex_T1, time_of_day_index, 0);
// combine
fragment_color *= tod_color * 4;
fragment_color.a *= 2;
if (decal == 1) {
fragment_color.xyz = vec3(1.0, 1.0, 1.0);
}
tex_coord = tex_coord_in;
tex_coord.xy /= 4096;
tex_coord = tex_coord_in;
tex_coord.xy /= 4096;
}
@@ -7,7 +7,7 @@ noperspective in vec3 tex_coord;
uniform sampler2D tex_T0;
void main() {
vec4 T0 = texture(tex_T0, tex_coord.xy / tex_coord.z);
T0.w = 1.0;
color = fragment_color * T0 * 1.0;
vec4 T0 = texture(tex_T0, tex_coord.xy / tex_coord.z);
T0.w = 1.0;
color = fragment_color * T0 * 1.0;
}
@@ -8,9 +8,9 @@ out vec4 fragment_color;
noperspective out vec3 tex_coord;
void main() {
gl_Position = vec4((position_in.x - 0.5) * 16. , -(position_in.y - 0.5) * 32, position_in.z * 2 - 1., 1.0);
// scissoring area adjust
gl_Position.y *= SCISSOR_ADJUST;
fragment_color = vec4(rgba_in.x, rgba_in.y, rgba_in.z, rgba_in.a * 2);
tex_coord = tex_coord_in;
gl_Position = vec4((position_in.x - 0.5) * 16. , -(position_in.y - 0.5) * 32, position_in.z * 2 - 1., 1.0);
// scissoring area adjust
gl_Position.y *= SCISSOR_ADJUST;
fragment_color = vec4(rgba_in.x, rgba_in.y, rgba_in.z, rgba_in.a * 2);
tex_coord = tex_coord_in;
}
@@ -6,6 +6,6 @@ in vec3 tex_coord;
layout (binding = 0) uniform sampler2D tex_T0;
void main() {
vec4 T0 = texture(tex_T0, tex_coord.xy);
color = vec4(((T0 )) * tex_coord.z);
vec4 T0 = texture(tex_T0, tex_coord.xy);
color = vec4(T0 * tex_coord.z);
}
@@ -5,6 +5,6 @@ layout (location = 0) in vec3 position_in;
out vec3 tex_coord;
void main() {
gl_Position = vec4(position_in.x*2 -1, position_in.y*2-1, 0.0, 1.0);
tex_coord = position_in;
gl_Position = vec4(position_in.x*2 -1, position_in.y*2-1, 0.0, 1.0);
tex_coord = position_in;
}
@@ -11,13 +11,13 @@ uniform float alpha_min;
uniform float alpha_max;
void main() {
vec4 T0 = texture(tex_T0, tex_coord.xy);
if (tex_info.y == 0) {
T0.w = 1.0;
}
color = fragment_color * T0;
vec4 T0 = texture(tex_T0, tex_coord.xy);
if (tex_info.y == 0) {
T0.w = 1.0;
}
color = fragment_color * T0;
if (color.a < alpha_min || color.a > alpha_max) {
discard;
}
if (color.a < alpha_min || color.a > alpha_max) {
discard;
}
}
@@ -29,149 +29,149 @@ out vec3 tex_coord;
out flat uvec2 tex_info;
vec4 matrix_transform(mat4 mtx, vec3 pt) {
return mtx[3]
+ mtx[0] * pt.x
+ mtx[1] * pt.y
+ mtx[2] * pt.z;
return mtx[3]
+ mtx[0] * pt.x
+ mtx[1] * pt.y
+ mtx[2] * pt.z;
}
mat3 sprite_quat_to_rot(vec3 quat) {
mat3 result;
float qr = sqrt(abs(1.0 - (quat.x * quat.x + quat.y * quat.y + quat.z * quat.z)));
result[0][0] = 1.0 - 2.0 * (quat.y * quat.y + quat.z * quat.z);
result[1][0] = 2.0 * (quat.x * quat.y - quat.z * qr);
result[2][0] = 2.0 * (quat.x * quat.z + quat.y * qr);
result[0][1] = 2.0 * (quat.x * quat.y + quat.z * qr);
result[1][1] = 1.0 - 2.0 * (quat.x * quat.x + quat.z * quat.z);
result[2][1] = 2.0 * (quat.y * quat.z - quat.x * qr);
result[0][2] = 2.0 * (quat.x * quat.z - quat.y * qr);
result[1][2] = 2.0 * (quat.y * quat.z + quat.x * qr);
result[2][2] = 1.0 - 2.0 * (quat.x * quat.x + quat.y * quat.y);
return result;
mat3 result;
float qr = sqrt(abs(1.0 - (quat.x * quat.x + quat.y * quat.y + quat.z * quat.z)));
result[0][0] = 1.0 - 2.0 * (quat.y * quat.y + quat.z * quat.z);
result[1][0] = 2.0 * (quat.x * quat.y - quat.z * qr);
result[2][0] = 2.0 * (quat.x * quat.z + quat.y * qr);
result[0][1] = 2.0 * (quat.x * quat.y + quat.z * qr);
result[1][1] = 1.0 - 2.0 * (quat.x * quat.x + quat.z * quat.z);
result[2][1] = 2.0 * (quat.y * quat.z - quat.x * qr);
result[0][2] = 2.0 * (quat.x * quat.z - quat.y * qr);
result[1][2] = 2.0 * (quat.y * quat.z + quat.x * qr);
result[2][2] = 1.0 - 2.0 * (quat.x * quat.x + quat.y * quat.y);
return result;
}
vec4 sprite_transform2(vec3 root, vec4 off, mat3 sprite_rot, float sx, float sy) {
vec3 pos = root;
vec3 pos = root;
vec3 offset = sprite_rot[0] * off.x * sx + sprite_rot[1] * off.y + sprite_rot[2] * off.z * sy;
vec3 offset = sprite_rot[0] * off.x * sx + sprite_rot[1] * off.y + sprite_rot[2] * off.z * sy;
pos += offset;
vec4 transformed_pos = -matrix_transform(camera, pos);
float Q = pfog0 / transformed_pos.w;
transformed_pos.xyz *= Q;
transformed_pos.xyz += hvdf_offset.xyz;
pos += offset;
vec4 transformed_pos = -matrix_transform(camera, pos);
float Q = pfog0 / transformed_pos.w;
transformed_pos.xyz *= Q;
transformed_pos.xyz += hvdf_offset.xyz;
return transformed_pos;
return transformed_pos;
}
void main() {
// STEP 1: UNPACK DATA AND CREATE READABLE VARIABLES
// STEP 1: UNPACK DATA AND CREATE READABLE VARIABLES
vec3 position = xyz_sx.xyz;
float sx = xyz_sx.w;
float sy = quat_sy.w;
fragment_color = rgba;
uint vert_id = tex_info_in.z;
uint rendermode = tex_info_in.w; // 2D, HUD, 3D
vec3 quat = quat_sy.xyz;
uint matrix = flags_matrix.y;
vec3 position = xyz_sx.xyz;
float sx = xyz_sx.w;
float sy = quat_sy.w;
fragment_color = rgba;
uint vert_id = tex_info_in.z;
uint rendermode = tex_info_in.w; // 2D, HUD, 3D
vec3 quat = quat_sy.xyz;
uint matrix = flags_matrix.y;
vec4 transformed;
vec4 transformed;
// STEP 2: perspective transform for distance
vec4 transformed_pos_vf02 = matrix_transform(rendermode == 2 ? hud_matrix : camera, position);
float Q = pfog0 / transformed_pos_vf02.w;
// STEP 2: perspective transform for distance
vec4 transformed_pos_vf02 = matrix_transform(rendermode == 2 ? hud_matrix : camera, position);
float Q = pfog0 / transformed_pos_vf02.w;
// STEP 3: fade out sprite!
vec4 scales_vf01 = xyz_sx; // now used for something else.
scales_vf01.z = sy; // start building the scale vector
scales_vf01.zw *= Q; // sy sx
scales_vf01.x = scales_vf01.z; // = sy
scales_vf01.x *= scales_vf01.w; // x = sx * sy
scales_vf01.x *= inv_area; // x = sx * sy * inv_area (area ratio)
fragment_color.w *= min(scales_vf01.x, 1.0); // is this right? doesn't this stall??
// STEP 3: fade out sprite!
vec4 scales_vf01 = xyz_sx; // now used for something else.
scales_vf01.z = sy; // start building the scale vector
scales_vf01.zw *= Q; // sy sx
scales_vf01.x = scales_vf01.z; // = sy
scales_vf01.x *= scales_vf01.w; // x = sx * sy
scales_vf01.x *= inv_area; // x = sx * sy * inv_area (area ratio)
fragment_color.w *= min(scales_vf01.x, 1.0); // is this right? doesn't this stall??
// STEP 4: actual vertex transformation
if (rendermode == 3) { // 3D sprites
// STEP 4: actual vertex transformation
if (rendermode == 3) { // 3D sprites
mat3 rot = sprite_quat_to_rot(quat);
transformed = sprite_transform2(position, xyz_array[vert_id], rot, sx, sy);
mat3 rot = sprite_quat_to_rot(quat);
transformed = sprite_transform2(position, xyz_array[vert_id], rot, sx, sy);
} else if (rendermode == 1) { // 2D sprites
} else if (rendermode == 1) { // 2D sprites
transformed_pos_vf02.xyz *= Q;
vec4 offset_pos_vf10 = transformed_pos_vf02 + hvdf_offset;
offset_pos_vf10.w = max(offset_pos_vf10.w, fog_min);
transformed_pos_vf02.xyz *= Q;
vec4 offset_pos_vf10 = transformed_pos_vf02 + hvdf_offset;
offset_pos_vf10.w = max(offset_pos_vf10.w, fog_min);
/* transformed_pos_vf02.w = offset_pos_vf10.w - fog_max;
int fge = matrix == 0;
if (transformed_pos_vf02.w != 0) {
fge = false;
} */
/* transformed_pos_vf02.w = offset_pos_vf10.w - fog_max;
int fge = matrix == 0;
if (transformed_pos_vf02.w != 0) {
fge = false;
} */
scales_vf01.z = clamp(scales_vf01.z, min_scale, max_scale);
scales_vf01.w = clamp(scales_vf01.w, min_scale, max_scale);
scales_vf01.z = clamp(scales_vf01.z, min_scale, max_scale);
scales_vf01.w = clamp(scales_vf01.w, min_scale, max_scale);
quat.z *= deg_to_rad;
float sp_sin = sin(quat.z);
float sp_cos = cos(quat.z);
quat.z *= deg_to_rad;
float sp_sin = sin(quat.z);
float sp_cos = cos(quat.z);
vec4 xy0_vf19 = xy_array[vert_id + flags_matrix.x];
vec4 vf12_rotated = (basis_x * sp_cos) - (basis_y * sp_sin);
vec4 vf13_rotated_trans = (basis_x * sp_sin) + (basis_y * sp_cos);
vec4 xy0_vf19 = xy_array[vert_id + flags_matrix.x];
vec4 vf12_rotated = (basis_x * sp_cos) - (basis_y * sp_sin);
vec4 vf13_rotated_trans = (basis_x * sp_sin) + (basis_y * sp_cos);
vf12_rotated *= scales_vf01.w;
vf13_rotated_trans *= scales_vf01.z;
vf12_rotated *= scales_vf01.w;
vf13_rotated_trans *= scales_vf01.z;
transformed = offset_pos_vf10 + vf12_rotated * xy0_vf19.x + vf13_rotated_trans * xy0_vf19.y;
transformed = offset_pos_vf10 + vf12_rotated * xy0_vf19.x + vf13_rotated_trans * xy0_vf19.y;
} else if (rendermode == 2) { // hud sprites
transformed_pos_vf02.xyz *= Q;
vec4 offset_pos_vf10 = transformed_pos_vf02 + (matrix == 0 ? hud_hvdf_offset : hud_hvdf_user[matrix - 1]);
} else if (rendermode == 2) { // hud sprites
transformed_pos_vf02.xyz *= Q;
vec4 offset_pos_vf10 = transformed_pos_vf02 + (matrix == 0 ? hud_hvdf_offset : hud_hvdf_user[matrix - 1]);
// NOTE: no max scale for hud
scales_vf01.z = max(scales_vf01.z, min_scale);
scales_vf01.w = max(scales_vf01.w, min_scale);
// NOTE: no max scale for hud
scales_vf01.z = max(scales_vf01.z, min_scale);
scales_vf01.w = max(scales_vf01.w, min_scale);
quat.z *= deg_to_rad;
float sp_sin = sin(quat.z);
float sp_cos = cos(quat.z);
quat.z *= deg_to_rad;
float sp_sin = sin(quat.z);
float sp_cos = cos(quat.z);
vec4 xy0_vf19 = xy_array[vert_id + flags_matrix.x];
vec4 vf12_rotated = (basis_x * sp_cos) - (basis_y * sp_sin);
vec4 vf13_rotated_trans = (basis_x * sp_sin) + (basis_y * sp_cos);
vec4 xy0_vf19 = xy_array[vert_id + flags_matrix.x];
vec4 vf12_rotated = (basis_x * sp_cos) - (basis_y * sp_sin);
vec4 vf13_rotated_trans = (basis_x * sp_sin) + (basis_y * sp_cos);
vf12_rotated *= scales_vf01.w;
vf13_rotated_trans *= scales_vf01.z;
vf12_rotated *= scales_vf01.w;
vf13_rotated_trans *= scales_vf01.z;
transformed = offset_pos_vf10 + vf12_rotated * xy0_vf19.x + vf13_rotated_trans * xy0_vf19.y;
transformed = offset_pos_vf10 + vf12_rotated * xy0_vf19.x + vf13_rotated_trans * xy0_vf19.y;
}
}
tex_coord = st_array[vert_id].xyz;
tex_coord = st_array[vert_id].xyz;
// STEP 5: final adjustments
// correct xy offset
transformed.xy -= (2048.);
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
// hack
transformed.xyz *= transformed.w;
// scissoring area adjust
transformed.y *= SCISSOR_ADJUST * HEIGHT_SCALE;
gl_Position = transformed;
// STEP 5: final adjustments
// correct xy offset
transformed.xy -= (2048.);
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
// hack
transformed.xyz *= transformed.w;
// scissoring area adjust
transformed.y *= SCISSOR_ADJUST * HEIGHT_SCALE;
gl_Position = transformed;
fragment_color *= 2;
fragment_color.w *= 2;
fragment_color *= 2;
fragment_color.w *= 2;
tex_info = tex_info_in.xy;
tex_info = tex_info_in.xy;
}
@@ -31,150 +31,150 @@ out vec3 tex_coord;
out flat uvec2 tex_info;
vec4 matrix_transform(mat4 mtx, vec3 pt) {
return mtx[3]
+ mtx[0] * pt.x
+ mtx[1] * pt.y
+ mtx[2] * pt.z;
return mtx[3]
+ mtx[0] * pt.x
+ mtx[1] * pt.y
+ mtx[2] * pt.z;
}
mat3 sprite_quat_to_rot(vec3 quat) {
mat3 result;
float qr = sqrt(abs(1.0 - (quat.x * quat.x + quat.y * quat.y + quat.z * quat.z)));
result[0][0] = 1.0 - 2.0 * (quat.y * quat.y + quat.z * quat.z);
result[1][0] = 2.0 * (quat.x * quat.y - quat.z * qr);
result[2][0] = 2.0 * (quat.x * quat.z + quat.y * qr);
result[0][1] = 2.0 * (quat.x * quat.y + quat.z * qr);
result[1][1] = 1.0 - 2.0 * (quat.x * quat.x + quat.z * quat.z);
result[2][1] = 2.0 * (quat.y * quat.z - quat.x * qr);
result[0][2] = 2.0 * (quat.x * quat.z - quat.y * qr);
result[1][2] = 2.0 * (quat.y * quat.z + quat.x * qr);
result[2][2] = 1.0 - 2.0 * (quat.x * quat.x + quat.y * quat.y);
return result;
mat3 result;
float qr = sqrt(abs(1.0 - (quat.x * quat.x + quat.y * quat.y + quat.z * quat.z)));
result[0][0] = 1.0 - 2.0 * (quat.y * quat.y + quat.z * quat.z);
result[1][0] = 2.0 * (quat.x * quat.y - quat.z * qr);
result[2][0] = 2.0 * (quat.x * quat.z + quat.y * qr);
result[0][1] = 2.0 * (quat.x * quat.y + quat.z * qr);
result[1][1] = 1.0 - 2.0 * (quat.x * quat.x + quat.z * quat.z);
result[2][1] = 2.0 * (quat.y * quat.z - quat.x * qr);
result[0][2] = 2.0 * (quat.x * quat.z - quat.y * qr);
result[1][2] = 2.0 * (quat.y * quat.z + quat.x * qr);
result[2][2] = 1.0 - 2.0 * (quat.x * quat.x + quat.y * quat.y);
return result;
}
vec4 sprite_transform2(vec3 root, vec4 off, mat3 sprite_rot, float sx, float sy) {
vec3 pos = root;
vec3 pos = root;
vec3 offset = sprite_rot[0] * off.x * sx + sprite_rot[1] * off.y + sprite_rot[2] * off.z * sy;
vec3 offset = sprite_rot[0] * off.x * sx + sprite_rot[1] * off.y + sprite_rot[2] * off.z * sy;
pos += offset;
vec4 transformed_pos = -matrix_transform(camera, pos);
float Q = pfog0 / transformed_pos.w;
transformed_pos.xyz *= Q;
transformed_pos.xyz += hvdf_offset.xyz;
pos += offset;
vec4 transformed_pos = -matrix_transform(camera, pos);
float Q = pfog0 / transformed_pos.w;
transformed_pos.xyz *= Q;
transformed_pos.xyz += hvdf_offset.xyz;
return transformed_pos;
return transformed_pos;
}
void main() {
// STEP 1: UNPACK DATA AND CREATE READABLE VARIABLES
// STEP 1: UNPACK DATA AND CREATE READABLE VARIABLES
vec3 position = xyz_sx.xyz;
float sx = xyz_sx.w;
float sy = quat_sy.w;
fragment_color = rgba;
uint vert_id = tex_info_in.z;
uint rendermode = tex_info_in.w; // 2D, HUD, 3D
vec3 quat = quat_sy.xyz;
uint matrix = flags_matrix.y;
vec3 position = xyz_sx.xyz;
float sx = xyz_sx.w;
float sy = quat_sy.w;
fragment_color = rgba;
uint vert_id = tex_info_in.z;
uint rendermode = tex_info_in.w; // 2D, HUD, 3D
vec3 quat = quat_sy.xyz;
uint matrix = flags_matrix.y;
vec4 transformed;
vec4 transformed;
// STEP 2: perspective transform for distance
vec4 transformed_pos_vf02 = matrix_transform(rendermode == 2 ? hud_matrix : camera, position);
float Q = pfog0 / transformed_pos_vf02.w;
// STEP 2: perspective transform for distance
vec4 transformed_pos_vf02 = matrix_transform(rendermode == 2 ? hud_matrix : camera, position);
float Q = pfog0 / transformed_pos_vf02.w;
// STEP 3: fade out sprite!
vec4 scales_vf01 = xyz_sx; // now used for something else.
scales_vf01.z = sy; // start building the scale vector
scales_vf01.zw *= Q; // sy sx
scales_vf01.x = scales_vf01.z; // = sy
scales_vf01.x *= scales_vf01.w; // x = sx * sy
scales_vf01.x *= inv_area; // x = sx * sy * inv_area (area ratio)
fragment_color.w *= min(scales_vf01.x, 1.0); // is this right? doesn't this stall??
// STEP 3: fade out sprite!
vec4 scales_vf01 = xyz_sx; // now used for something else.
scales_vf01.z = sy; // start building the scale vector
scales_vf01.zw *= Q; // sy sx
scales_vf01.x = scales_vf01.z; // = sy
scales_vf01.x *= scales_vf01.w; // x = sx * sy
scales_vf01.x *= inv_area; // x = sx * sy * inv_area (area ratio)
fragment_color.w *= min(scales_vf01.x, 1.0); // is this right? doesn't this stall??
// STEP 4: actual vertex transformation
if (rendermode == 3) { // 3D sprites
// STEP 4: actual vertex transformation
if (rendermode == 3) { // 3D sprites
mat3 rot = sprite_quat_to_rot(quat);
transformed = sprite_transform2(position, xyz_array[vert_id], rot, sx, sy);
mat3 rot = sprite_quat_to_rot(quat);
transformed = sprite_transform2(position, xyz_array[vert_id], rot, sx, sy);
} else if (rendermode == 1) { // 2D sprites
} else if (rendermode == 1) { // 2D sprites
transformed_pos_vf02.xyz *= Q;
vec4 offset_pos_vf10 = transformed_pos_vf02 + hvdf_offset;
offset_pos_vf10.w = max(offset_pos_vf10.w, fog_min);
/* transformed_pos_vf02.w = offset_pos_vf10.w - fog_max;
int fge = matrix == 0;
if (transformed_pos_vf02.w != 0) {
fge = false;
} */
transformed_pos_vf02.xyz *= Q;
vec4 offset_pos_vf10 = transformed_pos_vf02 + hvdf_offset;
offset_pos_vf10.w = max(offset_pos_vf10.w, fog_min);
/* transformed_pos_vf02.w = offset_pos_vf10.w - fog_max;
int fge = matrix == 0;
if (transformed_pos_vf02.w != 0) {
fge = false;
} */
scales_vf01.z = min(max(scales_vf01.z, min_scale), max_scale);
scales_vf01.w = min(max(scales_vf01.z, min_scale), max_scale);
scales_vf01.z = min(max(scales_vf01.z, min_scale), max_scale);
scales_vf01.w = min(max(scales_vf01.z, min_scale), max_scale);
quat.z *= deg_to_rad;
float sp_sin = sin(quat.z);
float sp_cos = cos(quat.z);
quat.z *= deg_to_rad;
float sp_sin = sin(quat.z);
float sp_cos = cos(quat.z);
vec4 xy0_vf19 = xy_array[vert_id + flags_matrix.x];
vec4 vf12_rotated = (basis_x * sp_cos) - (basis_y * sp_sin);
vec4 vf13_rotated_trans = (basis_x * sp_sin) + (basis_y * sp_cos);
vec4 xy0_vf19 = xy_array[vert_id + flags_matrix.x];
vec4 vf12_rotated = (basis_x * sp_cos) - (basis_y * sp_sin);
vec4 vf13_rotated_trans = (basis_x * sp_sin) + (basis_y * sp_cos);
vf12_rotated *= scales_vf01.w;
vf13_rotated_trans *= scales_vf01.z;
vf12_rotated *= scales_vf01.w;
vf13_rotated_trans *= scales_vf01.z;
transformed = offset_pos_vf10 + vf12_rotated * xy0_vf19.x + vf13_rotated_trans * xy0_vf19.y;
transformed = offset_pos_vf10 + vf12_rotated * xy0_vf19.x + vf13_rotated_trans * xy0_vf19.y;
} else if (rendermode == 2) { // hud sprites
transformed_pos_vf02.xyz *= Q;
vec4 offset_pos_vf10 = transformed_pos_vf02 + (matrix == 0 ? hud_hvdf_offset : hud_hvdf_user[matrix - 1]);
} else if (rendermode == 2) { // hud sprites
transformed_pos_vf02.xyz *= Q;
vec4 offset_pos_vf10 = transformed_pos_vf02 + (matrix == 0 ? hud_hvdf_offset : hud_hvdf_user[matrix - 1]);
// NOTE: no max scale for hud
scales_vf01.z = max(scales_vf01.z, min_scale);
scales_vf01.w = max(scales_vf01.z, min_scale);
// NOTE: no max scale for hud
scales_vf01.z = max(scales_vf01.z, min_scale);
scales_vf01.w = max(scales_vf01.z, min_scale);
quat.z *= deg_to_rad;
float sp_sin = sin(quat.z);
float sp_cos = cos(quat.z);
quat.z *= deg_to_rad;
float sp_sin = sin(quat.z);
float sp_cos = cos(quat.z);
vec4 xy0_vf19 = xy_array[vert_id + flags_matrix.x];
vec4 vf12_rotated = (basis_x * sp_cos) - (basis_y * sp_sin);
vec4 vf13_rotated_trans = (basis_x * sp_sin) + (basis_y * sp_cos);
vec4 xy0_vf19 = xy_array[vert_id + flags_matrix.x];
vec4 vf12_rotated = (basis_x * sp_cos) - (basis_y * sp_sin);
vec4 vf13_rotated_trans = (basis_x * sp_sin) + (basis_y * sp_cos);
vf12_rotated *= scales_vf01.w;
vf13_rotated_trans *= scales_vf01.z;
vf12_rotated *= scales_vf01.w;
vf13_rotated_trans *= scales_vf01.z;
transformed = offset_pos_vf10 + vf12_rotated * xy0_vf19.x + vf13_rotated_trans * xy0_vf19.y;
transformed = offset_pos_vf10 + vf12_rotated * xy0_vf19.x + vf13_rotated_trans * xy0_vf19.y;
}
}
tex_coord = st_array[vert_id].xyz;
tex_coord = st_array[vert_id].xyz;
// STEP 5: final adjustments
// correct xy offset
transformed.xy -= (2048.);
// STEP 5: final adjustments
// correct xy offset
transformed.xy -= (2048.);
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
// hack
transformed.xyz *= transformed.w;
// hack
transformed.xyz *= transformed.w;
gl_Position = transformed;
// scissoring area adjust
gl_Position.y *= SCISSOR_ADJUST;
gl_Position = transformed;
// scissoring area adjust
gl_Position.y *= SCISSOR_ADJUST;
fragment_color.w *= 2;
fragment_color.w *= 2;
tex_info = tex_info_in.xy;
tex_info = tex_info_in.xy;
}
@@ -9,19 +9,19 @@ out flat vec4 fragment_color;
out vec2 tex_coord;
void main() {
fragment_color = u_color;
tex_coord = st;
vec4 transformed = vec4(xyz, 1.0);
fragment_color = u_color;
tex_coord = st;
vec4 transformed = vec4(xyz, 1.0);
// correct xy offset
transformed.xy -= (2048.);
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
transformed.y *= HEIGHT_SCALE;
// correct xy offset
transformed.xy -= (2048.);
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
transformed.y *= HEIGHT_SCALE;
gl_Position = transformed;
gl_Position = transformed;
}
@@ -11,45 +11,45 @@ out flat vec4 fragment_color;
out vec2 tex_coord;
void main() {
// Pass on fragment color
fragment_color = u_color;
// Pass on fragment color
fragment_color = u_color;
// Adjust position and texture coordinates the same way as in the VU program
//
// The VU program operated on each "slice" of the sprite separately, which in
// this case is every 5 vertices. To know the exact transformation to apply
// for each vertex, we need to know which one it is. The order is always 2
// vertices scaled by sizeX, 2 scaled by sizeY (sizeZ for tex coords), and
// finally the center vertex which isn't modified.
float slice_vert_id = mod(gl_VertexID, 5);
// Adjust position and texture coordinates the same way as in the VU program
//
// The VU program operated on each "slice" of the sprite separately, which in
// this case is every 5 vertices. To know the exact transformation to apply
// for each vertex, we need to know which one it is. The order is always 2
// vertices scaled by sizeX, 2 scaled by sizeY (sizeZ for tex coords), and
// finally the center vertex which isn't modified.
float slice_vert_id = mod(gl_VertexID, 5);
vec2 texture_coord = vec2(instance_xyz_s.w, instance_scale_t.w);
if (slice_vert_id < 2) {
texture_coord += st * instance_scale_t.x;
} else if (slice_vert_id < 4) {
texture_coord += st * instance_scale_t.z;
}
vec2 texture_coord = vec2(instance_xyz_s.w, instance_scale_t.w);
if (slice_vert_id < 2) {
texture_coord += st * instance_scale_t.x;
} else if (slice_vert_id < 4) {
texture_coord += st * instance_scale_t.z;
}
tex_coord = texture_coord;
tex_coord = texture_coord;
vec3 position = instance_xyz_s.xyz;
if (slice_vert_id < 2) {
position += xyz * instance_scale_t.x;
} else if (slice_vert_id < 4) {
position += xyz * instance_scale_t.y;
}
vec3 position = instance_xyz_s.xyz;
if (slice_vert_id < 2) {
position += xyz * instance_scale_t.x;
} else if (slice_vert_id < 4) {
position += xyz * instance_scale_t.y;
}
vec4 transformed = vec4(position, 1.0);
vec4 transformed = vec4(position, 1.0);
// correct xy offset
transformed.xy -= (2048.);
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
transformed.y *= HEIGHT_SCALE;
// correct xy offset
transformed.xy -= (2048.);
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
transformed.y *= HEIGHT_SCALE;
gl_Position = transformed;
gl_Position = transformed;
}
@@ -15,17 +15,17 @@ uniform int gfx_hack_no_tex;
void main() {
if (gfx_hack_no_tex == 0) {
//vec4 T0 = texture(tex_T0, tex_coord);
vec4 T0 = texture(tex_T0, tex_coord.xy);
color = fragment_color * T0;
} else {
color = fragment_color/2;
}
if (gfx_hack_no_tex == 0) {
//vec4 T0 = texture(tex_T0, tex_coord);
vec4 T0 = texture(tex_T0, tex_coord.xy);
color = fragment_color * T0;
} else {
color = fragment_color/2;
}
if (color.a < alpha_min || color.a > alpha_max) {
discard;
}
if (color.a < alpha_min || color.a > alpha_max) {
discard;
}
color.rgb = mix(color.rgb, fog_color.rgb, clamp(fogginess * fog_color.a, 0, 1));
color.rgb = mix(color.rgb, fog_color.rgb, clamp(fogginess * fog_color.a, 0, 1));
}
@@ -18,69 +18,67 @@ out vec3 tex_coord;
out float fogginess;
void main() {
// old system:
// - load vf12
// - itof0 vf12
// - multiply with camera matrix (add trans)
// - let Q = fogx / vf12.w
// - xyz *= Q
// - xyzw += hvdf_offset
// - clip w.
// - ftoi4 vf12
// use in gs.
// gs is 12.4 fixed point, set up with 2048.0 as the center.
// the itof0 is done in the preprocessing step. now we have floats.
// old system:
// - load vf12
// - itof0 vf12
// - multiply with camera matrix (add trans)
// - let Q = fogx / vf12.w
// - xyz *= Q
// - xyzw += hvdf_offset
// - clip w.
// - ftoi4 vf12
// use in gs.
// gs is 12.4 fixed point, set up with 2048.0 as the center.
// Step 3, the camera transform
vec4 transformed = -camera[3];
transformed -= camera[0] * position_in.x;
transformed -= camera[1] * position_in.y;
transformed -= camera[2] * position_in.z;
// the itof0 is done in the preprocessing step. now we have floats.
// compute Q
float Q = fog_constant / transformed.w;
// Step 3, the camera transform
vec4 transformed = -camera[3];
transformed -= camera[0] * position_in.x;
transformed -= camera[1] * position_in.y;
transformed -= camera[2] * position_in.z;
// do fog!
fogginess = 255 - clamp(-transformed.w + hvdf_offset.w, fog_min, fog_max);
// compute Q
float Q = fog_constant / transformed.w;
// perspective divide!
transformed.xyz *= Q;
// offset
transformed.xyz += hvdf_offset.xyz;
// correct xy offset
transformed.xy -= (2048.);
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
// hack
transformed.xyz *= transformed.w;
// scissoring area adjust
transformed.y *= SCISSOR_ADJUST * HEIGHT_SCALE;
gl_Position = transformed;
// do fog!
fogginess = 255 - clamp(-transformed.w + hvdf_offset.w, fog_min, fog_max);
// time of day lookup
fragment_color = texelFetch(tex_T1, time_of_day_index, 0);
// color adjustment
fragment_color *= 2;
fragment_color.a *= 2;
// perspective divide!
transformed.xyz *= Q;
// offset
transformed.xyz += hvdf_offset.xyz;
// correct xy offset
transformed.xy -= (2048.);
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
// hack
transformed.xyz *= transformed.w;
// scissoring area adjust
transformed.y *= SCISSOR_ADJUST * HEIGHT_SCALE;
gl_Position = transformed;
if (decal == 1) {
// tfrag/tie always use TCC=RGB, so even with decal, alpha comes from fragment.
fragment_color.xyz = vec3(1.0, 1.0, 1.0);
}
// time of day lookup
fragment_color = texelFetch(tex_T1, time_of_day_index, 0);
// color adjustment
fragment_color *= 2;
fragment_color.a *= 2;
if (decal == 1) {
// tfrag/tie always use TCC=RGB, so even with decal, alpha comes from fragment.
fragment_color.xyz = vec3(1.0, 1.0, 1.0);
}
// fog hack
if (fragment_color.r < fog_hack_threshold &&
fragment_color.g < fog_hack_threshold &&
fragment_color.b < fog_hack_threshold) {
fogginess = 0;
}
tex_coord = tex_coord_in;
// fog hack
if (fragment_color.r < fog_hack_threshold &&
fragment_color.g < fog_hack_threshold &&
fragment_color.b < fog_hack_threshold) {
fogginess = 0;
}
tex_coord = tex_coord_in;
}
@@ -10,5 +10,5 @@ uniform float alpha_min;
uniform float alpha_max;
void main() {
color = fragment_color;
color = fragment_color;
}
@@ -11,32 +11,32 @@ out vec4 fragment_color;
// this is just for debugging.
void main() {
vec4 transformed = camera[3];
transformed += camera[0] * position_in.x;
transformed += camera[1] * position_in.y;
transformed += camera[2] * position_in.z;
vec4 transformed = camera[3];
transformed += camera[0] * position_in.x;
transformed += camera[1] * position_in.y;
transformed += camera[2] * position_in.z;
// compute Q
float Q = fog_constant / transformed.w;
// compute Q
float Q = fog_constant / transformed.w;
// perspective divide!
transformed.xyz *= Q;
// offset
transformed.xyz += hvdf_offset.xyz;
// correct xy offset
transformed.xy -= (2048.);
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
// hack
transformed.xyz *= transformed.w;
// scissoring area adjust
transformed.y *= SCISSOR_ADJUST * HEIGHT_SCALE;
gl_Position = transformed;
// perspective divide!
transformed.xyz *= Q;
// offset
transformed.xyz += hvdf_offset.xyz;
// correct xy offset
transformed.xy -= (2048.);
// correct z scale
transformed.z /= (8388608);
transformed.z -= 1;
// correct xy scale
transformed.x /= (256);
transformed.y /= -(128);
// hack
transformed.xyz *= transformed.w;
// scissoring area adjust
transformed.y *= SCISSOR_ADJUST * HEIGHT_SCALE;
gl_Position = transformed;
// time of day lookup
fragment_color = rgba_in;
// time of day lookup
fragment_color = rgba_in;
}
+2 -1
View File
@@ -1404,7 +1404,8 @@
)
(let ((s2-2 (the int (-> *font-context* origin y))))
(cond
((or (movie?) (< (-> *display* base-clock frame-counter) (-> *game-info* letterbox-time)))
;; pc port note : the console is drawn over the letterbox so this is pointless and has been disabled
((#if PC_PORT #f (or (movie?) (< (-> *display* base-clock frame-counter) (-> *game-info* letterbox-time))))
(+! s2-2 56)
)
(*display-profile*
+55 -58
View File
@@ -5,9 +5,7 @@
;; name in dgo: font-h
;; dgos: ENGINE, GAME
;; TODO: figure out what's weird with set-font-color
;; The font system draws all of the strings.
;; The font system draws all of the text strings.
;; +++font-color
(defenum font-color
@@ -88,6 +86,7 @@
:flag-assert #x9000000c0
)
(deftype char-color (structure)
((color rgba 4 :offset-assert 0)
)
@@ -96,10 +95,15 @@
:flag-assert #x900000010
)
(define *font-default-matrix*
(new 'static 'matrix
:data (new 'static 'array float 16 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 -256.0 -208.0 0.0 1.0)
)
(new 'static 'matrix :vector (new 'static 'inline-array vector 4
(new 'static 'vector :x 1.0)
(new 'static 'vector :y 1.0)
(new 'static 'vector :z 1.0)
(new 'static 'vector :x -256.0 :y -208.0 :w 1.0)
)
)
)
;; font settings that can be passed to draw-string
@@ -136,6 +140,7 @@
)
)
(defmethod set-mat! font-context ((obj font-context) (arg0 matrix))
(set! (-> obj mat) arg0)
obj
@@ -228,10 +233,10 @@
(set! (-> v1-6 origin w) 1.0)
)
(let ((v1-7 v0-0))
(set! (-> v1-7 width) (the float #x200))
(set! (-> v1-7 width) (the float 512))
)
(let ((v1-8 v0-0))
(set! (-> v1-8 height) (the float #x1a0))
(set! (-> v1-8 height) (the float 416))
)
(let ((v1-9 v0-0))
(set! (-> v1-9 projection) 1.0)
@@ -303,6 +308,7 @@
:flag-assert #x900000b58
)
(define *font-work*
(new 'static 'font-work
:font-tmpl (new 'static 'dma-gif-packet
@@ -310,14 +316,42 @@
:dma (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt))
:vif1 (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1)
)
:gif (new 'static 'array uint64 2 #x102e400000008001 #xe)
:gif0 (new 'static 'gif-tag64
:nloop #x1
:eop #x1
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :abe #x1)
:nreg #x1
)
:gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))
)
:char-tmpl (new 'static 'dma-gif-packet
:dma-vif (new 'static 'dma-packet
:dma (new 'static 'dma-tag :qwc #xe :id (dma-tag-id cnt))
:vif1 (new 'static 'vif-tag :imm #xe :cmd (vif-cmd direct) :msk #x1)
)
:gif (new 'static 'array uint64 2 #xd02e400000008001 #x412412412412e)
:gif0 (new 'static 'gif-tag64
:nloop #x1
:eop #x1
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :abe #x1)
:nreg #xd
)
:gif1 (new 'static 'gif-tag-regs
:regs0 (gif-reg-id a+d)
:regs1 (gif-reg-id st)
:regs2 (gif-reg-id rgbaq)
:regs3 (gif-reg-id xyzf2)
:regs4 (gif-reg-id st)
:regs5 (gif-reg-id rgbaq)
:regs6 (gif-reg-id xyzf2)
:regs7 (gif-reg-id st)
:regs8 (gif-reg-id rgbaq)
:regs9 (gif-reg-id xyzf2)
:regs10 (gif-reg-id st)
:regs11 (gif-reg-id rgbaq)
:regs12 (gif-reg-id xyzf2)
)
)
:tex1-tmpl (new 'static 'array uint64 2 #x60 #x14)
:small-font-0-tmpl (new 'static 'array uint64 2 #x0 #x6)
@@ -382,7 +416,7 @@
(new 'static 'vector :z 1.0)
)
)
:color-shadow (new 'static 'vector4w :data (new 'static 'array int32 4 #x0 #x0 #x0 #x80))
:color-shadow (new 'static 'vector4w :w #x80)
:color-table (new 'static 'inline-array char-color 40
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x70 :g #x78 :b #x70 :a #x80)
@@ -673,61 +707,24 @@
(set! (-> arg0 0) (new 'static 'gs-tex0
:tcc #x1
:cld #x1
:cbp (the-as uint arg4)
:cbp arg4
:th (+ (log2 (+ (-> arg1 h) -1)) 1)
:tw (log2 (-> arg1 w))
:tbw (-> arg1 width 0)
:tbp0 (/ arg2 64)
:psm (the-as uint arg3)
:psm arg3
)
)
(none)
)
(defun set-font-color ((arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int))
"I have no idea what is happening here."
(let ((v1-6 (logior (logand (l.wu (+ (+ (* (* arg1 2) 4) (* arg0 16)) (the-as int *font-work*) 2160)) -256)
(shr (shl arg2 56) 56)
)
)
(a2-6 (+ (+ (* (* arg1 2) 4) (* arg0 16)) (the-as int *font-work*)))
)
(s.w! (+ a2-6 2160) v1-6)
)
(let ((v1-13 (logior (logand (l.wu (+ (+ (* (* arg1 2) 4) (* arg0 16)) (the-as int *font-work*) 2160)) -65281)
(shr (shl arg3 56) 48)
)
)
(a2-15 (+ (+ (* (* arg1 2) 4) (* arg0 16)) (the-as int *font-work*)))
)
(s.w! (+ a2-15 2160) v1-13)
)
(let ((v1-20 (logior (logand (l.wu (+ (+ (* (* arg1 2) 4) (* arg0 16)) (the-as int *font-work*) 2160)) -16711681)
(shr (shl arg4 56) 40)
)
)
(a2-24 (+ (+ (* (* arg1 2) 4) (* arg0 16)) (the-as int *font-work*)))
)
(s.w! (+ a2-24 2160) v1-20)
)
(let ((v1-28
(logior (logand (l.wu (+ (+ (* (+ (* arg1 2) 1) 4) (* arg0 16)) (the-as int *font-work*) 2160)) -65281)
(shr (shl arg3 56) 48)
)
)
(a2-34 (+ (+ (* (+ (* arg1 2) 1) 4) (* arg0 16)) (the-as int *font-work*)))
)
(s.w! (+ a2-34 2160) v1-28)
)
(let ((v1-36
(logior (logand (l.wu (+ (+ (* (+ (* arg1 2) 1) 4) (* arg0 16)) (the-as int *font-work*) 2160)) -16711681)
(shr (shl arg4 56) 40)
)
)
(a0-3 (+ (+ (* (+ (* arg1 2) 1) 4) (* arg0 16)) (the-as int *font-work*)))
)
(s.w! (+ a0-3 2160) v1-36)
)
(defun set-font-color ((color font-color) (vert int) (rgba-red rgba) (rgba-green rgba) (rgba-blue rgba))
(set! (-> *font-work* color-table color color (* vert 2) r) (-> rgba-red r))
(set! (-> *font-work* color-table color color (* vert 2) g) (-> rgba-green r))
(set! (-> *font-work* color-table color color (* vert 2) b) (-> rgba-blue r))
;; missing?
;; (set! (-> *font-work* color-table color (1+ (* vert 2)) r) (-> rgba-green r))
(set! (-> *font-work* color-table color color (1+ (* vert 2)) g) (-> rgba-green r))
(set! (-> *font-work* color-table color color (1+ (* vert 2)) b) (-> rgba-blue r))
0
(none)
)
@@ -175,7 +175,7 @@
(format *temp-string* "~%~S~D" "~[~38L" (the int (-> obj points-in-combo))))
;; Print it finally
(let ((font-ctx (new 'stack 'font-context *font-default-matrix* 0 325 0.0 (font-color default) (font-flags shadow kerning middle))))
(print-game-text-scaled *temp-string* 1.0 font-ctx 320))
(print-game-text-scaled *temp-string* 1.0 font-ctx (bucket-id progress)))
(none))
(defmethod end-combo! board-trick-tracker ((obj board-trick-tracker))
+125 -125
View File
@@ -7,8 +7,9 @@
;; DECOMP BEGINS
;; WARN: Return type mismatch int vs font-color.
(defbehavior progress-selected progress ((arg0 int))
(let ((gp-0 33))
(let ((color (font-color #7ffcfc)))
(cond
((< 4 (the-as int (logand (-> self clock integral-frame-counter) 7)))
(set! (-> *progress-state* color-flash-counter) 1)
@@ -20,19 +21,42 @@
)
(cond
((zero? (-> *progress-state* color-flash-counter))
(set-font-color gp-0 0 64 128 128)
(set-font-color gp-0 1 64 128 128)
(set-font-color
(the-as font-color color)
0
(new 'static 'rgba :r #x40)
(new 'static 'rgba :r #x80)
(new 'static 'rgba :r #x80)
)
(set-font-color
(the-as font-color color)
1
(new 'static 'rgba :r #x40)
(new 'static 'rgba :r #x80)
(new 'static 'rgba :r #x80)
)
)
(else
(set-font-color gp-0 0 255 255 255)
(set-font-color gp-0 1 255 255 255)
(set-font-color
(the-as font-color color)
0
(new 'static 'rgba :r #xff)
(new 'static 'rgba :r #xff)
(new 'static 'rgba :r #xff)
)
(set-font-color
(the-as font-color color)
1
(new 'static 'rgba :r #xff)
(new 'static 'rgba :r #xff)
(new 'static 'rgba :r #xff)
)
)
)
gp-0
(the-as font-color color)
)
)
;; ERROR: Failed store: (s.w! (+ v1-8 8) 0) at op 39
(defun draw-percent-bar ((arg0 int) (arg1 int) (arg2 float) (arg3 rgba))
(with-dma-buffer-add-bucket ((s2-0 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id particles)
@@ -44,7 +68,6 @@
(none)
)
;; ERROR: Failed store: (s.w! (+ v1-6 8) 0) at op 45
(defun draw-highlight ((arg0 int) (arg1 int) (arg2 float))
(let ((s3-0 (if (= (get-aspect-ratio) 'aspect4x3)
70
@@ -126,7 +149,7 @@
(set! (-> a0-1 flags) (font-flags kerning large))
)
(let ((s2-0 arg1))
(set! (-> s2-0 color) (the-as font-color (progress-selected 200)))
(set! (-> s2-0 color) (progress-selected 200))
)
(let ((v1-15 arg1))
(set! (-> v1-15 scale) 0.6)
@@ -250,7 +273,6 @@
(none)
)
;; ERROR: Failed store: (s.w! (+ v1-23 8) 0) at op 71
(defun begin-scissor ((arg0 hud-box) (arg1 progress))
(cond
((or (= (-> arg1 current) 'bigmap) (= (-> arg1 next) 'bigmap))
@@ -278,10 +300,8 @@
(setup-scissor arg0 s4-0)
)
0
(none)
)
;; ERROR: Failed store: (s.w! (+ v1-7 8) 0) at op 17
(defun end-scissor ((arg0 hud-box) (arg1 float))
(with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
@@ -289,10 +309,8 @@
(restore-scissor arg0 s5-0)
)
0
(none)
)
;; ERROR: Failed store: (s.w! (+ v1-17 8) 0) at op 50
(defun begin-scissor-secret ((arg0 hud-box) (arg1 progress))
(cond
((= (get-aspect-ratio) 'aspect16x9)
@@ -314,10 +332,8 @@
(setup-scissor arg0 s4-0)
)
0
(none)
)
;; ERROR: Failed store: (s.w! (+ v1-7 8) 0) at op 17
(defun end-scissor-secret ((arg0 hud-box) (arg1 float))
(with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
@@ -325,11 +341,9 @@
(restore-scissor arg0 s5-0)
)
0
(none)
)
;; ERROR: Failed store: (s.w! (+ v1-17 8) 0) at op 50
(defun begin-scissor-missions ((arg0 hud-box) (arg1 float))
(defun begin-scissor-missions ((arg0 hud-box))
(cond
((= (get-aspect-ratio) 'aspect16x9)
(set! (-> arg0 min x) 79.0)
@@ -350,10 +364,8 @@
(setup-scissor arg0 s4-0)
)
0
(none)
)
;; ERROR: Failed store: (s.w! (+ v1-7 8) 0) at op 17
(defun end-scissor-missions ((arg0 hud-box) (arg1 float))
(with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
@@ -361,10 +373,8 @@
(restore-scissor arg0 s5-0)
)
0
(none)
)
;; ERROR: Failed store: (s.w! (+ v1-17 8) 0) at op 50
(defun begin-scissor-scene ((arg0 hud-box))
(cond
((= (get-aspect-ratio) 'aspect16x9)
@@ -386,10 +396,8 @@
(setup-scissor arg0 s4-0)
)
0
(none)
)
;; ERROR: Failed store: (s.w! (+ v1-7 8) 0) at op 17
(defun end-scissor-scene ((arg0 hud-box) (arg1 float))
(with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
@@ -397,10 +405,8 @@
(restore-scissor arg0 s5-0)
)
0
(none)
)
;; ERROR: Failed store: (s.w! (+ v1-17 8) 0) at op 50
(defun begin-scissor-level ((arg0 hud-box))
(cond
((= (get-aspect-ratio) 'aspect16x9)
@@ -422,10 +428,8 @@
(setup-scissor arg0 s4-0)
)
0
(none)
)
;; ERROR: Failed store: (s.w! (+ v1-7 8) 0) at op 17
(defun end-scissor-level ((arg0 hud-box) (arg1 float))
(with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
@@ -433,7 +437,6 @@
(restore-scissor arg0 s5-0)
)
0
(none)
)
(defun print-language-name ((arg0 text-id) (arg1 font-context) (arg2 int) (arg3 symbol))
@@ -446,7 +449,12 @@
(+! (-> arg1 origin x) (the float s5-0))
(let ((f30-0 (- 1.0 (* 0.0033333334 (the float arg2)))))
(set! (-> arg1 alpha) f30-0)
(print-game-text-scaled (lookup-text! *common-text* (-> *language-name-remap* arg0) #f) f30-0 arg1 320)
(print-game-text-scaled
(lookup-text! *common-text* (-> *language-name-remap* arg0) #f)
f30-0
arg1
(bucket-id progress)
)
)
(set! (-> arg1 origin x) (- (-> arg1 origin x) (the float s5-0)))
)
@@ -599,12 +607,12 @@
(the-as pointer 0)
)
(defmethod menu-option-method-10 menu-option ((obj menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-option ((obj menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
0
(none)
)
(defmethod menu-option-method-10 menu-on-off-option ((obj menu-on-off-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-on-off-option ((obj menu-on-off-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars (a0-8 string) (sv-16 string))
(let ((s3-0 (if arg3
(&-> *progress-state* on-off-choice)
@@ -668,7 +676,7 @@
(none)
)
(defmethod menu-option-method-10 menu-yes-no-option ((obj menu-yes-no-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-yes-no-option ((obj menu-yes-no-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars (a0-8 string))
(let ((s3-0 (&-> *progress-state* yes-no-choice)))
(set! a0-8
@@ -714,7 +722,7 @@
(none)
)
(defmethod menu-option-method-10 menu-video-mode-option ((obj menu-video-mode-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-video-mode-option ((obj menu-video-mode-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(let ((s3-0 (&-> *progress-state* video-mode-choice))
(f28-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))
(f30-0 (-> arg1 origin y))
@@ -775,7 +783,7 @@
(cond
((= (-> *progress-state* graphic-options-item-selected) 3)
(let ((s2-4 arg1))
(set! (-> s2-4 color) (the-as font-color (progress-selected 0)))
(set! (-> s2-4 color) (progress-selected 0))
)
(draw-highlight (the int (+ -9.0 (-> arg1 origin y))) 22 f28-0)
)
@@ -824,7 +832,7 @@
(none)
)
(defmethod menu-option-method-10 menu-unlocked-menu-option ((obj menu-unlocked-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-unlocked-menu-option ((obj menu-unlocked-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(let ((s5-0 (memcard-unlocked-secrets? #t))
(f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))
)
@@ -1005,7 +1013,7 @@
(none)
)
(defmethod menu-option-method-10 menu-main-menu-option ((obj menu-main-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-main-menu-option ((obj menu-main-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(-> arg1 flags)
(when (and (= (-> arg0 menu-transition) 0.0) (and (= (-> arg0 ring-angle) (-> arg0 ring-want-angle))
(nonzero? (-> obj name))
@@ -1257,7 +1265,6 @@
(none)
)
;; ERROR: Failed store: (s.w! (+ v1-7 8) 0) at op 26
(defun draw-savegame-box ((arg0 menu-option) (arg1 float) (arg2 float) (arg3 float) (arg4 float))
(set! (-> arg0 box 0 min x) arg1)
(set! (-> arg0 box 0 max x) arg2)
@@ -1526,7 +1533,6 @@
)
)
;; ERROR: Failed store: (s.w! (+ v1-41 8) 0) at op 177
(defun draw-decoration ((arg0 menu-option) (arg1 font-context) (arg2 float) (arg3 int) (arg4 symbol) (arg5 float))
(local-vars
(sv-16 symbol)
@@ -1638,7 +1644,6 @@
)
)
;; ERROR: Failed store: (s.w! (+ v1-28 8) 0) at op 138
(defun draw-missions-decoration ((arg0 menu-missions-option) (arg1 font-context) (arg2 float) (arg3 text-id))
(local-vars
(sv-16 int)
@@ -1683,7 +1688,7 @@
(let ((a0-4 (lookup-text! *common-text* s0-0 #f))
(a2-2 #f)
(a3-1 44)
(t0-0 320)
(t0-0 (bucket-id progress))
)
(sv-32 a0-4 sv-48 a2-2 a3-1 (the-as bucket-id t0-0))
)
@@ -1712,7 +1717,6 @@
)
)
;; ERROR: Failed store: (s.w! (+ v1-34 8) 0) at op 152
(defun draw-sound-options-decoration ((arg0 menu-slider-option) (arg1 font-context) (arg2 float) (arg3 symbol) (arg4 text-id))
(local-vars
(sv-16 font-context)
@@ -1800,7 +1804,6 @@
)
)
;; ERROR: Failed store: (s.w! (+ v1-30 8) 0) at op 140
(defun draw-decoration-secrets ((arg0 menu-option) (arg1 font-context) (arg2 float) (arg3 text-id))
(local-vars
(sv-16 int)
@@ -1876,7 +1879,6 @@
)
)
;; ERROR: Failed store: (s.w! (+ v1-45 8) 0) at op 174
(defun draw-decoration-load-save ((arg0 menu-option) (arg1 font-context) (arg2 float) (arg3 int))
(local-vars
(sv-16 int)
@@ -1974,8 +1976,7 @@
)
)
;; ERROR: Failed store: (s.w! (+ v1-95 8) 0) at op 334
(defmethod menu-option-method-10 menu-memcard-slot-option ((obj menu-memcard-slot-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-memcard-slot-option ((obj menu-memcard-slot-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars
(v0-74 pointer)
(sv-16 float)
@@ -2032,7 +2033,7 @@
(else
(let ((s2-3 arg1))
(set! (-> s2-3 color) (if (= arg2 sv-20)
(the-as font-color (progress-selected 0))
(the-as font-color (the-as int (progress-selected 0)))
(font-color #7efbfb)
)
)
@@ -2411,7 +2412,7 @@
(none)
)
(defmethod menu-option-method-10 menu-loading-option ((obj menu-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-loading-option ((obj menu-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(with-pp
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
@@ -2419,7 +2420,7 @@
(set! (-> v1-3 scale) 0.55)
)
(let ((s4-0 arg1))
(set! (-> s4-0 color) (the-as font-color (progress-selected 0)))
(set! (-> s4-0 color) (progress-selected 0))
)
(let ((a0-3 arg1))
(set! (-> a0-3 flags) (font-flags kerning middle left large))
@@ -2468,7 +2469,7 @@
)
)
(defmethod menu-option-method-10 menu-insufficient-space-option ((obj menu-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-insufficient-space-option ((obj menu-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(when (!= (-> arg0 current) 'none)
(let ((v1-3 arg1))
@@ -2534,7 +2535,7 @@
)
(set! (-> arg1 origin y) (+ 60.0 (-> arg1 origin y)))
(let ((s5-2 arg1))
(set! (-> s5-2 color) (the-as font-color (progress-selected 0)))
(set! (-> s5-2 color) (progress-selected 0))
)
(draw-highlight (the int (+ 30.0 (-> arg1 origin y))) 24 (-> arg1 alpha))
(print-game-text
@@ -2547,7 +2548,7 @@
)
(else
(let ((s4-2 arg1))
(set! (-> s4-2 color) (the-as font-color (progress-selected 0)))
(set! (-> s4-2 color) (progress-selected 0))
)
(set! (-> arg1 origin y) (+ 20.0 (-> arg1 origin y)))
(draw-highlight (the int (+ 30.0 (-> arg1 origin y))) 24 (-> arg1 alpha))
@@ -2559,7 +2560,7 @@
(none)
)
(defmethod menu-option-method-10 menu-secrets-insufficient-space-option ((obj menu-secrets-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-secrets-insufficient-space-option ((obj menu-secrets-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((v1-1 arg1))
(set! (-> v1-1 scale) 0.5)
@@ -2590,7 +2591,7 @@
(set! (-> v1-13 height) (the float 30))
)
(let ((s5-1 arg1))
(set! (-> s5-1 color) (the-as font-color (progress-selected 0)))
(set! (-> s5-1 color) (progress-selected 0))
)
(draw-highlight (the int (-> arg1 origin y)) 24 (-> arg1 alpha))
(print-game-text
@@ -2604,7 +2605,7 @@
(none)
)
(defmethod menu-option-method-10 menu-insert-card-option ((obj menu-insert-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-insert-card-option ((obj menu-insert-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((v1-1 arg1))
(set! (-> v1-1 scale) 0.5)
@@ -2636,7 +2637,7 @@
(set! (-> v1-10 height) (the float 60))
)
(let ((s5-1 arg1))
(set! (-> s5-1 color) (the-as font-color (progress-selected 0)))
(set! (-> s5-1 color) (progress-selected 0))
)
(draw-highlight (the int (+ 17.0 (-> arg1 origin y))) 24 (-> arg1 alpha))
(print-game-text
@@ -2650,7 +2651,7 @@
(none)
)
(defmethod menu-option-method-10 menu-error-loading-option ((obj menu-error-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-error-loading-option ((obj menu-error-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((v1-1 arg1))
(set! (-> v1-1 scale) 0.5)
@@ -2703,7 +2704,7 @@
(set! (-> v1-19 height) (the float 45))
)
(let ((s5-2 arg1))
(set! (-> s5-2 color) (the-as font-color (progress-selected 0)))
(set! (-> s5-2 color) (progress-selected 0))
)
(draw-highlight (the int (+ 9.0 (-> arg1 origin y))) 24 (-> arg1 alpha))
(print-game-text
@@ -2717,7 +2718,7 @@
(none)
)
(defmethod menu-option-method-10 menu-error-auto-saving-option ((obj menu-error-auto-saving-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-error-auto-saving-option ((obj menu-error-auto-saving-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((v1-1 arg1))
(set! (-> v1-1 scale) 0.5)
@@ -2778,7 +2779,7 @@
(set! (-> v1-19 height) (the float 25))
)
(let ((s5-4 arg1))
(set! (-> s5-4 color) (the-as font-color (progress-selected 0)))
(set! (-> s5-4 color) (progress-selected 0))
)
(draw-highlight (the int (-> arg1 origin y)) 22 (-> arg1 alpha))
(print-game-text
@@ -2792,7 +2793,7 @@
(none)
)
(defmethod menu-option-method-10 menu-card-removed-option ((obj menu-card-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-card-removed-option ((obj menu-card-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((v1-1 arg1))
(set! (-> v1-1 scale) 0.5)
@@ -2839,7 +2840,7 @@
(set! (-> v1-15 height) (the float 35))
)
(let ((s5-3 arg1))
(set! (-> s5-3 color) (the-as font-color (progress-selected 0)))
(set! (-> s5-3 color) (progress-selected 0))
)
(draw-highlight (the int (+ 5.0 (-> arg1 origin y))) 24 (-> arg1 alpha))
(print-game-text
@@ -2853,7 +2854,7 @@
(none)
)
(defmethod menu-option-method-10 menu-error-disc-removed-option ((obj menu-error-disc-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-error-disc-removed-option ((obj menu-error-disc-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((a0-1 arg1))
(set! (-> a0-1 color) (font-color #7efbfb))
@@ -2896,7 +2897,7 @@
(set! (-> v1-14 height) (the float 50))
)
(let ((s5-2 arg1))
(set! (-> s5-2 color) (the-as font-color (progress-selected 0)))
(set! (-> s5-2 color) (progress-selected 0))
)
(draw-highlight (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha))
(print-game-text
@@ -2911,7 +2912,7 @@
(none)
)
(defmethod menu-option-method-10 menu-error-reading-option ((obj menu-error-reading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-error-reading-option ((obj menu-error-reading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((a0-1 arg1))
(set! (-> a0-1 color) (font-color #7efbfb))
@@ -2953,7 +2954,7 @@
(set! (-> v1-13 height) (the float 50))
)
(let ((s5-2 arg1))
(set! (-> s5-2 color) (the-as font-color (progress-selected 0)))
(set! (-> s5-2 color) (progress-selected 0))
)
(draw-highlight (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha))
(print-game-text
@@ -2967,8 +2968,7 @@
(none)
)
;; ERROR: Failed store: (s.w! (+ v1-16 8) 0) at op 72
(defmethod menu-option-method-10 menu-icon-info-option ((obj menu-icon-info-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-icon-info-option ((obj menu-icon-info-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((a0-1 arg1))
(set! (-> a0-1 color) (font-color #7efbfb))
@@ -3028,7 +3028,7 @@
(set! (-> v1-34 height) (the float 50))
)
(let ((s5-3 arg1))
(set! (-> s5-3 color) (the-as font-color (progress-selected 0)))
(set! (-> s5-3 color) (progress-selected 0))
)
(draw-highlight (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha))
(print-game-text
@@ -3042,7 +3042,7 @@
(none)
)
(defmethod menu-option-method-10 menu-format-card-option ((obj menu-format-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-format-card-option ((obj menu-format-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((a0-1 arg1))
(set! (-> a0-1 color) (font-color #7efbfb))
@@ -3094,7 +3094,7 @@
(none)
)
(defmethod menu-option-method-10 menu-already-exists-option ((obj menu-already-exists-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-already-exists-option ((obj menu-already-exists-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((a0-1 arg1))
(set! (-> a0-1 color) (font-color #7efbfb))
@@ -3138,7 +3138,7 @@
(none)
)
(defmethod menu-option-method-10 menu-create-game-option ((obj menu-create-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-create-game-option ((obj menu-create-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((a0-1 arg1))
(set! (-> a0-1 color) (font-color #7efbfb))
@@ -3179,7 +3179,7 @@
(none)
)
(defmethod menu-option-method-10 menu-video-mode-warning-option ((obj menu-video-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-video-mode-warning-option ((obj menu-video-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((a0-1 arg1))
(set! (-> a0-1 color) (font-color #7efbfb))
@@ -3245,7 +3245,7 @@
(none)
)
(defmethod menu-option-method-10 menu-video-mode-ok-option ((obj menu-video-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-video-mode-ok-option ((obj menu-video-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((a0-1 arg1))
(set! (-> a0-1 color) (font-color #7efbfb))
@@ -3289,7 +3289,7 @@
(none)
)
(defmethod menu-option-method-10 menu-progressive-mode-warning-option ((obj menu-progressive-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-progressive-mode-warning-option ((obj menu-progressive-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((a0-1 arg1))
(set! (-> a0-1 color) (font-color #7efbfb))
@@ -3355,7 +3355,7 @@
(none)
)
(defmethod menu-option-method-10 menu-progressive-mode-ok-option ((obj menu-progressive-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-progressive-mode-ok-option ((obj menu-progressive-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((a0-1 arg1))
(set! (-> a0-1 color) (font-color #7efbfb))
@@ -3399,7 +3399,7 @@
(none)
)
(defmethod menu-option-method-10 menu-quit-option ((obj menu-quit-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-quit-option ((obj menu-quit-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((a0-1 arg1))
(set! (-> a0-1 color) (font-color #7efbfb))
@@ -3433,7 +3433,7 @@
)
;; WARN: disable def twice: 147. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare.
(defmethod menu-option-method-10 menu-select-start-option ((obj menu-select-start-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-select-start-option ((obj menu-select-start-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars
(sv-48 int)
(sv-64 int)
@@ -3548,8 +3548,10 @@
((zero? s2-0)
(set! (-> obj real-task-index) sv-64)
(set! sv-96 arg1)
(set! (-> sv-96 color) (the-as font-color (progress-selected 0)))
(draw-highlight (+ s0-0 47) 50 f30-0)
(set! (-> sv-96 color) (progress-selected 0))
;; pc port note : added this check here so we dont double-draw the highlight
(when (< (+ s3-0 -1) 0)
(draw-highlight (+ s0-0 47) 50 f30-0))
)
(else
(let ((a0-35 arg1))
@@ -3599,7 +3601,7 @@
(none)
)
(defmethod menu-option-method-10 menu-select-scene-option ((obj menu-select-scene-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-select-scene-option ((obj menu-select-scene-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars
(sv-48 int)
(sv-64 (function string font-context symbol int bucket-id float))
@@ -3738,12 +3740,12 @@
(cond
((and (< s3-0 s4-0) (!= (-> arg0 sliding-height) 0.0))
(set! sv-192 arg1)
(set! (-> sv-192 color) (the-as font-color (progress-selected 0)))
(set! (-> sv-192 color) (progress-selected 0))
(draw-highlight (+ (the int f26-0) -2 s0-1) (the int f26-0) f30-0)
)
((or (and (= s3-0 s4-0) (= (fabs (-> arg0 sliding-height)) 0.0)) (zero? s3-0))
(set! sv-208 arg1)
(set! (-> sv-208 color) (the-as font-color (progress-selected 0)))
(set! (-> sv-208 color) (progress-selected 0))
(draw-highlight (+ s0-1 -2) (the int f26-0) f30-0)
)
(else
@@ -3775,7 +3777,7 @@
(none)
)
(defmethod menu-option-method-10 menu-bigmap-option ((obj menu-bigmap-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-bigmap-option ((obj menu-bigmap-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
0
(none)
)
@@ -3915,7 +3917,7 @@
)
)
(defmethod menu-option-method-10 menu-missions-option ((obj menu-missions-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-missions-option ((obj menu-missions-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars
(f0-50 float)
(sv-16 float)
@@ -4000,7 +4002,7 @@
)
)
)
(begin-scissor-missions sv-276 (the-as float arg0))
(begin-scissor-missions sv-276)
(let ((a0-27 arg1))
(set! (-> a0-27 flags) (font-flags kerning large))
)
@@ -4209,7 +4211,7 @@
(else
(let ((s3-1 arg2))
(set! (-> s3-1 color) (if (= arg3 1)
(the-as font-color (progress-selected 0))
(the-as font-color (the-as int (progress-selected 0)))
(font-color #7efbfb)
)
)
@@ -4313,8 +4315,7 @@
)
)
;; ERROR: Failed store: (s.w! (+ v1-42 8) 0) at op 138
(defmethod menu-option-method-10 menu-secret-option ((obj menu-secret-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-secret-option ((obj menu-secret-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars
(sv-16 float)
(sv-20 symbol)
@@ -4471,7 +4472,9 @@
(draw-secret-list (-> obj secret-items (+ sv-112 -1)) sv-48 arg1 0 sv-40 sv-108)
)
(set! (-> arg1 origin y) (the float (+ (the int sv-108) 25 sv-128)))
(draw-highlight (+ sv-128 22) 22 sv-16)
;; pc port note : added check so we don't double-draw the highlight
(when (< (+ sv-112 -1) sv-96)
(draw-highlight (+ sv-128 22) 22 sv-16))
(draw-secret-list (-> obj secret-items sv-112) sv-48 arg1 1 sv-40 sv-108)
(when (< (+ sv-112 1) sv-104)
(set! (-> arg1 origin y) (the float (+ (the int sv-108) 50 sv-128)))
@@ -4541,7 +4544,6 @@
)
;; ERROR: Failed store: (s.w! (+ v1-8 8) 0) at op 37
(defun draw-highscore-icon ((arg0 menu-highscores-option) (arg1 uint) (arg2 int) (arg3 int) (arg4 float))
(set! (-> arg0 sprites 0 tex) (lookup-texture-by-id (the-as texture-id arg1)))
(set! (-> arg0 sprites 0 scale-x) arg4)
@@ -4554,7 +4556,6 @@
)
)
;; ERROR: Failed store: (s.w! (+ v1-20 8) 0) at op 75
(defun draw-highscore-cup ((arg0 texture-page) (arg1 int) (arg2 int) (arg3 int) (arg4 float) (arg5 float))
"First int is an enum"
(let ((a0-1 (the-as uint #xc9300300)))
@@ -5313,7 +5314,7 @@
)
)
(defmethod menu-option-method-10 menu-highscores-option ((obj menu-highscores-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-highscores-option ((obj menu-highscores-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars
(sv-96 float)
(sv-100 float)
@@ -5616,7 +5617,7 @@
(none)
)
(defmethod menu-option-method-10 menu-on-off-game-vibrations-option ((obj menu-on-off-game-vibrations-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-on-off-game-vibrations-option ((obj menu-on-off-game-vibrations-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars (a0-10 string))
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(if (< f30-0 0.0)
@@ -5663,7 +5664,7 @@
(cond
((zero? (-> *progress-state* game-options-item-selected))
(let ((s2-3 arg1))
(set! (-> s2-3 color) (the-as font-color (progress-selected 0)))
(set! (-> s2-3 color) (progress-selected 0))
)
(draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 22 f30-0)
)
@@ -5704,7 +5705,7 @@
(none)
)
(defmethod menu-option-method-10 menu-on-off-game-subtitles-option ((obj menu-on-off-game-subtitles-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-on-off-game-subtitles-option ((obj menu-on-off-game-subtitles-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars (a0-11 string))
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(if (< f30-0 0.0)
@@ -5751,7 +5752,7 @@
(cond
((= (-> *progress-state* game-options-item-selected) 1)
(let ((s2-3 arg1))
(set! (-> s2-3 color) (the-as font-color (progress-selected 0)))
(set! (-> s2-3 color) (progress-selected 0))
)
(draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 22 f30-0)
)
@@ -5792,7 +5793,7 @@
(none)
)
(defmethod menu-option-method-10 menu-subtitle-language-game-option ((obj menu-subtitle-language-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-subtitle-language-game-option ((obj menu-subtitle-language-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(with-pp
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(let ((v1-2 arg1))
@@ -5857,7 +5858,7 @@
)
(set! (-> arg1 origin x) (+ -70.0 (-> arg1 origin x)))
(let ((s5-3 arg1))
(set! (-> s5-3 color) (the-as font-color (progress-selected 0)))
(set! (-> s5-3 color) (progress-selected 0))
)
(let ((v1-43 (if (and (= (scf-get-territory) 1) (zero? (-> *progress-state* game-options-subtitle-language-index)))
7
@@ -5878,7 +5879,7 @@
(cond
((= (-> *progress-state* game-options-item-selected) 2)
(let ((s4-4 arg1))
(set! (-> s4-4 color) (the-as font-color (progress-selected 0)))
(set! (-> s4-4 color) (progress-selected 0))
)
(draw-highlight (the int (-> arg1 origin y)) 24 f30-0)
)
@@ -5925,7 +5926,7 @@
)
)
(defmethod menu-option-method-10 menu-language-game-option ((obj menu-language-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-language-game-option ((obj menu-language-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(with-pp
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(let ((v1-2 arg1))
@@ -5993,7 +5994,7 @@
)
(set! (-> arg1 origin x) (+ -70.0 (-> arg1 origin x)))
(let ((s5-3 arg1))
(set! (-> s5-3 color) (the-as font-color (progress-selected 0)))
(set! (-> s5-3 color) (progress-selected 0))
)
(let ((v1-43 (if (and (= (scf-get-territory) 1) (zero? (-> *progress-state* game-options-language-index)))
7
@@ -6014,7 +6015,7 @@
(cond
((= (-> *progress-state* game-options-item-selected) 3)
(let ((s3-1 arg1))
(set! (-> s3-1 color) (the-as font-color (progress-selected 0)))
(set! (-> s3-1 color) (progress-selected 0))
)
(draw-highlight (the int (-> arg1 origin y)) 24 f30-0)
)
@@ -6066,7 +6067,7 @@
)
)
(defmethod menu-option-method-10 menu-sub-menu-game-option ((obj menu-sub-menu-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-sub-menu-game-option ((obj menu-sub-menu-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(let ((f0-1 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
395.0
(-> arg1 origin y)
@@ -6087,7 +6088,7 @@
(none)
)
(defmethod menu-option-method-10 menu-aspect-ratio-option ((obj menu-aspect-ratio-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-aspect-ratio-option ((obj menu-aspect-ratio-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars (a0-12 string))
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(if (< f30-0 0.0)
@@ -6144,7 +6145,7 @@
(cond
((= (-> *progress-state* graphic-options-item-selected) 1)
(let ((s2-3 arg1))
(set! (-> s2-3 color) (the-as font-color (progress-selected 0)))
(set! (-> s2-3 color) (progress-selected 0))
)
(draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 25 f30-0)
)
@@ -6192,12 +6193,12 @@
(none)
)
(defmethod menu-option-method-10 menu-on-off-progressive-scan-graphic-option ((obj menu-on-off-progressive-scan-graphic-option)
(arg0 progress)
(arg1 font-context)
(arg2 int)
(arg3 symbol)
)
(defmethod draw-option menu-on-off-progressive-scan-graphic-option ((obj menu-on-off-progressive-scan-graphic-option)
(arg0 progress)
(arg1 font-context)
(arg2 int)
(arg3 symbol)
)
(local-vars (a0-11 string))
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(if (< f30-0 0.0)
@@ -6251,7 +6252,7 @@
(cond
((= (-> *progress-state* graphic-options-item-selected) 2)
(let ((s2-3 arg1))
(set! (-> s2-3 color) (the-as font-color (progress-selected 0)))
(set! (-> s2-3 color) (progress-selected 0))
)
(draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 24 f30-0)
)
@@ -6298,7 +6299,7 @@
(none)
)
(defmethod menu-option-method-10 menu-center-screen-graphic-option ((obj menu-center-screen-graphic-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-center-screen-graphic-option ((obj menu-center-screen-graphic-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(if (< f30-0 0.0)
(set! f30-0 0.0)
@@ -6385,7 +6386,7 @@
(cond
((zero? (-> *progress-state* graphic-options-item-selected))
(let ((s4-3 arg1))
(set! (-> s4-3 color) (the-as font-color (progress-selected 0)))
(set! (-> s4-3 color) (progress-selected 0))
)
(draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 25 f30-0)
)
@@ -6403,7 +6404,7 @@
(none)
)
(defmethod menu-option-method-10 menu-restart-mission-qr-option ((obj menu-restart-mission-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-restart-mission-qr-option ((obj menu-restart-mission-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars (a0-11 string))
(let ((f0-1 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(if (< f0-1 0.0)
@@ -6466,7 +6467,7 @@
(none)
)
(defmethod menu-option-method-10 menu-quit-qr-option ((obj menu-quit-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-quit-qr-option ((obj menu-quit-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars (a0-12 string))
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(if (< f30-0 0.0)
@@ -6540,7 +6541,7 @@
(none)
)
(defmethod menu-option-method-10 menu-slider-option ((obj menu-slider-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-slider-option ((obj menu-slider-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars
(v0-42 pointer)
(sv-16 progress)
@@ -6911,7 +6912,7 @@
(none)
)
(defmethod menu-option-method-10 menu-stereo-mode-sound-option ((obj menu-stereo-mode-sound-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-stereo-mode-sound-option ((obj menu-stereo-mode-sound-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars (s5-0 int))
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(let ((v1-2 arg1))
@@ -6971,7 +6972,7 @@
)
(set! (-> arg1 origin x) (+ -70.0 (-> arg1 origin x)))
(let ((s4-3 arg1))
(set! (-> s4-3 color) (the-as font-color (progress-selected 0)))
(set! (-> s4-3 color) (progress-selected 0))
)
(let ((a0-23 arg1))
(set! (-> a0-23 flags) (font-flags kerning middle large))
@@ -7016,12 +7017,11 @@
(none)
)
;; ERROR: Failed store: (s.w! (+ v1-87 8) 0) at op 335
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 349]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 361]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 417]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 435]
(defmethod menu-option-method-10 menu-sub-menu-option ((obj menu-sub-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-sub-menu-option ((obj menu-sub-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars (sv-16 dma-buffer))
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))
(s2-0 (the int (+ -1.0 (-> arg1 origin y))))
@@ -7061,7 +7061,7 @@
(when (nonzero? (-> obj name))
(let ((s0-0 arg1))
(set! (-> s0-0 color) (if (= arg2 (-> arg0 option-index))
(the-as font-color (progress-selected 0))
(the-as font-color (the-as int (progress-selected 0)))
(font-color #7efbfb)
)
)
@@ -7069,7 +7069,7 @@
(cond
((= arg2 (-> arg0 option-index))
(let ((s0-1 arg1))
(set! (-> s0-1 color) (the-as font-color (progress-selected 0)))
(set! (-> s0-1 color) (progress-selected 0))
)
)
(else
@@ -16,7 +16,7 @@
(define-extern activate-progress (function process symbol none))
(define-extern memcard-unlocked-secrets? (function symbol game-secrets))
(define-extern progress-selected (function int int :behavior progress))
(define-extern progress-selected (function int font-color :behavior progress))
(define-extern get-num-highscores (function int))
(define-extern get-next-highscore (function int int))
(define-extern get-prev-highscore (function int int))
@@ -84,7 +84,7 @@
:flag-assert #xc00000030
(:methods
(respond-progress (_type_ progress object) int :behavior progress 9)
(menu-option-method-10 (_type_ progress font-context int symbol) none 10)
(draw-option (_type_ progress font-context int symbol) none 10)
(menu-option-method-11 () none 11)
)
)
+2 -2
View File
@@ -1341,12 +1341,12 @@
)
(let ((s3-0 sv-144))
(set! (-> s3-0 color) (if (and (= s4-1 (-> self option-index)) (= (-> self menu-transition) 0.0))
(the-as font-color (progress-selected 0))
(progress-selected 0)
(font-color #7efbfb)
)
)
)
(menu-option-method-10
(draw-option
(-> gp-0 s4-1)
self
sv-144
-1
View File
@@ -12,7 +12,6 @@
"Load text, if needed. txt-name is the group name, curr-text is the _symbol_ for
the game-text-info, and heap is the heap to load to. The heap will be cleared."
(function string (pointer object) kheap int))
(define-extern print-game-text-scaled "Print text, with a given scaling" (function string float font-context int none))
(define-extern print-game-text "Print text." (function string font-context symbol int bucket-id float))
;; DECOMP BEGINS
+1 -1
View File
@@ -358,7 +358,7 @@ in a single text group and file."
(none)
)
(defun print-game-text-scaled ((arg0 string) (arg1 float) (arg2 font-context) (arg3 int))
(defun print-game-text-scaled ((arg0 string) (arg1 float) (arg2 font-context) (arg3 bucket-id))
"Print text, with a given scaling"
(let ((f26-0 (-> arg2 width))
(f30-0 (-> arg2 height))
+118 -132
View File
@@ -2,8 +2,9 @@
(in-package goal)
;; definition for function progress-selected
;; WARN: Return type mismatch int vs font-color.
(defbehavior progress-selected progress ((arg0 int))
(let ((gp-0 33))
(let ((color (font-color #7ffcfc)))
(cond
((< 4 (the-as int (logand (-> self clock integral-frame-counter) 7)))
(set! (-> *progress-state* color-flash-counter) 1)
@@ -15,21 +16,44 @@
)
(cond
((zero? (-> *progress-state* color-flash-counter))
(set-font-color gp-0 0 64 128 128)
(set-font-color gp-0 1 64 128 128)
(set-font-color
(the-as font-color color)
0
(new 'static 'rgba :r #x40)
(new 'static 'rgba :r #x80)
(new 'static 'rgba :r #x80)
)
(set-font-color
(the-as font-color color)
1
(new 'static 'rgba :r #x40)
(new 'static 'rgba :r #x80)
(new 'static 'rgba :r #x80)
)
)
(else
(set-font-color gp-0 0 255 255 255)
(set-font-color gp-0 1 255 255 255)
(set-font-color
(the-as font-color color)
0
(new 'static 'rgba :r #xff)
(new 'static 'rgba :r #xff)
(new 'static 'rgba :r #xff)
)
(set-font-color
(the-as font-color color)
1
(new 'static 'rgba :r #xff)
(new 'static 'rgba :r #xff)
(new 'static 'rgba :r #xff)
)
)
)
gp-0
(the-as font-color color)
)
)
;; definition for function draw-percent-bar
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ v1-8 8) 0) at op 39
(defun draw-percent-bar ((arg0 int) (arg1 int) (arg2 float) (arg3 rgba))
(with-dma-buffer-add-bucket ((s2-0 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id particles)
@@ -42,7 +66,6 @@
)
;; definition for function draw-highlight
;; ERROR: Failed store: (s.w! (+ v1-6 8) 0) at op 45
(defun draw-highlight ((arg0 int) (arg1 int) (arg2 float))
(let ((s3-0 (if (= (get-aspect-ratio) 'aspect4x3)
70
@@ -128,7 +151,7 @@
(set! (-> a0-1 flags) (font-flags kerning large))
)
(let ((s2-0 arg1))
(set! (-> s2-0 color) (the-as font-color (progress-selected 200)))
(set! (-> s2-0 color) (progress-selected 200))
)
(let ((v1-15 arg1))
(set! (-> v1-15 scale) 0.6)
@@ -256,8 +279,6 @@
)
;; definition for function begin-scissor
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ v1-23 8) 0) at op 71
(defun begin-scissor ((arg0 hud-box) (arg1 progress))
(cond
((or (= (-> arg1 current) 'bigmap) (= (-> arg1 next) 'bigmap))
@@ -285,12 +306,9 @@
(setup-scissor arg0 s4-0)
)
0
(none)
)
;; definition for function end-scissor
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ v1-7 8) 0) at op 17
(defun end-scissor ((arg0 hud-box) (arg1 float))
(with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
@@ -298,12 +316,9 @@
(restore-scissor arg0 s5-0)
)
0
(none)
)
;; definition for function begin-scissor-secret
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ v1-17 8) 0) at op 50
(defun begin-scissor-secret ((arg0 hud-box) (arg1 progress))
(cond
((= (get-aspect-ratio) 'aspect16x9)
@@ -325,12 +340,9 @@
(setup-scissor arg0 s4-0)
)
0
(none)
)
;; definition for function end-scissor-secret
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ v1-7 8) 0) at op 17
(defun end-scissor-secret ((arg0 hud-box) (arg1 float))
(with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
@@ -338,13 +350,10 @@
(restore-scissor arg0 s5-0)
)
0
(none)
)
;; definition for function begin-scissor-missions
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ v1-17 8) 0) at op 50
(defun begin-scissor-missions ((arg0 hud-box) (arg1 float))
(defun begin-scissor-missions ((arg0 hud-box))
(cond
((= (get-aspect-ratio) 'aspect16x9)
(set! (-> arg0 min x) 79.0)
@@ -365,12 +374,9 @@
(setup-scissor arg0 s4-0)
)
0
(none)
)
;; definition for function end-scissor-missions
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ v1-7 8) 0) at op 17
(defun end-scissor-missions ((arg0 hud-box) (arg1 float))
(with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
@@ -378,12 +384,9 @@
(restore-scissor arg0 s5-0)
)
0
(none)
)
;; definition for function begin-scissor-scene
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ v1-17 8) 0) at op 50
(defun begin-scissor-scene ((arg0 hud-box))
(cond
((= (get-aspect-ratio) 'aspect16x9)
@@ -405,12 +408,9 @@
(setup-scissor arg0 s4-0)
)
0
(none)
)
;; definition for function end-scissor-scene
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ v1-7 8) 0) at op 17
(defun end-scissor-scene ((arg0 hud-box) (arg1 float))
(with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
@@ -418,12 +418,9 @@
(restore-scissor arg0 s5-0)
)
0
(none)
)
;; definition for function begin-scissor-level
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ v1-17 8) 0) at op 50
(defun begin-scissor-level ((arg0 hud-box))
(cond
((= (get-aspect-ratio) 'aspect16x9)
@@ -445,12 +442,9 @@
(setup-scissor arg0 s4-0)
)
0
(none)
)
;; definition for function end-scissor-level
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ v1-7 8) 0) at op 17
(defun end-scissor-level ((arg0 hud-box) (arg1 float))
(with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
@@ -458,7 +452,6 @@
(restore-scissor arg0 s5-0)
)
0
(none)
)
;; definition for function print-language-name
@@ -473,7 +466,12 @@
(+! (-> arg1 origin x) (the float s5-0))
(let ((f30-0 (- 1.0 (* 0.0033333334 (the float arg2)))))
(set! (-> arg1 alpha) f30-0)
(print-game-text-scaled (lookup-text! *common-text* (-> *language-name-remap* arg0) #f) f30-0 arg1 320)
(print-game-text-scaled
(lookup-text! *common-text* (-> *language-name-remap* arg0) #f)
f30-0
arg1
(bucket-id progress)
)
)
(set! (-> arg1 origin x) (- (-> arg1 origin x) (the float s5-0)))
)
@@ -635,7 +633,7 @@
;; definition for method 10 of type menu-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-option ((obj menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-option ((obj menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
0
(none)
)
@@ -643,7 +641,7 @@
;; definition for method 10 of type menu-on-off-option
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-on-off-option ((obj menu-on-off-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-on-off-option ((obj menu-on-off-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars (a0-8 string) (sv-16 string))
(let ((s3-0 (if arg3
(&-> *progress-state* on-off-choice)
@@ -709,7 +707,7 @@
;; definition for method 10 of type menu-yes-no-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-yes-no-option ((obj menu-yes-no-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-yes-no-option ((obj menu-yes-no-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars (a0-8 string))
(let ((s3-0 (&-> *progress-state* yes-no-choice)))
(set! a0-8
@@ -757,7 +755,7 @@
;; definition for method 10 of type menu-video-mode-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-video-mode-option ((obj menu-video-mode-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-video-mode-option ((obj menu-video-mode-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(let ((s3-0 (&-> *progress-state* video-mode-choice))
(f28-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))
(f30-0 (-> arg1 origin y))
@@ -818,7 +816,7 @@
(cond
((= (-> *progress-state* graphic-options-item-selected) 3)
(let ((s2-4 arg1))
(set! (-> s2-4 color) (the-as font-color (progress-selected 0)))
(set! (-> s2-4 color) (progress-selected 0))
)
(draw-highlight (the int (+ -9.0 (-> arg1 origin y))) 22 f28-0)
)
@@ -869,7 +867,7 @@
;; definition for method 10 of type menu-unlocked-menu-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-unlocked-menu-option ((obj menu-unlocked-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-unlocked-menu-option ((obj menu-unlocked-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(let ((s5-0 (memcard-unlocked-secrets? #t))
(f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))
)
@@ -1052,7 +1050,7 @@
;; definition for method 10 of type menu-main-menu-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-main-menu-option ((obj menu-main-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-main-menu-option ((obj menu-main-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(-> arg1 flags)
(when (and (= (-> arg0 menu-transition) 0.0) (and (= (-> arg0 ring-angle) (-> arg0 ring-want-angle))
(nonzero? (-> obj name))
@@ -1305,7 +1303,6 @@
)
;; definition for function draw-savegame-box
;; ERROR: Failed store: (s.w! (+ v1-7 8) 0) at op 26
(defun draw-savegame-box ((arg0 menu-option) (arg1 float) (arg2 float) (arg3 float) (arg4 float))
(set! (-> arg0 box 0 min x) arg1)
(set! (-> arg0 box 0 max x) arg2)
@@ -1580,7 +1577,6 @@
;; definition for function draw-decoration
;; INFO: Used lq/sq
;; ERROR: Failed store: (s.w! (+ v1-41 8) 0) at op 177
(defun draw-decoration ((arg0 menu-option) (arg1 font-context) (arg2 float) (arg3 int) (arg4 symbol) (arg5 float))
(local-vars
(sv-16 symbol)
@@ -1694,7 +1690,6 @@
;; definition for function draw-missions-decoration
;; INFO: Used lq/sq
;; ERROR: Failed store: (s.w! (+ v1-28 8) 0) at op 138
(defun draw-missions-decoration ((arg0 menu-missions-option) (arg1 font-context) (arg2 float) (arg3 text-id))
(local-vars
(sv-16 int)
@@ -1770,7 +1765,6 @@
;; definition for function draw-sound-options-decoration
;; INFO: Used lq/sq
;; ERROR: Failed store: (s.w! (+ v1-34 8) 0) at op 152
(defun draw-sound-options-decoration ((arg0 menu-slider-option) (arg1 font-context) (arg2 float) (arg3 symbol) (arg4 text-id))
(local-vars
(sv-16 font-context)
@@ -1860,7 +1854,6 @@
;; definition for function draw-decoration-secrets
;; INFO: Used lq/sq
;; ERROR: Failed store: (s.w! (+ v1-30 8) 0) at op 140
(defun draw-decoration-secrets ((arg0 menu-option) (arg1 font-context) (arg2 float) (arg3 text-id))
(local-vars
(sv-16 int)
@@ -1938,7 +1931,6 @@
;; definition for function draw-decoration-load-save
;; INFO: Used lq/sq
;; ERROR: Failed store: (s.w! (+ v1-45 8) 0) at op 174
(defun draw-decoration-load-save ((arg0 menu-option) (arg1 font-context) (arg2 float) (arg3 int))
(local-vars
(sv-16 int)
@@ -2129,8 +2121,7 @@
;; WARN: Stack slot offset 36 signed mismatch
;; WARN: Stack slot offset 16 signed mismatch
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ v1-95 8) 0) at op 334
(defmethod menu-option-method-10 menu-memcard-slot-option ((obj menu-memcard-slot-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-memcard-slot-option ((obj menu-memcard-slot-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars
(v0-74 pointer)
(sv-16 float)
@@ -2187,7 +2178,7 @@
(else
(let ((s2-3 arg1))
(set! (-> s2-3 color) (if (= arg2 sv-20)
(the-as font-color (progress-selected 0))
(the-as font-color (the-as int (progress-selected 0)))
(font-color #7efbfb)
)
)
@@ -2568,7 +2559,7 @@
;; definition for method 10 of type menu-loading-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-loading-option ((obj menu-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-loading-option ((obj menu-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(with-pp
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
@@ -2576,7 +2567,7 @@
(set! (-> v1-3 scale) 0.55)
)
(let ((s4-0 arg1))
(set! (-> s4-0 color) (the-as font-color (progress-selected 0)))
(set! (-> s4-0 color) (progress-selected 0))
)
(let ((a0-3 arg1))
(set! (-> a0-3 flags) (font-flags kerning middle left large))
@@ -2627,7 +2618,7 @@
;; definition for method 10 of type menu-insufficient-space-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-insufficient-space-option ((obj menu-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-insufficient-space-option ((obj menu-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(when (!= (-> arg0 current) 'none)
(let ((v1-3 arg1))
@@ -2693,7 +2684,7 @@
)
(set! (-> arg1 origin y) (+ 60.0 (-> arg1 origin y)))
(let ((s5-2 arg1))
(set! (-> s5-2 color) (the-as font-color (progress-selected 0)))
(set! (-> s5-2 color) (progress-selected 0))
)
(draw-highlight (the int (+ 30.0 (-> arg1 origin y))) 24 (-> arg1 alpha))
(print-game-text
@@ -2706,7 +2697,7 @@
)
(else
(let ((s4-2 arg1))
(set! (-> s4-2 color) (the-as font-color (progress-selected 0)))
(set! (-> s4-2 color) (progress-selected 0))
)
(set! (-> arg1 origin y) (+ 20.0 (-> arg1 origin y)))
(draw-highlight (the int (+ 30.0 (-> arg1 origin y))) 24 (-> arg1 alpha))
@@ -2720,7 +2711,7 @@
;; definition for method 10 of type menu-secrets-insufficient-space-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-secrets-insufficient-space-option ((obj menu-secrets-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-secrets-insufficient-space-option ((obj menu-secrets-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((v1-1 arg1))
(set! (-> v1-1 scale) 0.5)
@@ -2751,7 +2742,7 @@
(set! (-> v1-13 height) (the float 30))
)
(let ((s5-1 arg1))
(set! (-> s5-1 color) (the-as font-color (progress-selected 0)))
(set! (-> s5-1 color) (progress-selected 0))
)
(draw-highlight (the int (-> arg1 origin y)) 24 (-> arg1 alpha))
(print-game-text
@@ -2767,7 +2758,7 @@
;; definition for method 10 of type menu-insert-card-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-insert-card-option ((obj menu-insert-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-insert-card-option ((obj menu-insert-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((v1-1 arg1))
(set! (-> v1-1 scale) 0.5)
@@ -2799,7 +2790,7 @@
(set! (-> v1-10 height) (the float 60))
)
(let ((s5-1 arg1))
(set! (-> s5-1 color) (the-as font-color (progress-selected 0)))
(set! (-> s5-1 color) (progress-selected 0))
)
(draw-highlight (the int (+ 17.0 (-> arg1 origin y))) 24 (-> arg1 alpha))
(print-game-text
@@ -2815,7 +2806,7 @@
;; definition for method 10 of type menu-error-loading-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-error-loading-option ((obj menu-error-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-error-loading-option ((obj menu-error-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((v1-1 arg1))
(set! (-> v1-1 scale) 0.5)
@@ -2868,7 +2859,7 @@
(set! (-> v1-19 height) (the float 45))
)
(let ((s5-2 arg1))
(set! (-> s5-2 color) (the-as font-color (progress-selected 0)))
(set! (-> s5-2 color) (progress-selected 0))
)
(draw-highlight (the int (+ 9.0 (-> arg1 origin y))) 24 (-> arg1 alpha))
(print-game-text
@@ -2884,7 +2875,7 @@
;; definition for method 10 of type menu-error-auto-saving-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-error-auto-saving-option ((obj menu-error-auto-saving-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-error-auto-saving-option ((obj menu-error-auto-saving-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((v1-1 arg1))
(set! (-> v1-1 scale) 0.5)
@@ -2945,7 +2936,7 @@
(set! (-> v1-19 height) (the float 25))
)
(let ((s5-4 arg1))
(set! (-> s5-4 color) (the-as font-color (progress-selected 0)))
(set! (-> s5-4 color) (progress-selected 0))
)
(draw-highlight (the int (-> arg1 origin y)) 22 (-> arg1 alpha))
(print-game-text
@@ -2961,7 +2952,7 @@
;; definition for method 10 of type menu-card-removed-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-card-removed-option ((obj menu-card-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-card-removed-option ((obj menu-card-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((v1-1 arg1))
(set! (-> v1-1 scale) 0.5)
@@ -3008,7 +2999,7 @@
(set! (-> v1-15 height) (the float 35))
)
(let ((s5-3 arg1))
(set! (-> s5-3 color) (the-as font-color (progress-selected 0)))
(set! (-> s5-3 color) (progress-selected 0))
)
(draw-highlight (the int (+ 5.0 (-> arg1 origin y))) 24 (-> arg1 alpha))
(print-game-text
@@ -3024,7 +3015,7 @@
;; definition for method 10 of type menu-error-disc-removed-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-error-disc-removed-option ((obj menu-error-disc-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-error-disc-removed-option ((obj menu-error-disc-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((a0-1 arg1))
(set! (-> a0-1 color) (font-color #7efbfb))
@@ -3067,7 +3058,7 @@
(set! (-> v1-14 height) (the float 50))
)
(let ((s5-2 arg1))
(set! (-> s5-2 color) (the-as font-color (progress-selected 0)))
(set! (-> s5-2 color) (progress-selected 0))
)
(draw-highlight (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha))
(print-game-text
@@ -3084,7 +3075,7 @@
;; definition for method 10 of type menu-error-reading-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-error-reading-option ((obj menu-error-reading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-error-reading-option ((obj menu-error-reading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((a0-1 arg1))
(set! (-> a0-1 color) (font-color #7efbfb))
@@ -3126,7 +3117,7 @@
(set! (-> v1-13 height) (the float 50))
)
(let ((s5-2 arg1))
(set! (-> s5-2 color) (the-as font-color (progress-selected 0)))
(set! (-> s5-2 color) (progress-selected 0))
)
(draw-highlight (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha))
(print-game-text
@@ -3142,8 +3133,7 @@
;; definition for method 10 of type menu-icon-info-option
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ v1-16 8) 0) at op 72
(defmethod menu-option-method-10 menu-icon-info-option ((obj menu-icon-info-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-icon-info-option ((obj menu-icon-info-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((a0-1 arg1))
(set! (-> a0-1 color) (font-color #7efbfb))
@@ -3203,7 +3193,7 @@
(set! (-> v1-34 height) (the float 50))
)
(let ((s5-3 arg1))
(set! (-> s5-3 color) (the-as font-color (progress-selected 0)))
(set! (-> s5-3 color) (progress-selected 0))
)
(draw-highlight (the int (+ 12.0 (-> arg1 origin y))) 24 (-> arg1 alpha))
(print-game-text
@@ -3219,7 +3209,7 @@
;; definition for method 10 of type menu-format-card-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-format-card-option ((obj menu-format-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-format-card-option ((obj menu-format-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((a0-1 arg1))
(set! (-> a0-1 color) (font-color #7efbfb))
@@ -3273,7 +3263,7 @@
;; definition for method 10 of type menu-already-exists-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-already-exists-option ((obj menu-already-exists-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-already-exists-option ((obj menu-already-exists-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((a0-1 arg1))
(set! (-> a0-1 color) (font-color #7efbfb))
@@ -3319,7 +3309,7 @@
;; definition for method 10 of type menu-create-game-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-create-game-option ((obj menu-create-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-create-game-option ((obj menu-create-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((a0-1 arg1))
(set! (-> a0-1 color) (font-color #7efbfb))
@@ -3362,7 +3352,7 @@
;; definition for method 10 of type menu-video-mode-warning-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-video-mode-warning-option ((obj menu-video-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-video-mode-warning-option ((obj menu-video-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((a0-1 arg1))
(set! (-> a0-1 color) (font-color #7efbfb))
@@ -3430,7 +3420,7 @@
;; definition for method 10 of type menu-video-mode-ok-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-video-mode-ok-option ((obj menu-video-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-video-mode-ok-option ((obj menu-video-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((a0-1 arg1))
(set! (-> a0-1 color) (font-color #7efbfb))
@@ -3476,7 +3466,7 @@
;; definition for method 10 of type menu-progressive-mode-warning-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-progressive-mode-warning-option ((obj menu-progressive-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-progressive-mode-warning-option ((obj menu-progressive-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((a0-1 arg1))
(set! (-> a0-1 color) (font-color #7efbfb))
@@ -3544,7 +3534,7 @@
;; definition for method 10 of type menu-progressive-mode-ok-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-progressive-mode-ok-option ((obj menu-progressive-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-progressive-mode-ok-option ((obj menu-progressive-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((a0-1 arg1))
(set! (-> a0-1 color) (font-color #7efbfb))
@@ -3590,7 +3580,7 @@
;; definition for method 10 of type menu-quit-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-quit-option ((obj menu-quit-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-quit-option ((obj menu-quit-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition)))
(let ((a0-1 arg1))
(set! (-> a0-1 color) (font-color #7efbfb))
@@ -3627,7 +3617,7 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
;; WARN: disable def twice: 147. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare.
(defmethod menu-option-method-10 menu-select-start-option ((obj menu-select-start-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-select-start-option ((obj menu-select-start-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars
(sv-48 int)
(sv-64 int)
@@ -3742,7 +3732,7 @@
((zero? s2-0)
(set! (-> obj real-task-index) sv-64)
(set! sv-96 arg1)
(set! (-> sv-96 color) (the-as font-color (progress-selected 0)))
(set! (-> sv-96 color) (progress-selected 0))
(draw-highlight (+ s0-0 47) 50 f30-0)
)
(else
@@ -3796,7 +3786,7 @@
;; definition for method 10 of type menu-select-scene-option
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-select-scene-option ((obj menu-select-scene-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-select-scene-option ((obj menu-select-scene-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars
(sv-48 int)
(sv-64 (function string font-context symbol int bucket-id float))
@@ -3935,12 +3925,12 @@
(cond
((and (< s3-0 s4-0) (!= (-> arg0 sliding-height) 0.0))
(set! sv-192 arg1)
(set! (-> sv-192 color) (the-as font-color (progress-selected 0)))
(set! (-> sv-192 color) (progress-selected 0))
(draw-highlight (+ (the int f26-0) -2 s0-1) (the int f26-0) f30-0)
)
((or (and (= s3-0 s4-0) (= (fabs (-> arg0 sliding-height)) 0.0)) (zero? s3-0))
(set! sv-208 arg1)
(set! (-> sv-208 color) (the-as font-color (progress-selected 0)))
(set! (-> sv-208 color) (progress-selected 0))
(draw-highlight (+ s0-1 -2) (the int f26-0) f30-0)
)
(else
@@ -3974,7 +3964,7 @@
;; definition for method 10 of type menu-bigmap-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-bigmap-option ((obj menu-bigmap-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-bigmap-option ((obj menu-bigmap-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
0
(none)
)
@@ -4193,7 +4183,7 @@
;; WARN: Stack slot offset 20 signed mismatch
;; WARN: Stack slot offset 20 signed mismatch
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-missions-option ((obj menu-missions-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-missions-option ((obj menu-missions-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars
(f0-50 float)
(sv-16 float)
@@ -4278,7 +4268,7 @@
)
)
)
(begin-scissor-missions sv-276 (the-as float arg0))
(begin-scissor-missions sv-276)
(let ((a0-27 arg1))
(set! (-> a0-27 flags) (font-flags kerning large))
)
@@ -4488,7 +4478,7 @@
(else
(let ((s3-1 arg2))
(set! (-> s3-1 color) (if (= arg3 1)
(the-as font-color (progress-selected 0))
(the-as font-color (the-as int (progress-selected 0)))
(font-color #7efbfb)
)
)
@@ -4894,8 +4884,7 @@
;; WARN: Stack slot offset 112 signed mismatch
;; WARN: Stack slot offset 108 signed mismatch
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ v1-42 8) 0) at op 138
(defmethod menu-option-method-10 menu-secret-option ((obj menu-secret-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-secret-option ((obj menu-secret-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars
(sv-16 float)
(sv-20 symbol)
@@ -5143,7 +5132,6 @@
)
;; definition for function draw-highscore-icon
;; ERROR: Failed store: (s.w! (+ v1-8 8) 0) at op 37
(defun draw-highscore-icon ((arg0 menu-highscores-option) (arg1 uint) (arg2 int) (arg3 int) (arg4 float))
(set! (-> arg0 sprites 0 tex) (lookup-texture-by-id (the-as texture-id arg1)))
(set! (-> arg0 sprites 0 scale-x) arg4)
@@ -5157,7 +5145,6 @@
)
;; definition for function draw-highscore-cup
;; ERROR: Failed store: (s.w! (+ v1-20 8) 0) at op 75
(defun draw-highscore-cup ((arg0 texture-page) (arg1 int) (arg2 int) (arg3 int) (arg4 float) (arg5 float))
"First int is an enum"
(let ((a0-1 (the-as uint #xc9300300)))
@@ -6045,7 +6032,7 @@
;; WARN: Stack slot offset 120 signed mismatch
;; WARN: Stack slot offset 108 signed mismatch
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-highscores-option ((obj menu-highscores-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-highscores-option ((obj menu-highscores-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars
(sv-96 float)
(sv-100 float)
@@ -6350,7 +6337,7 @@
;; definition for method 10 of type menu-on-off-game-vibrations-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-on-off-game-vibrations-option ((obj menu-on-off-game-vibrations-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-on-off-game-vibrations-option ((obj menu-on-off-game-vibrations-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars (a0-10 string))
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(if (< f30-0 0.0)
@@ -6397,7 +6384,7 @@
(cond
((zero? (-> *progress-state* game-options-item-selected))
(let ((s2-3 arg1))
(set! (-> s2-3 color) (the-as font-color (progress-selected 0)))
(set! (-> s2-3 color) (progress-selected 0))
)
(draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 22 f30-0)
)
@@ -6440,7 +6427,7 @@
;; definition for method 10 of type menu-on-off-game-subtitles-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-on-off-game-subtitles-option ((obj menu-on-off-game-subtitles-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-on-off-game-subtitles-option ((obj menu-on-off-game-subtitles-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars (a0-11 string))
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(if (< f30-0 0.0)
@@ -6487,7 +6474,7 @@
(cond
((= (-> *progress-state* game-options-item-selected) 1)
(let ((s2-3 arg1))
(set! (-> s2-3 color) (the-as font-color (progress-selected 0)))
(set! (-> s2-3 color) (progress-selected 0))
)
(draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 22 f30-0)
)
@@ -6530,7 +6517,7 @@
;; definition for method 10 of type menu-subtitle-language-game-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-subtitle-language-game-option ((obj menu-subtitle-language-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-subtitle-language-game-option ((obj menu-subtitle-language-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(with-pp
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(let ((v1-2 arg1))
@@ -6595,7 +6582,7 @@
)
(set! (-> arg1 origin x) (+ -70.0 (-> arg1 origin x)))
(let ((s5-3 arg1))
(set! (-> s5-3 color) (the-as font-color (progress-selected 0)))
(set! (-> s5-3 color) (progress-selected 0))
)
(let ((v1-43 (if (and (= (scf-get-territory) 1) (zero? (-> *progress-state* game-options-subtitle-language-index)))
7
@@ -6616,7 +6603,7 @@
(cond
((= (-> *progress-state* game-options-item-selected) 2)
(let ((s4-4 arg1))
(set! (-> s4-4 color) (the-as font-color (progress-selected 0)))
(set! (-> s4-4 color) (progress-selected 0))
)
(draw-highlight (the int (-> arg1 origin y)) 24 f30-0)
)
@@ -6665,7 +6652,7 @@
;; definition for method 10 of type menu-language-game-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-language-game-option ((obj menu-language-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-language-game-option ((obj menu-language-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(with-pp
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(let ((v1-2 arg1))
@@ -6733,7 +6720,7 @@
)
(set! (-> arg1 origin x) (+ -70.0 (-> arg1 origin x)))
(let ((s5-3 arg1))
(set! (-> s5-3 color) (the-as font-color (progress-selected 0)))
(set! (-> s5-3 color) (progress-selected 0))
)
(let ((v1-43 (if (and (= (scf-get-territory) 1) (zero? (-> *progress-state* game-options-language-index)))
7
@@ -6754,7 +6741,7 @@
(cond
((= (-> *progress-state* game-options-item-selected) 3)
(let ((s3-1 arg1))
(set! (-> s3-1 color) (the-as font-color (progress-selected 0)))
(set! (-> s3-1 color) (progress-selected 0))
)
(draw-highlight (the int (-> arg1 origin y)) 24 f30-0)
)
@@ -6808,7 +6795,7 @@
;; definition for method 10 of type menu-sub-menu-game-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-sub-menu-game-option ((obj menu-sub-menu-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-sub-menu-game-option ((obj menu-sub-menu-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(let ((f0-1 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
395.0
(-> arg1 origin y)
@@ -6831,7 +6818,7 @@
;; definition for method 10 of type menu-aspect-ratio-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-aspect-ratio-option ((obj menu-aspect-ratio-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-aspect-ratio-option ((obj menu-aspect-ratio-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars (a0-12 string))
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(if (< f30-0 0.0)
@@ -6888,7 +6875,7 @@
(cond
((= (-> *progress-state* graphic-options-item-selected) 1)
(let ((s2-3 arg1))
(set! (-> s2-3 color) (the-as font-color (progress-selected 0)))
(set! (-> s2-3 color) (progress-selected 0))
)
(draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 25 f30-0)
)
@@ -6938,12 +6925,12 @@
;; definition for method 10 of type menu-on-off-progressive-scan-graphic-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-on-off-progressive-scan-graphic-option ((obj menu-on-off-progressive-scan-graphic-option)
(arg0 progress)
(arg1 font-context)
(arg2 int)
(arg3 symbol)
)
(defmethod draw-option menu-on-off-progressive-scan-graphic-option ((obj menu-on-off-progressive-scan-graphic-option)
(arg0 progress)
(arg1 font-context)
(arg2 int)
(arg3 symbol)
)
(local-vars (a0-11 string))
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(if (< f30-0 0.0)
@@ -6997,7 +6984,7 @@
(cond
((= (-> *progress-state* graphic-options-item-selected) 2)
(let ((s2-3 arg1))
(set! (-> s2-3 color) (the-as font-color (progress-selected 0)))
(set! (-> s2-3 color) (progress-selected 0))
)
(draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 24 f30-0)
)
@@ -7046,7 +7033,7 @@
;; definition for method 10 of type menu-center-screen-graphic-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-center-screen-graphic-option ((obj menu-center-screen-graphic-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-center-screen-graphic-option ((obj menu-center-screen-graphic-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(if (< f30-0 0.0)
(set! f30-0 0.0)
@@ -7133,7 +7120,7 @@
(cond
((zero? (-> *progress-state* graphic-options-item-selected))
(let ((s4-3 arg1))
(set! (-> s4-3 color) (the-as font-color (progress-selected 0)))
(set! (-> s4-3 color) (progress-selected 0))
)
(draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 25 f30-0)
)
@@ -7153,7 +7140,7 @@
;; definition for method 10 of type menu-restart-mission-qr-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-restart-mission-qr-option ((obj menu-restart-mission-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-restart-mission-qr-option ((obj menu-restart-mission-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars (a0-11 string))
(let ((f0-1 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(if (< f0-1 0.0)
@@ -7218,7 +7205,7 @@
;; definition for method 10 of type menu-quit-qr-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-quit-qr-option ((obj menu-quit-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-quit-qr-option ((obj menu-quit-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars (a0-12 string))
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(if (< f30-0 0.0)
@@ -7295,7 +7282,7 @@
;; definition for method 10 of type menu-slider-option
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-slider-option ((obj menu-slider-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-slider-option ((obj menu-slider-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars
(v0-42 pointer)
(sv-16 progress)
@@ -7668,7 +7655,7 @@
;; definition for method 10 of type menu-stereo-mode-sound-option
;; WARN: Return type mismatch int vs none.
(defmethod menu-option-method-10 menu-stereo-mode-sound-option ((obj menu-stereo-mode-sound-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-stereo-mode-sound-option ((obj menu-stereo-mode-sound-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars (s5-0 int))
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))))
(let ((v1-2 arg1))
@@ -7728,7 +7715,7 @@
)
(set! (-> arg1 origin x) (+ -70.0 (-> arg1 origin x)))
(let ((s4-3 arg1))
(set! (-> s4-3 color) (the-as font-color (progress-selected 0)))
(set! (-> s4-3 color) (progress-selected 0))
)
(let ((a0-23 arg1))
(set! (-> a0-23 flags) (font-flags kerning middle large))
@@ -7776,12 +7763,11 @@
;; definition for method 10 of type menu-sub-menu-option
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
;; ERROR: Failed store: (s.w! (+ v1-87 8) 0) at op 335
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 349]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 361]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 417]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 435]
(defmethod menu-option-method-10 menu-sub-menu-option ((obj menu-sub-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(defmethod draw-option menu-sub-menu-option ((obj menu-sub-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol))
(local-vars (sv-16 dma-buffer))
(let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))
(s2-0 (the int (+ -1.0 (-> arg1 origin y))))
@@ -7821,7 +7807,7 @@
(when (nonzero? (-> obj name))
(let ((s0-0 arg1))
(set! (-> s0-0 color) (if (= arg2 (-> arg0 option-index))
(the-as font-color (progress-selected 0))
(the-as font-color (the-as int (progress-selected 0)))
(font-color #7efbfb)
)
)
@@ -7829,7 +7815,7 @@
(cond
((= arg2 (-> arg0 option-index))
(let ((s0-1 arg1))
(set! (-> s0-1 color) (the-as font-color (progress-selected 0)))
(set! (-> s0-1 color) (progress-selected 0))
)
)
(else
+1 -1
View File
@@ -101,7 +101,7 @@
:flag-assert #xc00000030
(:methods
(respond-progress (_type_ progress object) int :behavior progress 9)
(menu-option-method-10 (_type_ progress font-context int symbol) none 10)
(draw-option (_type_ progress font-context int symbol) none 10)
(menu-option-method-11 () none 11)
)
)
+2 -3
View File
@@ -1396,7 +1396,6 @@
)
;; definition for function end-scan
;; ERROR: Failed store: (s.w! (+ v1-8 8) 0) at op 19
(defun end-scan ((arg0 hud-box) (arg1 float))
(with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
@@ -1462,12 +1461,12 @@
)
(let ((s3-0 sv-144))
(set! (-> s3-0 color) (if (and (= s4-1 (-> self option-index)) (= (-> self menu-transition) 0.0))
(the-as font-color (progress-selected 0))
(the-as font-color (the-as int (progress-selected 0)))
(font-color #7efbfb)
)
)
)
(menu-option-method-10
(draw-option
(-> gp-0 s4-1)
self
sv-144
+1 -1
View File
@@ -389,7 +389,7 @@ in a single text group and file."
;; definition for function print-game-text-scaled
;; WARN: Return type mismatch int vs none.
(defun print-game-text-scaled ((arg0 string) (arg1 float) (arg2 font-context) (arg3 int))
(defun print-game-text-scaled ((arg0 string) (arg1 float) (arg2 font-context) (arg3 bucket-id))
"Print text, with a given scaling"
(let ((f26-0 (-> arg2 width))
(f30-0 (-> arg2 height))