this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Updated mismatched camera and matrix transform code between textured and untextured flushes.

+18 -6
+18 -6
src/renderer_GL_common.inl
··· 5423 5423 #endif 5424 5424 } 5425 5425 5426 - static void DoUntexturedFlush(GPU_Renderer* renderer, GPU_Context* context, unsigned short num_vertices, float* blit_buffer, unsigned int num_indices, unsigned short* index_buffer) 5426 + static void DoUntexturedFlush(GPU_Renderer* renderer, GPU_Target* dest, GPU_Context* context, unsigned short num_vertices, float* blit_buffer, unsigned int num_indices, unsigned short* index_buffer) 5427 5427 { 5428 5428 GPU_CONTEXT_DATA* cdata = (GPU_CONTEXT_DATA*)context->data; 5429 5429 (void)renderer; ··· 5475 5475 // Upload our modelviewprojection matrix 5476 5476 if(context->current_shader_block.modelViewProjection_loc >= 0) 5477 5477 { 5478 + float p[16]; 5479 + float mv[16]; 5478 5480 float mvp[16]; 5479 - float cam_matrix[16]; 5480 - GPU_GetModelViewProjection(mvp); 5481 - get_camera_matrix(cam_matrix, cdata->last_camera); 5482 5481 5483 - GPU_MultiplyAndAssign(mvp, cam_matrix); 5482 + GPU_MatrixCopy(p, GPU_GetProjection()); 5483 + GPU_MatrixCopy(mv, GPU_GetModelView()); 5484 + 5485 + if(dest->use_camera) 5486 + { 5487 + float cam_matrix[16]; 5488 + get_camera_matrix(cam_matrix, cdata->last_camera); 5489 + 5490 + GPU_MultiplyAndAssign(cam_matrix, p); 5491 + GPU_MatrixCopy(p, cam_matrix); 5492 + } 5493 + 5494 + // MVP = P * MV 5495 + GPU_Multiply4x4(mvp, p, mv); 5484 5496 5485 5497 glUniformMatrix4fv(context->current_shader_block.modelViewProjection_loc, 1, 0, mvp); 5486 5498 } ··· 5579 5591 } 5580 5592 else 5581 5593 { 5582 - DoUntexturedFlush(renderer, context, cdata->blit_buffer_num_vertices, blit_buffer, cdata->index_buffer_num_vertices, index_buffer); 5594 + DoUntexturedFlush(renderer, dest, context, cdata->blit_buffer_num_vertices, blit_buffer, cdata->index_buffer_num_vertices, index_buffer); 5583 5595 } 5584 5596 5585 5597 cdata->blit_buffer_num_vertices = 0;