Calculator Community > nSDL

nSDL 1.1.1 Anniversary Edition—The Ultimate TI-Nspire Graphics Library

<< < (78/78)

Matrefeytontias:
I don't know if I'm doing it wrong or what, but nSDL forces the BPP to 8 on TI-Nspire non-CX calcs, even after I set the LCD to 16-bits mode. Is it that you're checking the BPP validity with is_cx or has_colors in SDL_SetVideoMode ? If so, you should consider reading bit 1 to 3 of 0xC000001C to check if the screen is correctly set to accept the provided BPP value.

pimathbrainiac:
Okay, so I have a pretty large sprite sheet (converted to NTI, of course). When I use the following code to get the sprites:

--- Code: ---void draw_tile(SDL_Surface *tileset, long tile_num, int x, int y)
{
    SDL_Rect src_rect, screen_pos;
    src_rect.x = tile_num * 10 + 8;
    src_rect.y = tile_num / 30 * 10 + 119;
    src_rect.w = TILE_WIDTH;
    src_rect.h = TILE_HEIGHT;
    screen_pos.x = x * TILE_WIDTH;
    screen_pos.y = y * TILE_HEIGHT;
    SDL_BlitSurface(tileset, &src_rect, screen, &screen_pos);
}

--- End code ---

Any sprite with an x or y value greater than 127 is not displayed. I looked at the official SDL_Rect struct definition, and those values should end up being 16 bit values, not 8 bit values. Is this a problem with the code or a problem with the library? I am using a monochrome Nspire CAS.

Navigation

[0] Message Index

[*] Previous page

Go to full version