source: abuse/trunk/src/imlib/include/jrand.hpp @ 56

Last change on this file since 56 was 56, checked in by Sam Hocevar, 11 years ago
  • Add licensing terms to most C / C++ files (Ref #5).
File size: 635 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.