Skip to content

Commit

Permalink
FF7: Fix direct color (#587)
Browse files Browse the repository at this point in the history
  • Loading branch information
myst6re committed Sep 2, 2023
1 parent 0c22bb9 commit 8080625
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
## FF7

- Ambient: Allow ambient effects to playback in fields that use movies as background
- Renderer: Fix black color in some field maps (spipe2 for example)

# 1.16.0

Expand Down
2 changes: 1 addition & 1 deletion src/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1650,7 +1650,7 @@ void convert_image_data(const unsigned char *image_data, uint32_t *converted_ima
o += tex_format->bytesperpixel;

// PSX style mask bit
if(color_key && (pixel & ~tex_format->alpha_mask) == 0)
if((color_key == 1 && (pixel & ~tex_format->alpha_mask) == 0) || (color_key == 3 && pixel == 0))
{
converted_image_data[c++] = 0;
continue;
Expand Down
7 changes: 5 additions & 2 deletions src/ff7/field/field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ namespace ff7::field
ff7_externals.field_layers[dst]->tex_header = tex_header;

if(ff7_externals.field_layers[src]->type == 1) ff7_externals.make_field_tex_header_pal(tex_header);
if(ff7_externals.field_layers[src]->type == 2) ff7_externals.make_field_tex_header(tex_header);
if(ff7_externals.field_layers[src]->type == 2) {
ff7_externals.make_field_tex_header(tex_header);
tex_header->color_key = 3;
}

struc_3->tex_header = tex_header;

Expand Down Expand Up @@ -267,4 +270,4 @@ namespace ff7::field
patch_code_dword((uint32_t)&common_externals.execute_opcode_table[WAIT], (DWORD)&opcode_script_WAIT);
replace_function(ff7_externals.sub_611BAE, opcode_IFSW_compare_sub);
}
}
}
5 changes: 5 additions & 0 deletions src/ff7_opengl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,11 @@ void ff7_init_hooks(struct game_obj *_game_object)
patch_code_int(ff7_externals.field_init_viewport_values + 0x6E, 240);
}

// ########################
// field direct color black
// ########################
patch_code_short(uint32_t(ff7_externals.field_convert_type2_layers) + 0xE3, 0x8000);

// #####################
// worldmap footsteps
// #####################
Expand Down

0 comments on commit 8080625

Please sign in to comment.