source: abuse/trunk/src/imlib/jrand.hpp @ 128

Last change on this file since 128 was 124, checked in by Sam Hocevar, 15 years ago
  • Get rid of ugly tabs and trailing spaces everywhere.
File size: 634 bytes
Line 
1/*
2 *  Abuse - dark 2D side-scrolling platform game
3 *  Copyright (c) 1995 Crack dot Com
4 *
5 *  This software was released into the Public Domain. As with most public
6 *  domain software, no warranty is made or implied by Crack dot Com or
7 *  Jonathan Clark.
8 */
9
10#ifndef __JRAND_HPP_
11#define __JRAND_HPP_
12
13#define RAND_TABLE_SIZE 1024
14extern unsigned short rtable[RAND_TABLE_SIZE];     // can be used directly when
15extern unsigned short rand_on;                     // speed is of essence
16
17void jrand_init();
18inline unsigned short jrand() { return rtable[(rand_on++)&(RAND_TABLE_SIZE-1)]; }
19#define jrandom(x) (jrand()%(x))
20
21#endif
22
Note: See TracBrowser for help on using the repository browser.