[Scummvm-cvs-logs] CVS: scummvm/common util.h,1.17,1.18
Max Horn
fingolfin at users.sourceforge.net
Thu May 29 04:41:09 CEST 2003
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/common gameDetector.cpp,1.100,1.101 stdafx.h,1.4,1.5
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm gfx.h,1.31,1.32 saveload.cpp,1.80,1.81 scummvm.cpp,2.186,2.187
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1:/tmp/cvs-serv22404
Modified Files:
util.h
Log Message:
added some doxygen (javadoc style) comments. yes I sure these function probably needed documentation the least, but I just wanted something simple to test this on :-)
Index: util.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/util.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- util.h 21 May 2003 16:56:45 -0000 1.17
+++ util.h 29 May 2003 11:40:48 -0000 1.18
@@ -35,6 +35,9 @@
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#endif
+/**
+ * Template method which swaps the vaulues of its two parameters.
+ */
template<class T>
static inline void SWAP(T &a, T &b) { T tmp = a; a = b; b = tmp; }
@@ -44,11 +47,19 @@
int Blend(int src, int dst, byte *palette);
void ClearBlendCache();
-/*
- * Print hexdump of the data passed in
+/**
+ * Print a hexdump of the data passed in. The number of bytes per line
+ * is customizable.
+ * @param data the data to be dumped
+ * @param len the lenght of that data
+ * @param bytes_per_line number of bytes to print per line (default: 16)
*/
void hexdump(const byte * data, int len, int bytes_per_line = 16);
+/**
+ * A simple random number generator. Although it is definitely not suitable
+ * for cryptographic purposes, it serves our purposes just fine.
+ */
class RandomSource {
private:
uint32 _randSeed;
@@ -56,7 +67,19 @@
public:
RandomSource(uint32 seed = 0xA943DE33);
void setSeed(uint32 seed);
+
+ /**
+ * Generates a random unsigned integer in the interval [0, max].
+ * @param max the upper bound
+ * @return a random number in the interval [0, max].
+ */
uint getRandomNumber(uint max);
+ /**
+ * Generates a random unsigned integer in the interval [min, max].
+ * @param min the lower bound
+ * @param max the upper bound
+ * @return a random number in the interval [min, max].
+ */
uint getRandomNumberRng(uint min, uint max);
};
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/common gameDetector.cpp,1.100,1.101 stdafx.h,1.4,1.5
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm gfx.h,1.31,1.32 saveload.cpp,1.80,1.81 scummvm.cpp,2.186,2.187
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list