[A89] Re: Problem w/ BITMAP (TI-SDK)


[Prev][Next][Index][Thread]

[A89] Re: Problem w/ BITMAP (TI-SDK)




> I'm using the TI SDK beta1, and am trying to put a bitmap (74 rows x 158 cols)
on the screen.  However, It's throwing an error (too many initializers at {level
2}) at the first five bytes of the bmp after the rows, cols:
>
>                                             These five
> BITMAP world = {74,158,{0xFF,0xFF,0xFF,0xFF,0xFF.....}};
>
> What's going on?

This is because the TI SDK defines BITMAP like this:

typedef struct {
   WORD NumRows;
   WORD NumCols;
   BYTE Data[1];
} BITMAP;

Probably because their compiler doesn't like empty or zero-length vectors.
Try defining your own BITMAP struct:

typedef struct {
   WORD NumRows;
   WORD NumCols;
   BYTE Data[your length goes here];
} MY_BITMAP;

MY_BITMAP world = ...

The only problem is that whenever you use it with something that requires a
BITMAP you must cast it to one.

> If one is travelling faster than light, would he be able to get e-mail?

If anyone starts a discussion like the one not that long ago on this subject I'm
going to scream! =)

--
 / Niklas Brunlid
Check out Prosit for the TI-89 / TI-92+ at http://prosit.ticalc.org
Random PQF v5.1 Quote follows:

He had the look of a lawn mower just after the grass had organised a
workers' collective. There was a definite suggestion that, deep inside, he
knew this was not really happening. It could not be happening because this
sort of thing did not happen. Any contradictory evidence could be safely
ignored.
        -- (Terry Pratchett, Jingo)






Follow-Ups: References: