浏览代码

Move deduplicate aspect variable in begin render.

Changes motivated by commentary in pull request 513
pull/513/head
Max Danielsson 7 年前
父节点
当前提交
6c049fdd76
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. +2
    -2
      src/core.c

+ 2
- 2
src/core.c 查看文件

@ -919,10 +919,11 @@ void Begin3dMode(Camera camera)
rlPushMatrix(); // Save previous matrix, which contains the settings for the 2d ortho projection
rlLoadIdentity(); // Reset current matrix (PROJECTION)
float aspect = (float)screenWidth/(float)screenHeight;
if(camera.type == CAMERA_PERSPECTIVE)
{
// Setup perspective projection
float aspect = (float)screenWidth/(float)screenHeight;
double top = 0.01*tan(camera.fovy*0.5*DEG2RAD);
double right = top*aspect;
@ -931,7 +932,6 @@ void Begin3dMode(Camera camera)
else if(camera.type == CAMERA_ORTHOGRAPHIC)
{
// Setup orthographic projection
float aspect = (float)screenWidth/(float)screenHeight;
double top = camera.fovy/2.0;
double right = top*aspect;

正在加载...
取消
保存