diff options
| author | raysan5 <[email protected]> | 2021-01-06 13:26:55 +0100 |
|---|---|---|
| committer | raysan5 <[email protected]> | 2021-01-06 13:26:55 +0100 |
| commit | 7bd33e4406adc31b0c72fd771733c24397b783b5 (patch) | |
| tree | 137b4e87341f385d90de4ae69e93b4f5027ff810 | |
| parent | 5d4aada52649e0a43ba6eb446b205a68cd0831f6 (diff) | |
| download | raylib-7bd33e4406adc31b0c72fd771733c24397b783b5.tar.gz raylib-7bd33e4406adc31b0c72fd771733c24397b783b5.zip | |
Review rlOrtho() to avoid return in the middle of the function
I usually try to avoid any return in the middle of functions, I try to keep them always at the end of the functions.
| -rw-r--r-- | src/rlgl.h | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -1100,15 +1100,12 @@ void rlFrustum(double left, double right, double bottom, double top, double znea // Multiply the current matrix by an orthographic matrix generated by parameters void rlOrtho(double left, double right, double bottom, double top, double znear, double zfar) { - if (right - left <= 0 || bottom - top <= 0) + if (((right - left) > 0) && ((bottom - top) > 0)) { - *RLGL.State.currentMatrix = MatrixIdentity(); - return; + Matrix matOrtho = MatrixOrtho(left, right, bottom, top, znear, zfar); + *RLGL.State.currentMatrix = MatrixMultiply(*RLGL.State.currentMatrix, matOrtho); } - - Matrix matOrtho = MatrixOrtho(left, right, bottom, top, znear, zfar); - - *RLGL.State.currentMatrix = MatrixMultiply(*RLGL.State.currentMatrix, matOrtho); + else *RLGL.State.currentMatrix = MatrixIdentity(); } #endif |
