diff options
author | vimene <vincent.menegaux@gmail.com> | 2023-11-23 05:57:39 +0100 |
---|---|---|
committer | vimene <vincent.menegaux@gmail.com> | 2023-11-23 05:57:39 +0100 |
commit | 918e9c083b36acdfc3c61d86e5b54cd118caa591 (patch) | |
tree | f27e5fe294f0d0e7a90aa94d4835315486499209 /src/fb | |
parent | 6570a75b1d75f0c3b5a7307096efffb4f973e856 (diff) | |
download | engine-918e9c083b36acdfc3c61d86e5b54cd118caa591.tar.gz |
add options to choose render mode
Diffstat (limited to 'src/fb')
-rw-r--r-- | src/fb/chfb.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/fb/chfb.cpp b/src/fb/chfb.cpp index 7ac1626..e2355df 100644 --- a/src/fb/chfb.cpp +++ b/src/fb/chfb.cpp @@ -126,7 +126,11 @@ void CharacterFrameBuffer::_draw_cropped_triangle(TriangleVertex3 triangle) { void CharacterFrameBuffer::draw_triangle(TriangleVertex4 triangle) { face_ind++; for (auto t1 : triangle.crop_z_out(-1.f, 1.f)) { - for (auto t2 : t1.div_by_w().crop_xy_out(-1.f, 1.f, -1.f, 1.f)) { + auto t1_2 = t1.div_by_w(); + t1_2.vertex1.point.x *= 2.f; + t1_2.vertex2.point.x *= 2.f; + t1_2.vertex3.point.x *= 2.f; + for (auto t2 : t1_2.crop_xy_out(-1.f, 1.f, -1.f, 1.f)) { MathVector2 pp1 = t2.vertex1.point.xy(), pp2 = t2.vertex2.point.xy(), pp3 = t2.vertex3.point.xy(); |