aboutsummaryrefslogtreecommitdiff
path: root/sp/src/public/bitmap/cubemap.h
diff options
context:
space:
mode:
authorJørgen P. Tjernø <[email protected]>2013-12-02 19:31:46 -0800
committerJørgen P. Tjernø <[email protected]>2013-12-02 19:46:31 -0800
commitf56bb35301836e56582a575a75864392a0177875 (patch)
treede61ddd39de3e7df52759711950b4c288592f0dc /sp/src/public/bitmap/cubemap.h
parentMark some more files as text. (diff)
downloadsource-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz
source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip
Fix line endings. WHAMMY.
Diffstat (limited to 'sp/src/public/bitmap/cubemap.h')
-rw-r--r--sp/src/public/bitmap/cubemap.h136
1 files changed, 68 insertions, 68 deletions
diff --git a/sp/src/public/bitmap/cubemap.h b/sp/src/public/bitmap/cubemap.h
index 7e95a391..1bda06f3 100644
--- a/sp/src/public/bitmap/cubemap.h
+++ b/sp/src/public/bitmap/cubemap.h
@@ -1,68 +1,68 @@
-//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose: a class for performing cube-mapped spherical sample lookups.
-//
-// $Workfile: $
-// $Date: $
-// $NoKeywords: $
-//===========================================================================//
-
-#ifndef CUBEMAP_H
-#define CUBEMAP_H
-
-#ifdef _WIN32
-#pragma once
-#endif
-
-#include "tier0/platform.h"
-#include "tier1/utlmemory.h"
-#include "mathlib/mathlib.h"
-
-template<class T, int RES> struct CCubeMap
-{
- T m_Samples[6][RES][RES];
-
-public:
- FORCEINLINE void GetCoords( Vector const &vecNormalizedDirection, int &nX, int &nY, int &nFace )
- {
- // find largest magnitude component
- int nLargest = 0;
- int nAxis0 = 1;
- int nAxis1 = 2;
- if ( fabs( vecNormalizedDirection[1] ) > fabs( vecNormalizedDirection[0] ) )
- {
- nLargest = 1;
- nAxis0 = 0;
- nAxis1 = 2;
- }
- if ( fabs( vecNormalizedDirection[2] ) > fabs( vecNormalizedDirection[nLargest] ) )
- {
- nLargest = 2;
- nAxis0 = 0;
- nAxis1 = 1;
- }
- float flZ = vecNormalizedDirection[nLargest];
- if ( flZ < 0 )
- {
- flZ = - flZ;
- nLargest += 3;
- }
- nFace = nLargest;
- flZ = 1.0 / flZ;
- nX = RemapValClamped( vecNormalizedDirection[nAxis0] * flZ, -1, 1, 0, RES - 1 );
- nY = RemapValClamped( vecNormalizedDirection[nAxis1] * flZ, -1, 1, 0, RES - 1 );
- }
-
- FORCEINLINE T & GetSample( Vector const &vecNormalizedDirection )
- {
- int nX, nY, nFace;
- GetCoords( vecNormalizedDirection, nX, nY, nFace );
- return m_Samples[nFace][nX][nY];
- }
-};
-
-
-
-
-
-#endif // CUBEMAP_H
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: a class for performing cube-mapped spherical sample lookups.
+//
+// $Workfile: $
+// $Date: $
+// $NoKeywords: $
+//===========================================================================//
+
+#ifndef CUBEMAP_H
+#define CUBEMAP_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "tier0/platform.h"
+#include "tier1/utlmemory.h"
+#include "mathlib/mathlib.h"
+
+template<class T, int RES> struct CCubeMap
+{
+ T m_Samples[6][RES][RES];
+
+public:
+ FORCEINLINE void GetCoords( Vector const &vecNormalizedDirection, int &nX, int &nY, int &nFace )
+ {
+ // find largest magnitude component
+ int nLargest = 0;
+ int nAxis0 = 1;
+ int nAxis1 = 2;
+ if ( fabs( vecNormalizedDirection[1] ) > fabs( vecNormalizedDirection[0] ) )
+ {
+ nLargest = 1;
+ nAxis0 = 0;
+ nAxis1 = 2;
+ }
+ if ( fabs( vecNormalizedDirection[2] ) > fabs( vecNormalizedDirection[nLargest] ) )
+ {
+ nLargest = 2;
+ nAxis0 = 0;
+ nAxis1 = 1;
+ }
+ float flZ = vecNormalizedDirection[nLargest];
+ if ( flZ < 0 )
+ {
+ flZ = - flZ;
+ nLargest += 3;
+ }
+ nFace = nLargest;
+ flZ = 1.0 / flZ;
+ nX = RemapValClamped( vecNormalizedDirection[nAxis0] * flZ, -1, 1, 0, RES - 1 );
+ nY = RemapValClamped( vecNormalizedDirection[nAxis1] * flZ, -1, 1, 0, RES - 1 );
+ }
+
+ FORCEINLINE T & GetSample( Vector const &vecNormalizedDirection )
+ {
+ int nX, nY, nFace;
+ GetCoords( vecNormalizedDirection, nX, nY, nFace );
+ return m_Samples[nFace][nX][nY];
+ }
+};
+
+
+
+
+
+#endif // CUBEMAP_H