update triangle graphics ref tests with yet a few more variations

This commit is contained in:
Gered 2023-04-22 21:08:07 -04:00
parent dde2c314ae
commit b4a9b82bf8
14 changed files with 54 additions and 0 deletions

View file

@ -2319,6 +2319,33 @@ fn draw_triangles(dest: &mut IndexedBitmap, mode: TriangleType, texture: Option<
let triangles = get_quad(mode, texture, blendmap, scale * Matrix3x3::new_2d_translation(220.0, 20.0), top_left, top_right, bottom_left, bottom_right);
dest.triangle_list_2d(&triangles);
// other downscaled sizes
let scale_factor = 0.25;
let scale = Matrix3x3::new_2d_scaling(scale_factor, scale_factor);
let triangles = get_quad(mode, texture, blendmap, scale * Matrix3x3::new_2d_translation(60.0, 40.0), top_left, top_right, bottom_left, bottom_right);
dest.triangle_list_2d(&triangles);
let scale_factor = 0.3;
let scale = Matrix3x3::new_2d_scaling(scale_factor, scale_factor);
let triangles = get_quad(mode, texture, blendmap, scale * Matrix3x3::new_2d_translation(80.0, 40.0), top_left, top_right, bottom_left, bottom_right);
dest.triangle_list_2d(&triangles);
let scale_factor = 0.35;
let scale = Matrix3x3::new_2d_scaling(scale_factor, scale_factor);
let triangles = get_quad(mode, texture, blendmap, scale * Matrix3x3::new_2d_translation(100.0, 40.0), top_left, top_right, bottom_left, bottom_right);
dest.triangle_list_2d(&triangles);
let scale_factor = 0.5;
let scale = Matrix3x3::new_2d_scaling(scale_factor, scale_factor);
let triangles = get_quad(mode, texture, blendmap, scale * Matrix3x3::new_2d_translation(60.0, 60.0), top_left, top_right, bottom_left, bottom_right);
dest.triangle_list_2d(&triangles);
let scale_factor = 0.66;
let scale = Matrix3x3::new_2d_scaling(scale_factor, scale_factor);
let triangles = get_quad(mode, texture, blendmap, scale * Matrix3x3::new_2d_translation(90.0, 60.0), top_left, top_right, bottom_left, bottom_right);
dest.triangle_list_2d(&triangles);
// upscaled sizes with various rotations
// todo: my matrix math is wrong here somehow (was trying to do rotations around the center of each quad), but i
// don't care enough to fix this properly. the output of this crap is "good enough"
let mut angle = 0.0;

View file

@ -2648,6 +2648,33 @@ fn draw_triangles(dest: &mut RgbaBitmap, mode: TriangleType, texture: Option<&Rg
let triangles = get_quad(mode, texture, scale * Matrix3x3::new_2d_translation(220.0, 20.0), top_left, top_right, bottom_left, bottom_right);
dest.triangle_list_2d(&triangles);
// other downscaled sizes
let scale_factor = 0.25;
let scale = Matrix3x3::new_2d_scaling(scale_factor, scale_factor);
let triangles = get_quad(mode, texture, scale * Matrix3x3::new_2d_translation(60.0, 40.0), top_left, top_right, bottom_left, bottom_right);
dest.triangle_list_2d(&triangles);
let scale_factor = 0.3;
let scale = Matrix3x3::new_2d_scaling(scale_factor, scale_factor);
let triangles = get_quad(mode, texture, scale * Matrix3x3::new_2d_translation(80.0, 40.0), top_left, top_right, bottom_left, bottom_right);
dest.triangle_list_2d(&triangles);
let scale_factor = 0.35;
let scale = Matrix3x3::new_2d_scaling(scale_factor, scale_factor);
let triangles = get_quad(mode, texture, scale * Matrix3x3::new_2d_translation(100.0, 40.0), top_left, top_right, bottom_left, bottom_right);
dest.triangle_list_2d(&triangles);
let scale_factor = 0.5;
let scale = Matrix3x3::new_2d_scaling(scale_factor, scale_factor);
let triangles = get_quad(mode, texture, scale * Matrix3x3::new_2d_translation(60.0, 60.0), top_left, top_right, bottom_left, bottom_right);
dest.triangle_list_2d(&triangles);
let scale_factor = 0.66;
let scale = Matrix3x3::new_2d_scaling(scale_factor, scale_factor);
let triangles = get_quad(mode, texture, scale * Matrix3x3::new_2d_translation(90.0, 60.0), top_left, top_right, bottom_left, bottom_right);
dest.triangle_list_2d(&triangles);
// upscaled sizes with various rotations
// todo: my matrix math is wrong here somehow (was trying to do rotations around the center of each quad), but i
// don't care enough to fix this properly. the output of this crap is "good enough"
let mut angle = 0.0;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB