this repo has no description
0
fork

Configure Feed

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

Fixed new implementation of thick rectangle rendering.

+29 -27
+29 -27
SDL_gpu/GL_common/SDL_gpuShapes_GL_common.inl
··· 621 621 622 622 { 623 623 float thickness = GetLineThickness(renderer); 624 - 625 - float t = thickness / 2; 626 - float inner_t_x = t; 627 - float inner_t_y = t; 624 + 625 + // Thickness offsets 626 + float outer = thickness / 2; 627 + float inner_x = outer; 628 + float inner_y = outer; 628 629 629 630 // Thick lines via filled triangles 630 631 631 - BEGIN_UNTEXTURED("GPU_Rectangle", GL_TRIANGLES, 10, 24); 632 + BEGIN_UNTEXTURED("GPU_Rectangle", GL_TRIANGLES, 12, 24); 632 633 633 - if(x1 + inner_t_x > x2 - inner_t_x) 634 - inner_t_x = (x2 - x1)/2; 635 - if(y1 + inner_t_y > y2 - inner_t_y) 636 - inner_t_y = (y2 - y1)/2; 634 + // Adjust inner thickness offsets to avoid overdraw on narrow/small rects 635 + if(x1 + inner_x > x2 - inner_x) 636 + inner_x = (x2 - x1)/2; 637 + if(y1 + inner_y > y2 - inner_y) 638 + inner_y = (y2 - y1)/2; 637 639 638 640 // First triangle 639 - SET_UNTEXTURED_VERTEX(x1 - t, y1 - t, r, g, b, a); 640 - SET_UNTEXTURED_VERTEX(x1 + inner_t_x, y1 + inner_t_y, r, g, b, a); 641 - SET_UNTEXTURED_VERTEX(x2 + t, y1 - t, r, g, b, a); 641 + SET_UNTEXTURED_VERTEX(x1 - outer, y1 - outer, r, g, b, a); // 0 642 + SET_UNTEXTURED_VERTEX(x1 - outer, y1 + inner_y, r, g, b, a); // 1 643 + SET_UNTEXTURED_VERTEX(x2 + outer, y1 - outer, r, g, b, a); // 2 642 644 643 - SET_INDEXED_VERTEX(1); 644 645 SET_INDEXED_VERTEX(2); 645 - SET_UNTEXTURED_VERTEX(x2 - inner_t_x, y1 + inner_t_y, r, g, b, a); 646 + SET_INDEXED_VERTEX(1); 647 + SET_UNTEXTURED_VERTEX(x2 + outer, y1 + inner_y, r, g, b, a); // 3 646 648 647 - SET_INDEXED_VERTEX(2); 648 649 SET_INDEXED_VERTEX(3); 649 - SET_UNTEXTURED_VERTEX(x2 + t, y2 + t, r, g, b, a); 650 + SET_UNTEXTURED_VERTEX(x2 - inner_x, y1 + inner_y, r, g, b, a); // 4 651 + SET_UNTEXTURED_VERTEX(x2 - inner_x, y2 - inner_y, r, g, b, a); // 5 650 652 651 653 SET_INDEXED_VERTEX(3); 652 - SET_INDEXED_VERTEX(4); 653 - SET_UNTEXTURED_VERTEX(x2 - inner_t_x, y2 - inner_t_y, r, g, b, a); 654 - 655 - SET_INDEXED_VERTEX(4); 656 654 SET_INDEXED_VERTEX(5); 657 - SET_UNTEXTURED_VERTEX(x1 - t, y2 + t, r, g, b, a); 655 + SET_UNTEXTURED_VERTEX(x2 + outer, y2 - inner_y, r, g, b, a); // 6 658 656 659 - SET_INDEXED_VERTEX(5); 660 657 SET_INDEXED_VERTEX(6); 661 - SET_UNTEXTURED_VERTEX(x1 + inner_t_x, y2 - inner_t_y, r, g, b, a); 658 + SET_UNTEXTURED_VERTEX(x1 - outer, y2 - inner_y, r, g, b, a); // 7 659 + SET_UNTEXTURED_VERTEX(x2 + outer, y2 + outer, r, g, b, a); // 8 662 660 663 - SET_INDEXED_VERTEX(6); 664 661 SET_INDEXED_VERTEX(7); 665 - SET_UNTEXTURED_VERTEX(x1 - t, y1 - t, r, g, b, a); 662 + SET_UNTEXTURED_VERTEX(x1 - outer, y2 + outer, r, g, b, a); // 9 663 + SET_INDEXED_VERTEX(8); 666 664 667 665 SET_INDEXED_VERTEX(7); 668 - SET_INDEXED_VERTEX(8); 669 - SET_UNTEXTURED_VERTEX(x1 + inner_t_x, y1 + inner_t_y, r, g, b, a); 666 + SET_UNTEXTURED_VERTEX(x1 + inner_x, y2 - inner_y, r, g, b, a); // 10 667 + SET_INDEXED_VERTEX(1); 668 + 669 + SET_INDEXED_VERTEX(1); 670 + SET_INDEXED_VERTEX(10); 671 + SET_UNTEXTURED_VERTEX(x1 + inner_x, y1 + inner_y, r, g, b, a); // 11 670 672 } 671 673 } 672 674