Still trying to fix my image_t problems ...

This commit is contained in:
mibi88 2023-07-19 00:17:38 +02:00
parent ea66f50f44
commit 5c02111ac2
1 changed files with 9 additions and 5 deletions

View File

@ -183,22 +183,26 @@ int _choices_amount, _default_choice;
#ifdef FXCG50
#include <gint/image.h>
image_t vram_part_reference;
image_t vram_part;
image_t *vram_part = NULL;
#else
// Really need to code this!
#endif
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);
image_copy(&vram_part_reference, &vram_part, true);
vram_part = image_create(w, h, IMAGE_RGB565);
if(vram_part){
image_copy(&vram_part_reference, vram_part, true);
}
#else
// Really need to code this!
#endif
}
void restore_vram_part(int x, int y) {
#ifdef FXCG50
dimage(x, y, &vram_part);
dimage(x, y, vram_part);
#else
// Really need to code this!
#endif
@ -258,7 +262,7 @@ 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+40);
restore_vram_part(0, (BOX_HEIGHT+1)*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,
@ -270,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);
#else
// Really need to code this!
#endif