Been getting these warnings in codeblocks. Been ignoring them until now.
src\main.c||In function `main':|
src\main.c|75|warning: passing arg 2 of `VDP_setPaletteColors' discards qualifiers from pointer target type|
src\main.c|113|warning: passing arg 2 of `SPR_initSprite' discards qualifiers from pointer target type|
src\main.c|114|warning: passing arg 2 of `SPR_initSprite' discards qualifiers from pointer target type|
Here is the code related to the errors
VDP_setPaletteColors(0, palette_black, 64);
PR_initSprite(&sprites[player1.zorder], &jason_sprite, player1.x, player1.y, TILE_ATTR(PAL1, TRUE, FALSE, FALSE));
SPR_initSprite(&sprites[czorder], &fcitizen_sprite, cxypos[0][0], cxypos[1][0], TILE_ATTR(PAL2, TRUE, FALSE, FALSE));
Compile warnings
Moderator: Stef
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: Compile warnings
You can ignore these ones freely, that are just because of "const" versus "no const" variables
Re: Compile warnings
Ah okay. Will do. 8BStef wrote:You can ignore these ones freely, that are just because of "const" versus "no const" variables
Re: Compile warnings
Is there a way of fixing them (I mean, apart casting everything) (some tag in the make.exe...) ?
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: Compile warnings
I don't think so, i can remove all the 'const' from the method declaration side, but you sometime want to have it in the variable declaration so... there is no good solution to avoid them as far i know :-/
-
- Very interested
- Posts: 86
- Joined: Fri Sep 25, 2015 4:16 pm
Re: Compile warnings
For setting the palette, you can just do this:
Code: Select all
u32 p_addr = (u32)(address of your palette array; 16 words);
// Could be u32 p_addr = (u32)&my_pal[0];
u16 pal_number = (palette you want to set);
VDP_doCRamDMA(p_addr, pal_number * 32, 16);