Skip to content

Commit

Permalink
fix rsoft compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
ColleagueRiley committed Dec 9, 2024
1 parent 42c1b57 commit 8396398
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions examples/advanced/RSoft.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,12 @@ RSOFTDEF void RSoft_drawLineF(u8* buffer, RSoft_vector start, RSoft_vector end,
#endif /* RSOFT_HEADER */

#ifdef __x86_64__
#ifdef RSOFT_IMPLEMENTATION
#define RSOFT_X86
#include <xmmintrin.h>
#include <x86intrin.h>
#endif

#ifdef RSOFT_IMPLEMENTATION
typedef struct RSoft_renderInfoStruct {
RSoft_area bufferSize;
RSoft_area canvasSize;
Expand Down Expand Up @@ -508,8 +508,8 @@ void RSoft_drawPolygonF(u8* buffer, RSoft_rectF r, size_t angles, u8 color[4]) {
//RSoft_point texPoint = RSOFT_POINT(abs((p1.x - (r.x - rect.w))), abs((p2.y - (r.y - rect.h))));


u32 texColor = RSoft_textureGetColor(RSOFT_POINT(abs((p1.x - (r.x - (rect.w / 2)))),
abs((p1.y - (r.y - (rect.h / 4))))), color);
u32 texColor = RSoft_textureGetColor(RSOFT_POINT(fabs((p1.x - (r.x - (rect.w / 2)))),
fabs((p1.y - (r.y - (rect.h / 4))))), color);

//u32 texColor = RSoft_textureGetColor(texPoint, info.texRect, info.texture, info.textureArea, color);
RSoft_drawLineF(buffer, p1, p2, (u8*)&texColor);
Expand Down Expand Up @@ -665,15 +665,15 @@ void RSoft_drawTriangleF(u8* buffer, const RSoft_vector points[3], u8 color[4])

for (float i = 0; i < steps; i++) {
//RSoft_drawTriangleOutlineF(buffer, nPoints, color);
u32 texColor = RSoft_textureGetColor(RSOFT_POINT(abs(nPoints[1].x - nPoints[0].x), abs(nPoints[1].y - nPoints[0].y)), color);
u32 texColor = RSoft_textureGetColor(RSOFT_POINT(fabs(nPoints[1].x - nPoints[0].x), fabs(nPoints[1].y - nPoints[0].y)), color);
RSoft_drawLineF(buffer, nPoints[0], nPoints[1], (u8*)&texColor);

texColor = RSoft_textureGetColor(RSOFT_POINT(abs(nPoints[1].x - nPoints[2].x) + slopeX[0],
abs(nPoints[2].y - nPoints[1].y) + slopeY[0]), color);
texColor = RSoft_textureGetColor(RSOFT_POINT(fabs(nPoints[1].x - nPoints[2].x) + slopeX[0],
fabs(nPoints[2].y - nPoints[1].y) + slopeY[0]), color);
RSoft_drawLineF(buffer, nPoints[1], nPoints[2], (u8*)&texColor);

texColor = RSoft_textureGetColor(RSOFT_POINT(abs(nPoints[2].x - nPoints[0].x) + slopeX[1],
abs(nPoints[2].y - nPoints[0].y) + slopeY[1]), color);
texColor = RSoft_textureGetColor(RSOFT_POINT(fabs(nPoints[2].x - nPoints[0].x) + slopeX[1],
fabs(nPoints[2].y - nPoints[0].y) + slopeY[1]), color);
RSoft_drawLineF(buffer, nPoints[2], nPoints[0], (u8*)&texColor);
for (size_t j = 0; j < 3; j++) {
nPoints[j].x -= slopeX[j];
Expand Down

0 comments on commit 8396398

Please sign in to comment.