1
0
Fork 0
mirror of https://git.coom.tech/drummyfish/small3dlib.git synced 2024-11-21 20:39:57 +01:00

Fix teleport rendering

This commit is contained in:
Miloslav Číž 2019-06-22 21:01:50 +02:00
parent fa9794000c
commit b43e638d78

View file

@ -8,13 +8,11 @@
#include <math.h> #include <math.h>
#include <time.h> #include <time.h>
//#define S3L_PRESET_HIGHEST_QUALITY
#define S3L_FLAT 0 #define S3L_FLAT 0
#define S3L_STRICT_NEAR_CULLING 0 #define S3L_STRICT_NEAR_CULLING 0
#define S3L_PERSPECTIVE_CORRECTION 2 #define S3L_PERSPECTIVE_CORRECTION 2
#define S3L_SORT 0 #define S3L_SORT 0
#define S3L_Z_BUFFER 2 #define S3L_Z_BUFFER 1
#define S3L_PIXEL_FUNCTION drawPixel #define S3L_PIXEL_FUNCTION drawPixel
@ -183,8 +181,8 @@ void draw()
project3DPointToScreen(teleportPoint,scene.camera,&screenPoint); project3DPointToScreen(teleportPoint,scene.camera,&screenPoint);
if (screenPoint.w > 0 && if (screenPoint.w > 0 &&
screenPoint.x >= 0 && screenPoint.x <= S3L_RESOLUTION_X && screenPoint.x >= 0 && screenPoint.x < S3L_RESOLUTION_X &&
screenPoint.y >= 0 && screenPoint.y <= S3L_RESOLUTION_Y && screenPoint.y >= 0 && screenPoint.y < S3L_RESOLUTION_Y &&
screenPoint.z < S3L_zBufferRead(screenPoint.x,screenPoint.y)) screenPoint.z < S3L_zBufferRead(screenPoint.x,screenPoint.y))
drawTeleport(screenPoint.x,screenPoint.y,screenPoint.w); drawTeleport(screenPoint.x,screenPoint.y,screenPoint.w);