From b5b6219cb7602b1d1a542df99ff8e7f5280a4479 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 19 Oct 2017 22:02:00 -0400 Subject: [PATCH] Slightly simplifies TextureBuilder arithmetic. --- Outputs/CRT/Internals/TextureBuilder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Outputs/CRT/Internals/TextureBuilder.cpp b/Outputs/CRT/Internals/TextureBuilder.cpp index 9e5d5003f..101c81a33 100644 --- a/Outputs/CRT/Internals/TextureBuilder.cpp +++ b/Outputs/CRT/Internals/TextureBuilder.cpp @@ -72,7 +72,7 @@ uint8_t *TextureBuilder::allocate_write_area(size_t required_length, size_t requ size_t alignment_offset = (required_alignment - ((write_areas_start_x_ + 1) % required_alignment)) % required_alignment; if(write_areas_start_x_ + required_length + 2 + alignment_offset > InputBufferBuilderWidth) { write_areas_start_x_ = 0; - alignment_offset = (required_alignment - 1) % required_alignment; + alignment_offset = required_alignment - 1; write_areas_start_y_ = (write_areas_start_y_ + 1) % InputBufferBuilderHeight; if(write_areas_start_y_ == first_unsubmitted_y_) {