Hm.. interesting mutation hint
(rSeed>>16)&0x7FFF
can You explain this?
About licensing :) I do understand it as a REDDemon's joke, don't You..
And ofcourse LCG haven't be more quality rng than xorshift (see wiki).
May be faster. May be.. But too simple for some applications, you know it.
Well as ...
Search found 27 matches
- Mon Mar 28, 2011 12:31 am
- Forum: Code Snippets
- Topic: My randomizer faster than yours :)
- Replies: 14
- Views: 5803
- Thu Mar 24, 2011 1:26 pm
- Forum: Code Snippets
- Topic: My randomizer faster than yours :)
- Replies: 14
- Views: 5803
- Thu Mar 24, 2011 5:15 am
- Forum: Code Snippets
- Topic: My randomizer faster than yours :)
- Replies: 14
- Views: 5803
:\
O'k people thanks for preaching. Just show your faster code.
- Thu Mar 24, 2011 1:08 am
- Forum: Code Snippets
- Topic: My randomizer faster than yours :)
- Replies: 14
- Views: 5803
Well
randomMesh wrote:
Nothing. But if I wrong. Show us Your wonderful fast code. I take my words back then and sorry.Make it const-correct and it would be even faster!
- Wed Mar 23, 2011 9:13 pm
- Forum: Code Snippets
- Topic: My randomizer faster than yours :)
- Replies: 14
- Views: 5803
My randomizer faster than yours :)
Hi, friends!
The subject is:
//!========XORSHIFT RANDOMIZER========
//! A class using George Marsaglia's "Xorshift-128" algorithm.
//! Provides very fast and quality sequence
//! of 2^{128}-1 32-bit random numbers.
class htRandomizer
{
unsigned long seed,x,y,z,w;
public:
htRandomizer ...
The subject is:
//!========XORSHIFT RANDOMIZER========
//! A class using George Marsaglia's "Xorshift-128" algorithm.
//! Provides very fast and quality sequence
//! of 2^{128}-1 32-bit random numbers.
class htRandomizer
{
unsigned long seed,x,y,z,w;
public:
htRandomizer ...
- Tue Mar 22, 2011 2:33 pm
- Forum: Code Snippets
- Topic: Usefull tiny snippet
- Replies: 5
- Views: 2139
Special drops
We can use this:
#define SAFE_DELETE(x) {if(x) delete(x),x=NULL;}
#define IRR_SAFE_REMOVE(x) {if(x) while(!x->remove());x=NULL;}
#define IRR_SAFE_DROP(x) {if(x->drop()) x=NULL;}
/// Special drops:
/// As we can see drop() method just delete an object when ref. counter is 0.
/// But this method DO ...
#define SAFE_DELETE(x) {if(x) delete(x),x=NULL;}
#define IRR_SAFE_REMOVE(x) {if(x) while(!x->remove());x=NULL;}
#define IRR_SAFE_DROP(x) {if(x->drop()) x=NULL;}
/// Special drops:
/// As we can see drop() method just delete an object when ref. counter is 0.
/// But this method DO ...
- Sun Nov 21, 2010 12:06 am
- Forum: Code Snippets
- Topic: Simulation of videosignal lost.
- Replies: 10
- Views: 3515
- Sat Nov 20, 2010 1:22 am
- Forum: Code Snippets
- Topic: Simulation of videosignal lost.
- Replies: 10
- Views: 3515
Simulation of videosignal lost.
Hi, friends! Here it is:
//! Simulation of videosignal lost. Call this fun. inside main loop.
//! Returns true if videosignal from camera is 'lost'.
//! NOTE: MUST NOT use if() before itself
//! or after 'if(smth) emulCamDamage()' use:
//! '..else device->getSceneManager()->getRootSceneNode ...
//! Simulation of videosignal lost. Call this fun. inside main loop.
//! Returns true if videosignal from camera is 'lost'.
//! NOTE: MUST NOT use if() before itself
//! or after 'if(smth) emulCamDamage()' use:
//! '..else device->getSceneManager()->getRootSceneNode ...
- Wed Nov 17, 2010 5:39 pm
- Forum: Code Snippets
- Topic: Killing reference counted objects
- Replies: 31
- Views: 11296
- Wed Nov 17, 2010 4:28 am
- Forum: Code Snippets
- Topic: Killing reference counted objects
- Replies: 31
- Views: 11296
- Wed Nov 17, 2010 2:54 am
- Forum: Code Snippets
- Topic: Killing reference counted objects
- Replies: 31
- Views: 11296
- Wed Nov 17, 2010 1:24 am
- Forum: Code Snippets
- Topic: Killing reference counted objects
- Replies: 31
- Views: 11296
- Tue Nov 16, 2010 11:58 pm
- Forum: Code Snippets
- Topic: Killing reference counted objects
- Replies: 31
- Views: 11296
- Tue Nov 16, 2010 11:01 pm
- Forum: Code Snippets
- Topic: Killing reference counted objects
- Replies: 31
- Views: 11296
Killing reference counted objects
//! As you can see this code will fail:
SomeType* obj->createSomeObj(); //! It mean 'new' or 'smgr->add' etc..
obj->delete();
if(obj) obj->doSmth()...
You can remove() of course instead delete and it's correct, then add obj=0;
That code will not fails but...
If our object have ...
SomeType* obj->createSomeObj(); //! It mean 'new' or 'smgr->add' etc..
obj->delete();
if(obj) obj->doSmth()...
You can remove() of course instead delete and it's correct, then add obj=0;
That code will not fails but...
If our object have ...
- Mon Nov 15, 2010 7:11 pm
- Forum: Code Snippets
- Topic: Terrain pager
- Replies: 24
- Views: 22167
Safe deletion of node.
Hi friends!
UPDATE: Note, this does fix the CRASH problem!
/*delete zoneList[i]->getObjectInside();
If we just comment this line we'll have memory overhead.
Pager MUST delete unused node (why pager is exist ?)
See the decision:
void CTerrainPager::loadTerrain(u16 index)
{
CTerrain ...
UPDATE: Note, this does fix the CRASH problem!
/*delete zoneList[i]->getObjectInside();
If we just comment this line we'll have memory overhead.
Pager MUST delete unused node (why pager is exist ?)
See the decision:
void CTerrainPager::loadTerrain(u16 index)
{
CTerrain ...