From ae52bce56fd104cf080e87465c54729016f41a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Sun, 2 Jun 2019 12:26:10 +0200 Subject: [PATCH] ID -> Index --- small3dlib.h | 18 +++++++++--------- testSDL.c | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/small3dlib.h b/small3dlib.h index d99e062..8e6e467 100644 --- a/small3dlib.h +++ b/small3dlib.h @@ -478,8 +478,8 @@ typedef struct triangle and interpolate values between it's three points. The sum of the three coordinates will always be exactly S3L_FRACTIONS_PER_UNIT. */ - S3L_Index triangleID; ///< Triangle index. - S3L_Index modelID; + S3L_Index triangleIndex; ///< Triangle index. + S3L_Index modelIndex; S3L_Unit depth; ///< Depth (only if depth is turned on). S3L_ScreenCoord triangleSize[2]; /**< Rasterized triangle width and height, can be used e.g. for MIP mapping. */ @@ -554,8 +554,8 @@ void S3L_drawTriangle( S3L_Vec4 point2, const S3L_DrawConfig *config, const S3L_Camera *camera, - S3L_Index modelID, - S3L_Index triangleID); + S3L_Index modelIndex, + S3L_Index triangleIndex); /** This should be called before rendering each frame. The function clears buffers and does potentially other things needed for the frame. */ @@ -1049,7 +1049,7 @@ void S3L_initPixelInfo(S3L_PixelInfo *p) // TODO: maybe non-pointer for p p->barycentric[0] = S3L_FRACTIONS_PER_UNIT; p->barycentric[1] = 0; p->barycentric[2] = 0; - p->triangleID = 0; + p->triangleIndex = 0; p->depth = 0; } @@ -1204,13 +1204,13 @@ void S3L_drawTriangle( S3L_Vec4 point2, const S3L_DrawConfig *config, const S3L_Camera *camera, - S3L_Index modelID, - S3L_Index triangleID) + S3L_Index modelIndex, + S3L_Index triangleIndex) { S3L_PixelInfo p; S3L_initPixelInfo(&p); - p.modelID = modelID; - p.triangleID = triangleID; + p.modelIndex = modelIndex; + p.triangleIndex = triangleIndex; #if !S3L_STRICT_NEAR_CULLING point0.z = point0.z >= S3L_NEAR ? point0.z : S3L_NEAR; diff --git a/testSDL.c b/testSDL.c index 0c4b188..6aa27fa 100644 --- a/testSDL.c +++ b/testSDL.c @@ -137,11 +137,11 @@ void drawPixel(S3L_PixelInfo *p) S3L_Unit u, v; const S3L_Unit *coords; - coords = tex_coords + p->triangleID * 6; + coords = tex_coords + p->triangleIndex * 6; -if (p->modelID != 0) +if (p->modelIndex != 0) { - int tmp = p->triangleID * 3; + int tmp = p->triangleIndex * 3; int i0 = houseUVIndices[tmp]; int i1 = houseUVIndices[tmp + 1];