mirror of
https://git.planet-casio.com/Slyvtt/Collab_RPG.git
synced 2025-04-19 17:37:36 +02:00
Fixed a little bug, animation working on th CG50 (thanks Sly)
This commit is contained in:
parent
5c02111ac2
commit
afc2623ad0
1 changed files with 10 additions and 10 deletions
|
@ -192,7 +192,7 @@ void store_vram_part(int x, int y, int w, int h) {
|
|||
#ifdef FXCG50
|
||||
if(image_valid(vram_part)) image_free(vram_part);
|
||||
image_sub(image_create_vram(), x, y, w, h, &vram_part_reference);
|
||||
vram_part = image_create(w, h, IMAGE_RGB565);
|
||||
vram_part = image_alloc(w, h, IMAGE_RGB565);
|
||||
if(vram_part){
|
||||
image_copy(&vram_part_reference, vram_part, true);
|
||||
}
|
||||
|
@ -211,13 +211,13 @@ void restore_vram_part(int x, int y) {
|
|||
int _choice_call_before_end(Game *game) {
|
||||
int i, key;
|
||||
/* Make a little animation because we looove little animations ;) */
|
||||
store_vram_part(0, (BOX_HEIGHT+1)*PXSIZE,
|
||||
DWIDTH, (CHOICE_BOX_HEIGHT+1)*PXSIZE);
|
||||
store_vram_part(0, BOX_HEIGHT*PXSIZE,
|
||||
DWIDTH, (CHOICE_BOX_HEIGHT+2)*PXSIZE);
|
||||
for(i=0;i<DWIDTH/8+1;i++){
|
||||
drect(0, BOX_HEIGHT*PXSIZE, i*(DWIDTH/8),
|
||||
(BOX_HEIGHT+CHOICE_BOX_HEIGHT)*PXSIZE, C_WHITE);
|
||||
drect(i*(DWIDTH/8), BOX_HEIGHT*PXSIZE, i*(DWIDTH/8)+PXSIZE,
|
||||
(BOX_HEIGHT+CHOICE_BOX_HEIGHT)*PXSIZE, C_BLACK);
|
||||
drect(i*(DWIDTH/8), BOX_HEIGHT*PXSIZE, i*(DWIDTH/8)+PXSIZE-1,
|
||||
(BOX_HEIGHT+CHOICE_BOX_HEIGHT+1)*PXSIZE, C_BLACK);
|
||||
drect(0, (BOX_HEIGHT+CHOICE_BOX_HEIGHT)*PXSIZE+1, i*(DWIDTH/8),
|
||||
(BOX_HEIGHT+CHOICE_BOX_HEIGHT+1)*PXSIZE, C_BLACK);
|
||||
blit();
|
||||
|
@ -250,7 +250,7 @@ int _choice_call_before_end(Game *game) {
|
|||
C_WHITE);
|
||||
selected--;
|
||||
}
|
||||
else if(key == KEY_RIGHT && selected < _choices_amount){
|
||||
else if(key == KEY_RIGHT && selected < _choices_amount-1){
|
||||
/* Remove the old arrow. */
|
||||
drect(selected*choice_size+PXSIZE,
|
||||
(BOX_HEIGHT+CHOICE_BOX_PADDING_TOP)*PXSIZE,
|
||||
|
@ -262,11 +262,11 @@ int _choice_call_before_end(Game *game) {
|
|||
}while(key != KEY_EXE);
|
||||
/* Make a little animation because we looove little animations ;) */
|
||||
for(i=DWIDTH/8+1;i>0;i--){
|
||||
restore_vram_part(0, (BOX_HEIGHT+1)*PXSIZE);
|
||||
restore_vram_part(0, BOX_HEIGHT*PXSIZE);
|
||||
drect(0, BOX_HEIGHT*PXSIZE, i*(DWIDTH/8),
|
||||
(BOX_HEIGHT+CHOICE_BOX_HEIGHT)*PXSIZE, C_WHITE);
|
||||
drect(i*(DWIDTH/8), BOX_HEIGHT*PXSIZE, i*(DWIDTH/8)+PXSIZE,
|
||||
(BOX_HEIGHT+CHOICE_BOX_HEIGHT)*PXSIZE, C_BLACK);
|
||||
drect(i*(DWIDTH/8), BOX_HEIGHT*PXSIZE, i*(DWIDTH/8)+PXSIZE-1,
|
||||
(BOX_HEIGHT+CHOICE_BOX_HEIGHT+1)*PXSIZE, C_BLACK);
|
||||
drect(0, (BOX_HEIGHT+CHOICE_BOX_HEIGHT)*PXSIZE+1, i*(DWIDTH/8),
|
||||
(BOX_HEIGHT+CHOICE_BOX_HEIGHT+1)*PXSIZE, C_BLACK);
|
||||
blit();
|
||||
|
@ -274,7 +274,7 @@ int _choice_call_before_end(Game *game) {
|
|||
game->frame_duration = 0;
|
||||
}
|
||||
#ifdef FXCG50
|
||||
if(image_valid(vram_part)) image_free(vram_part);
|
||||
if(vram_part) image_free(vram_part);
|
||||
#else
|
||||
// Really need to code this!
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue