mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-01 10:32:40 +00:00
software renderer, part C
This commit is contained in:
parent
774e115df8
commit
e97ab142ff
1 changed files with 8 additions and 7 deletions
15
extern/imgui_software_renderer/imgui_sw.cpp
vendored
15
extern/imgui_software_renderer/imgui_sw.cpp
vendored
|
@ -198,16 +198,17 @@ static void paint_uniform_rectangle(const PaintTarget &target,
|
||||||
uint32_t last_output = blend(*lastColorRef, color);
|
uint32_t last_output = blend(*lastColorRef, color);
|
||||||
|
|
||||||
for (int y = min_y_i; y < max_y_i; ++y) {
|
for (int y = min_y_i; y < max_y_i; ++y) {
|
||||||
|
uint32_t* target_pixel = &target.pixels[y * target.width + min_x_i - 1];
|
||||||
for (int x = min_x_i; x < max_x_i; ++x) {
|
for (int x = min_x_i; x < max_x_i; ++x) {
|
||||||
uint32_t& target_pixel = target.pixels[y * target.width + x];
|
++target_pixel;
|
||||||
if (target_pixel == last_target_pixel) {
|
if (*target_pixel == last_target_pixel) {
|
||||||
target_pixel = last_output;
|
*target_pixel = last_output;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
last_target_pixel = target_pixel;
|
last_target_pixel = *target_pixel;
|
||||||
const ColorInt* colorRef = (const ColorInt*)(&target_pixel);
|
const ColorInt* colorRef = (const ColorInt*)(target_pixel);
|
||||||
target_pixel = blend(*colorRef, color);
|
*target_pixel = blend(*colorRef, color);
|
||||||
last_output = target_pixel;
|
last_output = *target_pixel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue