Move deduplicate aspect variable in begin render.
Changes motivated by commentary in pull request 513
This commit is contained in:
parent
e38d28543a
commit
6c049fdd76
@ -919,10 +919,11 @@ void Begin3dMode(Camera camera)
|
|||||||
rlPushMatrix(); // Save previous matrix, which contains the settings for the 2d ortho projection
|
rlPushMatrix(); // Save previous matrix, which contains the settings for the 2d ortho projection
|
||||||
rlLoadIdentity(); // Reset current matrix (PROJECTION)
|
rlLoadIdentity(); // Reset current matrix (PROJECTION)
|
||||||
|
|
||||||
|
float aspect = (float)screenWidth/(float)screenHeight;
|
||||||
|
|
||||||
if(camera.type == CAMERA_PERSPECTIVE)
|
if(camera.type == CAMERA_PERSPECTIVE)
|
||||||
{
|
{
|
||||||
// Setup perspective projection
|
// Setup perspective projection
|
||||||
float aspect = (float)screenWidth/(float)screenHeight;
|
|
||||||
double top = 0.01*tan(camera.fovy*0.5*DEG2RAD);
|
double top = 0.01*tan(camera.fovy*0.5*DEG2RAD);
|
||||||
double right = top*aspect;
|
double right = top*aspect;
|
||||||
|
|
||||||
@ -931,7 +932,6 @@ void Begin3dMode(Camera camera)
|
|||||||
else if(camera.type == CAMERA_ORTHOGRAPHIC)
|
else if(camera.type == CAMERA_ORTHOGRAPHIC)
|
||||||
{
|
{
|
||||||
// Setup orthographic projection
|
// Setup orthographic projection
|
||||||
float aspect = (float)screenWidth/(float)screenHeight;
|
|
||||||
double top = camera.fovy/2.0;
|
double top = camera.fovy/2.0;
|
||||||
double right = top*aspect;
|
double right = top*aspect;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user