| 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 _TYPES_H_INCLUDED |
|---|
| 11 | #define _TYPES_H_INCLUDED |
|---|
| 12 | #include "fakesse.h" |
|---|
| 13 | |
|---|
| 14 | #define BLOCK_HEIGHT 128 |
|---|
| 15 | typedef __m128i data_block[ BLOCK_HEIGHT ]; |
|---|
| 16 | |
|---|
| 17 | typedef struct life_block { |
|---|
| 18 | data_block *allocated; //this is where we free it |
|---|
| 19 | data_block *current; |
|---|
| 20 | data_block *working; |
|---|
| 21 | //' struct life_block *n, *ne, *e, *se, *s, *sw, *w, *nw; |
|---|
| 22 | } life_block, *llife_block; |
|---|
| 23 | |
|---|
| 24 | typedef struct life_world { |
|---|
| 25 | //Not all blocks are allocated, make sure you check |
|---|
| 26 | llife_block *blocks; |
|---|
| 27 | |
|---|
| 28 | int width; |
|---|
| 29 | int height; |
|---|
| 30 | |
|---|
| 31 | int origin_x; |
|---|
| 32 | int origin_y; |
|---|
| 33 | |
|---|
| 34 | } life_world, *llife_world; |
|---|
| 35 | |
|---|
| 36 | #define NEEDS_TOP 0x01 |
|---|
| 37 | #define NEEDS_TOP_RIGHT 0x02 |
|---|
| 38 | #define NEEDS_TOP_LEFT 0x04 |
|---|
| 39 | #define NEEDS_LEFT 0x08 |
|---|
| 40 | #define NEEDS_RIGHT 0x10 |
|---|
| 41 | #define NEEDS_BOTTOM 0x20 |
|---|
| 42 | #define NEEDS_BOTTOM_LEFT 0x40 |
|---|
| 43 | #define NEEDS_BOTTOM_RIGHT 0x80 |
|---|
| 44 | |
|---|
| 45 | #endif //_TYPES_H_INCLUDED |
|---|