diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-12-05 08:44:55 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-12-05 08:44:55 -0600 |
commit | d2b407f9f9272b8f7dbc97c494d11f2468157363 (patch) | |
tree | ba1c4b3164a826bb440266d48b82031b9c0f4d5c /apps/graphics/traveler/include/trv_bitmaps.h | |
parent | 86e5c3a5b0792e9234f98e4aeb1c0721b56352b2 (diff) | |
download | nuttx-d2b407f9f9272b8f7dbc97c494d11f2468157363.tar.gz nuttx-d2b407f9f9272b8f7dbc97c494d11f2468157363.tar.bz2 nuttx-d2b407f9f9272b8f7dbc97c494d11f2468157363.zip |
Add first of several ray cast/rendering files
Diffstat (limited to 'apps/graphics/traveler/include/trv_bitmaps.h')
-rw-r--r-- | apps/graphics/traveler/include/trv_bitmaps.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/apps/graphics/traveler/include/trv_bitmaps.h b/apps/graphics/traveler/include/trv_bitmaps.h index 2bd3cb0b6..71ecc25ce 100644 --- a/apps/graphics/traveler/include/trv_bitmaps.h +++ b/apps/graphics/traveler/include/trv_bitmaps.h @@ -47,10 +47,54 @@ * Pre-processor Definitions ****************************************************************************/ +#define BITMAP_WIDTH 64 +#define BITMAP_HEIGHT 64 +#define BITMAP_LOG2H 6 +#define BITMAP_SIZE (BITMAP_WIDTH * BITMAP_HEIGHT) +#define BITMAP_IMASK (BITMAP_HEIGHT-1) +#define BITMAP_JMASK (BITMAP_WIDTH-1) +#define BITMAP_JSHIFT 6 +#define BMICLIP(i) ((i) & BITMAP_IMASK) +#define BMJCLIP(i) ((i) & BITMAP_JMASK) +#define BMOFFSET(i,j) (((i) << BITMAP_JSHIFT) | (j)) +#define MAX_BITMAPS 256 + /**************************************************************************** * Public Types ****************************************************************************/ +struct trv_bitmap_s +{ + uint16_t w; + uint16_t h; + uint8_t log2h; + FAR trv_pixel_t *bm; +}; + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* These point to the (allocated) bit map buffers for the even and odd + * bitmaps + */ + +extern struct trv_bitmap_s *g_even_bitmaps[MAX_BITMAPS]; +#ifndef WEDIT +extern struct trv_bitmap_s *g_odd_bitmaps[MAX_BITMAPS]; +#endif + +/* This is the maximum value + 1 of a texture code */ + +extern uint16_t g_trv_nbitmaps; + +/* These are the colors from the worldPalette which should used to rend + * the sky and ground + */ + +extern trv_pixel_t g_sky_color; +extern trv_pixel_t g_ground_color; + /**************************************************************************** * Public Function Prototypes ****************************************************************************/ |