X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=plugins%2Fgpu_neon%2Fpsx_gpu%2Fpsx_gpu.c;h=84848f8d9e52d6f9b020b2881f024953ab780869;hb=e86b6fecb5f0db18b29900a1af82d455c38fcb1e;hp=c9175df3255812d06d1c9d8066be9d64bf7d07e8;hpb=2bbbb7af9194079f8862b4e9ed2bb762f876e9c1;p=pcsx_rearmed.git diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu.c b/plugins/gpu_neon/psx_gpu/psx_gpu.c index c9175df3..84848f8d 100644 --- a/plugins/gpu_neon/psx_gpu/psx_gpu.c +++ b/plugins/gpu_neon/psx_gpu/psx_gpu.c @@ -2760,8 +2760,6 @@ char *render_block_flag_strings[] = (triangle_y_direction_##direction_c << 4) | \ (triangle_winding_##winding << 6)) \ -psx_gpu_struct __attribute__((aligned(64))) psx_gpu_alt; - void render_triangle(psx_gpu_struct *psx_gpu, vertex_struct *vertexes, u32 flags) { @@ -3888,9 +3886,18 @@ void render_sprite(psx_gpu_struct *psx_gpu, s32 x, s32 y, u32 u, u32 v, #define set_line_gradients(minor) \ { \ s32 gradient_divisor = delta_##minor; \ - gradient_r = int_to_fixed(vertex_b->r - vertex_a->r) / gradient_divisor; \ - gradient_g = int_to_fixed(vertex_b->g - vertex_a->g) / gradient_divisor; \ - gradient_b = int_to_fixed(vertex_b->b - vertex_a->b) / gradient_divisor; \ + if(gradient_divisor != 0) \ + { \ + gradient_r = int_to_fixed(vertex_b->r - vertex_a->r) / gradient_divisor; \ + gradient_g = int_to_fixed(vertex_b->g - vertex_a->g) / gradient_divisor; \ + gradient_b = int_to_fixed(vertex_b->b - vertex_a->b) / gradient_divisor; \ + } \ + else \ + { \ + gradient_r = 0; \ + gradient_g = 0; \ + gradient_b = 0; \ + } \ current_r = fixed_center(vertex_a->r); \ current_g = fixed_center(vertex_a->g); \ current_b = fixed_center(vertex_a->b); \