2
0
Branimir Karadžić 7 жил өмнө
parent
commit
3a67e19e99

+ 1 - 2
include/bx/commandline.h

@@ -10,8 +10,7 @@
 
 
 namespace bx
 namespace bx
 {
 {
-	/// Reference:
-	/// http://msdn.microsoft.com/en-us/library/a1y7w461.aspx
+	///
 	StringView tokenizeCommandLine(const StringView& _commandLine, char* _buffer, uint32_t& _bufferSize, int32_t& _argc, char* _argv[], int32_t _maxArgvs, char _term = '\0');
 	StringView tokenizeCommandLine(const StringView& _commandLine, char* _buffer, uint32_t& _bufferSize, int32_t& _argc, char* _argv[], int32_t _maxArgvs, char _term = '\0');
 
 
 	///
 	///

+ 0 - 4
include/bx/easing.h

@@ -8,10 +8,6 @@
 
 
 #include "math.h"
 #include "math.h"
 
 
-// Reference:
-// http://easings.net/
-// http://robertpenner.com/easing/
-
 namespace bx
 namespace bx
 {
 {
 	///
 	///

+ 3 - 2
include/bx/inline/bx.inl

@@ -9,8 +9,9 @@
 
 
 namespace bx
 namespace bx
 {
 {
-	// Reference:
-	// https://web.archive.org/web/20181115035420/http://cnicholson.net/2011/01/stupid-c-tricks-a-better-sizeof_array/
+	// Reference(S):
+	// - https://web.archive.org/web/20181115035420/http://cnicholson.net/2011/01/stupid-c-tricks-a-better-sizeof_array/
+	//
 	template<typename Ty, size_t Num>
 	template<typename Ty, size_t Num>
 	char(&CountOfRequireArrayArgumentT(const Ty(&)[Num]))[Num];
 	char(&CountOfRequireArrayArgumentT(const Ty(&)[Num]))[Num];
 
 

+ 4 - 0
include/bx/inline/easing.inl

@@ -7,6 +7,10 @@
 #	error "Must be included from bx/easing.h!"
 #	error "Must be included from bx/easing.h!"
 #endif // BX_EASING_H_HEADER_GUARD
 #endif // BX_EASING_H_HEADER_GUARD
 
 
+ // Reference(s):
+ // - https://web.archive.org/web/20181126040153/https://easings.net/
+ // - https://web.archive.org/web/20181126040212/http://robertpenner.com/easing/
+ //
 namespace bx
 namespace bx
 {
 {
 	template<EaseFn ease>
 	template<EaseFn ease>

+ 11 - 4
include/bx/inline/math.inl

@@ -49,8 +49,9 @@ namespace bx
 
 
 	inline BX_CONST_FUNC uint32_t floatFlip(uint32_t _value)
 	inline BX_CONST_FUNC uint32_t floatFlip(uint32_t _value)
 	{
 	{
-		// Reference:
-		// http://archive.fo/2012.12.08-212402/http://stereopsis.com/radix.html
+		// Reference(s):
+		// - http://archive.fo/2012.12.08-212402/http://stereopsis.com/radix.html
+		//
 		const uint32_t tmp0   = uint32_sra(_value, 31);
 		const uint32_t tmp0   = uint32_sra(_value, 31);
 		const uint32_t tmp1   = uint32_neg(tmp0);
 		const uint32_t tmp1   = uint32_neg(tmp0);
 		const uint32_t mask   = uint32_or(tmp1, 0x80000000);
 		const uint32_t mask   = uint32_or(tmp1, 0x80000000);
@@ -259,8 +260,9 @@ namespace bx
 
 
 	inline constexpr BX_CONST_FUNC bool equal(float _a, float _b, float _epsilon)
 	inline constexpr BX_CONST_FUNC bool equal(float _a, float _b, float _epsilon)
 	{
 	{
-		// Reference:
-		// https://web.archive.org/web/20181103180318/http://realtimecollisiondetection.net/blog/?p=89
+		// Reference(s):
+		// - https://web.archive.org/web/20181103180318/http://realtimecollisiondetection.net/blog/?p=89
+		//
 		const float lhs = abs(_a - _b);
 		const float lhs = abs(_a - _b);
 		const float rhs = _epsilon * max(1.0f, abs(_a), abs(_b) );
 		const float rhs = _epsilon * max(1.0f, abs(_a), abs(_b) );
 		return lhs <= rhs;
 		return lhs <= rhs;
@@ -305,6 +307,11 @@ namespace bx
 
 
 	inline constexpr BX_CONST_FUNC float gain(float _time, float _gain)
 	inline constexpr BX_CONST_FUNC float gain(float _time, float _gain)
 	{
 	{
+		// Reference(s):
+		// - Bias And Gain Are Your Friend
+		//   https://web.archive.org/web/20181126040535/https://blog.demofox.org/2012/09/24/bias-and-gain-are-your-friend/
+		//   https://web.archive.org/web/20181126040558/http://demofox.org/biasgain.html
+		//
 		if (_time < 0.5f)
 		if (_time < 0.5f)
 		{
 		{
 			return bias(_time * 2.0f, _gain) * 0.5f;
 			return bias(_time * 2.0f, _gain) * 0.5f;

+ 3 - 2
include/bx/inline/pixelformat.inl

@@ -707,8 +707,9 @@ namespace bx
 	template<int32_t MantissaBits, int32_t ExpBits>
 	template<int32_t MantissaBits, int32_t ExpBits>
 	inline void encodeRgbE(float* _dst, const float* _src)
 	inline void encodeRgbE(float* _dst, const float* _src)
 	{
 	{
-		// Reference:
-		// https://www.opengl.org/registry/specs/EXT/texture_shared_exponent.txt
+		// Reference(s):
+		// - https://web.archive.org/web/20181126040035/https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_texture_shared_exponent.txt
+		//
 		const int32_t expMax  = (1<<ExpBits) - 1;
 		const int32_t expMax  = (1<<ExpBits) - 1;
 		const int32_t expBias = (1<<(ExpBits - 1) ) - 1;
 		const int32_t expBias = (1<<(ExpBits - 1) ) - 1;
 		const float   sharedExpMax = float(expMax) / float(expMax + 1) * float(1 << (expMax - expBias) );
 		const float   sharedExpMax = float(expMax) / float(expMax + 1) * float(1 << (expMax - expBias) );

+ 0 - 4
include/bx/math.h

@@ -250,10 +250,6 @@ namespace bx
 	///
 	///
 	constexpr BX_CONST_FUNC float smoothStep(float _a);
 	constexpr BX_CONST_FUNC float smoothStep(float _a);
 
 
-	// References:
-	//  - Bias And Gain Are Your Friend
-	//    http://blog.demofox.org/2012/09/24/bias-and-gain-are-your-friend/
-	//  - http://demofox.org/biasgain.html
 	///
 	///
 	constexpr BX_CONST_FUNC float bias(float _time, float _bias);
 	constexpr BX_CONST_FUNC float bias(float _time, float _bias);
 
 

+ 1 - 1
src/commandline.cpp

@@ -9,7 +9,7 @@
 
 
 namespace bx
 namespace bx
 {
 {
-	// Reference:
+	// Reference(s):
 	// - https://web.archive.org/web/20180629044234/https://msdn.microsoft.com/en-us/library/a1y7w461.aspx
 	// - https://web.archive.org/web/20180629044234/https://msdn.microsoft.com/en-us/library/a1y7w461.aspx
 	//
 	//
 	StringView tokenizeCommandLine(const StringView& _commandLine, char* _buffer, uint32_t& _bufferSize, int32_t& _argc, char* _argv[], int32_t _maxArgvs, char _term)
 	StringView tokenizeCommandLine(const StringView& _commandLine, char* _buffer, uint32_t& _bufferSize, int32_t& _argc, char* _argv[], int32_t _maxArgvs, char _term)

+ 3 - 2
src/filepath.cpp

@@ -36,8 +36,9 @@ namespace bx
 
 
 	static int32_t normalizeFilePath(char* _dst, int32_t _dstSize, const char* _src, int32_t _num)
 	static int32_t normalizeFilePath(char* _dst, int32_t _dstSize, const char* _src, int32_t _num)
 	{
 	{
-		// Reference: Lexical File Names in Plan 9 or Getting Dot-Dot Right
-		// - https://web.archive.org/web/20180629044444/https://9p.io/sys/doc/lexnames.html
+		// Reference(s):
+		// - Lexical File Names in Plan 9 or Getting Dot-Dot Right
+		//   https://web.archive.org/web/20180629044444/https://9p.io/sys/doc/lexnames.html
 
 
 		const int32_t num = strLen(_src, _num);
 		const int32_t num = strLen(_src, _num);