code style and minor optimization[s]

This commit is contained in:
Recep Aslantas
2018-09-22 00:10:50 +03:00
parent 280ac72fd8
commit aa2b0f2631
3 changed files with 27 additions and 44 deletions

View File

@@ -198,26 +198,15 @@ glm_ortho_aabb_pz(vec3 box[2], float padding, mat4 dest) {
*/ */
CGLM_INLINE CGLM_INLINE
void void
glm_ortho_default(float aspect, glm_ortho_default(float aspect, mat4 dest) {
mat4 dest) {
if (aspect >= 1.0f) { if (aspect >= 1.0f) {
glm_ortho(-1.0f * aspect, glm_ortho(-aspect, aspect, -1.0f, 1.0f, -100.0f, 100.0f, dest);
1.0f * aspect,
-1.0f,
1.0f,
-100.0f,
100.0f,
dest);
return; return;
} }
glm_ortho(-1.0f, aspect = 1.0f / aspect;
1.0f,
-1.0f / aspect, glm_ortho(-1.0f, 1.0f, -aspect, aspect, -100.0f, 100.0f, dest);
1.0f / aspect,
-100.0f,
100.0f,
dest);
} }
/*! /*!
@@ -291,13 +280,8 @@ glm_perspective(float fovy,
*/ */
CGLM_INLINE CGLM_INLINE
void void
glm_perspective_default(float aspect, glm_perspective_default(float aspect, mat4 dest) {
mat4 dest) { glm_perspective(GLM_PI_4f, aspect, 0.01f, 100.0f, dest);
glm_perspective(GLM_PI_4f,
aspect,
0.01f,
100.0f,
dest);
} }
/*! /*!
@@ -310,8 +294,7 @@ glm_perspective_default(float aspect,
*/ */
CGLM_INLINE CGLM_INLINE
void void
glm_perspective_resize(float aspect, glm_perspective_resize(float aspect, mat4 proj) {
mat4 proj) {
if (proj[0][0] == 0.0f) if (proj[0][0] == 0.0f)
return; return;