mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-02-07 02:40:30 -05:00
Removed ternary operator
This commit is contained in:
parent
f5f2205d0f
commit
6991549cde
@ -311,7 +311,7 @@ void gfx_direct3d_common_build_shader(char buf[4096], size_t& len, size_t& num_f
|
||||
if (cc_features.opt_grayscale) {
|
||||
append_line(buf, &len, "float intensity = (texel.r + texel.g + texel.b) / 3.0;");
|
||||
append_line(buf, &len, "float3 new_texel = input.grayscale.rgb * intensity;");
|
||||
append_line(buf, &len, "texel.rgb = input.grayscale.a > 0 ? lerp(texel.rgb, new_texel, input.grayscale.a) : new_texel;");
|
||||
append_line(buf, &len, "texel.rgb = lerp(texel.rgb, new_texel, input.grayscale.a);");
|
||||
}
|
||||
|
||||
if (cc_features.opt_alpha && cc_features.opt_noise) {
|
||||
|
@ -371,7 +371,7 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad
|
||||
if (cc_features.opt_grayscale) {
|
||||
append_line(fs_buf, &fs_len, "float intensity = (texel.r + texel.g + texel.b) / 3.0;");
|
||||
append_line(fs_buf, &fs_len, "vec3 new_texel = vGrayscaleColor.rgb * intensity;");
|
||||
append_line(fs_buf, &fs_len, "texel.rgb = vGrayscaleColor.a > 0 ? mix(texel.rgb, new_texel, vGrayscaleColor.a) : new_texel;");
|
||||
append_line(fs_buf, &fs_len, "texel.rgb = mix(texel.rgb, new_texel, vGrayscaleColor.a);");
|
||||
}
|
||||
|
||||
if (cc_features.opt_alpha) {
|
||||
|
@ -578,7 +578,7 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) {
|
||||
int itemId = ITEM_SWORD_KOKIRI + temp;
|
||||
bool not_acquired = (gItemAgeReqs[itemId] != 9) && (gItemAgeReqs[itemId] != gSaveContext.linkAge);
|
||||
if (not_acquired) {
|
||||
gsDPSetGrayscaleColor(POLY_KAL_DISP++, 109, 109, 109, 0);
|
||||
gsDPSetGrayscaleColor(POLY_KAL_DISP++, 109, 109, 109, 255);
|
||||
gsSPGrayscale(POLY_KAL_DISP++, true);
|
||||
}
|
||||
KaleidoScope_DrawQuadTextureRGBA32(globalCtx->state.gfxCtx, gItemIcons[itemId], 32, 32, point);
|
||||
|
@ -470,7 +470,7 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) {
|
||||
int itemId = gSaveContext.inventory.items[i];
|
||||
bool not_acquired = (gItemAgeReqs[itemId] != 9) && (gItemAgeReqs[itemId] != gSaveContext.linkAge);
|
||||
if (not_acquired) {
|
||||
gsDPSetGrayscaleColor(POLY_KAL_DISP++, 109, 109, 109, 0);
|
||||
gsDPSetGrayscaleColor(POLY_KAL_DISP++, 109, 109, 109, 255);
|
||||
gsSPGrayscale(POLY_KAL_DISP++, true);
|
||||
}
|
||||
KaleidoScope_DrawQuadTextureRGBA32(globalCtx->state.gfxCtx, gItemIcons[itemId], 32,
|
||||
|
Loading…
Reference in New Issue
Block a user