Skip to content

Commit

Permalink
Change a few things to references
Browse files Browse the repository at this point in the history
  • Loading branch information
tobbi committed Oct 8, 2023
1 parent 90b4c1c commit 2a43b02
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/video/gl/gl_painter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ GLPainter::draw_texture(const TextureRequest& request)

for (size_t i = 0; i < request.srcrects.size(); ++i)
{
const float left = request.dstrects[i].get_left();
const float top = request.dstrects[i].get_top();
const float right = request.dstrects[i].get_right();
const float bottom = request.dstrects[i].get_bottom();
const float& left = request.dstrects[i].get_left();
const float& top = request.dstrects[i].get_top();
const float& right = request.dstrects[i].get_right();
const float& bottom = request.dstrects[i].get_bottom();

float uv_left = request.srcrects[i].get_left() / static_cast<float>(texture.get_texture_width());
float uv_top = request.srcrects[i].get_top() / static_cast<float>(texture.get_texture_height());
Expand Down Expand Up @@ -291,10 +291,10 @@ GLPainter::draw_filled_rect(const FillRectRequest& request)
}
else
{
const float x = request.rect.get_left();
const float y = request.rect.get_top();
const float w = request.rect.get_width();
const float h = request.rect.get_height();
const float& x = request.rect.get_left();
const float& y = request.rect.get_top();
const float& w = request.rect.get_width();
const float& h = request.rect.get_height();

const float vertices[] = {
x, y,
Expand All @@ -316,8 +316,8 @@ GLPainter::draw_inverse_ellipse(const InverseEllipseRequest& request)
{
assert_gl();

const float x = request.pos.x;
const float y = request.pos.y;
const float& x = request.pos.x;
const float& y = request.pos.y;
const float w = request.size.x/2.0f;
const float h = request.size.y/2.0f;

Expand Down Expand Up @@ -399,10 +399,10 @@ GLPainter::draw_line(const LineRequest& request)
assert_gl();

Vector viewport_scale = m_video_system.get_viewport().get_scale();
const float x1 = request.pos.x;
const float y1 = request.pos.y;
const float x2 = request.dest_pos.x;
const float y2 = request.dest_pos.y;
const float& x1 = request.pos.x;
const float& y1 = request.pos.y;
const float& x2 = request.dest_pos.x;
const float& y2 = request.dest_pos.y;

// OpenGL3.3 doesn't have GL_LINES anymore, so instead we transform
// the line into a quad and draw it as triangle strip.
Expand Down

0 comments on commit 2a43b02

Please sign in to comment.