source: abuse/trunk/src/imlib/jrand.h @ 494

Last change on this file since 494 was 494, checked in by Sam Hocevar, 12 years ago

style: remove trailing spaces, fix copyright statements.

  • Property svn:keywords set to Id
File size: 692 bytes
Line 
1/*
2 *  Abuse - dark 2D side-scrolling platform game
3 *  Copyright (c) 1995 Crack dot Com
4 *  Copyright (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
5 *
6 *  This software was released into the Public Domain. As with most public
7 *  domain software, no warranty is made or implied by Crack dot Com or
8 *  Jonathan Clark.
9 */
10
11#ifndef __JRAND_HPP_
12#define __JRAND_HPP_
13
14#define RAND_TABLE_SIZE 1024
15extern unsigned short rtable[RAND_TABLE_SIZE];     // can be used directly when
16extern unsigned short rand_on;                     // speed is of essence
17
18void jrand_init();
19inline unsigned short jrand() { return rtable[(rand_on++)&(RAND_TABLE_SIZE-1)]; }
20#define jrandom(x) (jrand()%(x))
21
22#endif
23
Note: See TracBrowser for help on using the repository browser.