Commit 7d50c0e6 authored by Tim Übelhör's avatar Tim Übelhör

fixed pointer arithmetics type

parent 76c00799
......@@ -67,7 +67,9 @@ Rasterizer::ImageHeader Rasterizer::get_view_image(
auto xy = view_xy(row, column);
// all the rows above and the columns in front
ImageHeader header;
header.data = data + (xy.second * texture_width + xy.first) * pixel_size;
// pixel size is in bytes so do arithmetics in bytes
header.data = static_cast<uint8_t*>(data) +
(xy.second * texture_width + xy.first) * pixel_size;
header.columns = width;
header.rows = height;
header.step = texture_width * pixel_size;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment