Advertising
Paste Description for drawing bmp problem
I'm getting this compiler error:
amaze.c: In function ‘drawtilemap’:
amaze.c:916: error: ‘BMP_amaze_tiles’ undeclared (first use in this function)
916 corresponds to the first use of DRAW_TILE
It is likely a bonehead error; I'm beginner/intermediate at C.
- drawing bmp problem
- Wednesday, October 3rd, 2007 at 1:38:01am MDT
- /* here are the defines (at top of file) */
- #include "amaze_tiles.h"
- #define TILE_WIDTH BMP_amaze_tiles
- #define TILE_HEIGHT (BMP_amaze_tiles/9)
- #define t_up 0
- #define t_down 1
- #define t_left 2
- #define t_right 3
- #define t_visited 4
- #define t_obspace 5
- #define t_goal 6
- #define t_block 7
- #define t_space 8
- /* here's the drawing function */
- void drawtilemap(void)
- {
- int x,y;
- char map_unit;
- int unit_fmt;
- clearscreen();
- # define DRAW_TILE( a ) \
- rb->lcd_bitmap_part( amaze_tiles, 0, \
- a*TILE_HEIGHT, TILE_WIDTH, \
- x * TILE_WIDTH, \
- y * TILE_HEIGHT, \
- TILE_WIDTH, TILE_HEIGHT);
- for(y=0; y < umap->maxy; y++)
- for (x=0; x < umap->maxx; x++) {
- map_unit = umap->coords[y][x].chr;
- unit_fmt = umap->coords[y][x].attrib;
- switch (map_unit) {
- case '^':
- DRAW_TILE(t_up);
- break;
- case 'v':
- DRAW_TILE(t_down);
- break;
- case '<':
- DRAW_TILE(t_left);
- break;
- case '>':
- DRAW_TILE(t_right);
- break;
- case '.':
- DRAW_TILE(t_visited);
- break;
- case '#':
- DRAW_TILE(t_obspace);
- break;
- case '%':
- DRAW_TILE(t_goal);
- break;
- case ' ':
- if(unit_fmt==A_NORMAL)
- DRAW_TILE(t_space)
- else
- DRAW_TILE(t_block)
- break;
- }
- }
- rb->lcd_update();
- }
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.