Skip to content

Commit

Permalink
Fix for G_TEXTURE_GEN_LINEAR. Authored-by: @DarioSamo (Kenix3#727)
Browse files Browse the repository at this point in the history
(cherry picked from commit 4810a17)
  • Loading branch information
sonicdcer authored and Archez committed Dec 19, 2024
1 parent 57a5994 commit e827598
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/graphic/Fast3D/gfx_pc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1313,8 +1313,8 @@ static void gfx_sp_vertex(size_t n_vertices, size_t dest_index, const F3DVtx* ve
doty = (2.906921f * doty * doty + 1.36114f) * doty;
dotx = (dotx + 1.0f) / 4.0f;
doty = (doty + 1.0f) / 4.0f;*/
dotx = acosf(-dotx) /* M_PI */ / 4.0f;
doty = acosf(-doty) /* M_PI */ / 4.0f;
dotx = acosf(-dotx) /* M_PI */ * 0.159155f;
doty = acosf(-doty) /* M_PI */ * 0.159155f;
} else {
dotx = (dotx + 1.0f) / 4.0f;
doty = (doty + 1.0f) / 4.0f;
Expand Down Expand Up @@ -4000,6 +4000,14 @@ static void gfx_sp_reset() {
g_rsp.modelview_matrix_stack_size = 1;
g_rsp.current_num_lights = 2;
g_rsp.lights_changed = true;
g_rsp.lookat[0].dir[0] = 0;
g_rsp.lookat[0].dir[1] = 127;
g_rsp.lookat[0].dir[2] = 0;
g_rsp.lookat[1].dir[0] = 127;
g_rsp.lookat[1].dir[1] = 0;
g_rsp.lookat[1].dir[2] = 0;
calculate_normal_dir(&g_rsp.lookat[0], g_rsp.current_lookat_coeffs[0]);
calculate_normal_dir(&g_rsp.lookat[1], g_rsp.current_lookat_coeffs[1]);
}

void gfx_get_dimensions(uint32_t* width, uint32_t* height, int32_t* posX, int32_t* posY) {
Expand Down

0 comments on commit e827598

Please sign in to comment.