| 1 | /* |
|---|
| 2 | * Copyright (C) 2007 Michael Lewis |
|---|
| 3 | * Author: Mike Lewis <mikelikespie@gmail.com> |
|---|
| 4 | * |
|---|
| 5 | * This work is provide AS IS, and has no warranty. |
|---|
| 6 | * The author is NOT responsible for anything that happens |
|---|
| 7 | * due to use of this code, either using it or running it on |
|---|
| 8 | * your system |
|---|
| 9 | */ |
|---|
| 10 | #ifndef _BLOCK_H_INCLUDED |
|---|
| 11 | #define _BLOCK_H_INCLUDED |
|---|
| 12 | void cycle_block( llife_block block, |
|---|
| 13 | llife_block tl, llife_block t, llife_block tr, |
|---|
| 14 | llife_block l, llife_block r, |
|---|
| 15 | llife_block bl, llife_block b, llife_block br ); |
|---|
| 16 | |
|---|
| 17 | static inline llife_block get_life_block( llife_world world, int row, int column ) { |
|---|
| 18 | return world->blocks[ (row*world->width + column) ]; |
|---|
| 19 | } |
|---|
| 20 | |
|---|
| 21 | llife_world allocate_world( int height, int width ); |
|---|
| 22 | void free_world( llife_world world ); |
|---|
| 23 | |
|---|
| 24 | void worldCycle( llife_world world ); |
|---|
| 25 | |
|---|
| 26 | //returns NULL if fail; |
|---|
| 27 | life_block *allocate_block(); |
|---|
| 28 | |
|---|
| 29 | void free_block( life_block *block ); |
|---|
| 30 | |
|---|
| 31 | void set_bit_in_world( llife_world world, int row, int column ); |
|---|
| 32 | #endif //_BLOCK_H_INCLUDED |
|---|