resolved all warnings - this may help solving my bug leading to crash

This commit is contained in:
Sylvain PILLOT 2023-12-06 13:13:18 +01:00
parent 6ce7962b33
commit 0455f7746b
22 changed files with 131 additions and 137 deletions

View File

@ -79,7 +79,7 @@ set(ASSETS_cg
fxconv_declare_assets(${ASSETS_cg} WITH_METADATA)
add_executable(ssaver ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}})
target_compile_options(ssaver PRIVATE -Wall -Wextra -Og -std=c++20)
target_compile_options(ssaver PRIVATE -Wall -Wextra -Wattributes -Og -std=c++20)
target_link_options(ssaver PRIVATE -Wl,-Map=Build_Addin.map -Wl,--print-memory-usage -fno-use-cxa-atexit -fpermissive)
target_link_libraries(ssaver -lnum LibProf::LibProf Gint::Gint -lstdc++)

View File

@ -17,7 +17,7 @@ bopti_image_t *dotcube_miniature( void );
void dotcube_init( bopti_image_t *screen );
void dotcube_update( bopti_image_t *screen, float dt );
void dotcube_render( bopti_image_t *screen );
void dotcube_deinit( bopti_image_t *screen );
void dotcube_deinit( void );
Module_Register dotcube_effect = { &dotcube_text,
&dotcube_init,
@ -63,7 +63,7 @@ bopti_image_t* dotcube_miniature( void )
}
void dotcube_init( bopti_image_t *screen )
void dotcube_init( [[maybe_unused]] bopti_image_t *screen )
{
NumPoints2 = 0;
@ -106,7 +106,7 @@ void dotcube_init( bopti_image_t *screen )
}
void dotcube_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
void dotcube_update( [[maybe_unused]] bopti_image_t *screen, [[maybe_unused]] float dt )
{
anglef3 += dt / 50000.0;
angle3 = (int) anglef3;
@ -119,7 +119,7 @@ void dotcube_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
}
void dotcube_render( bopti_image_t *screen )
void dotcube_render( [[maybe_unused]] bopti_image_t *screen )
{
image_fill( screen, -128 );
@ -146,7 +146,7 @@ void dotcube_render( bopti_image_t *screen )
}
void dotcube_deinit( bopti_image_t *screen )
void dotcube_deinit( void )
{
free( Cubedot );
}

View File

@ -15,7 +15,7 @@ bopti_image_t *dotflag_miniature( void );
void dotflag_init( bopti_image_t *screen );
void dotflag_update( bopti_image_t *screen, float dt );
void dotflag_render( bopti_image_t *screen );
void dotflag_deinit( bopti_image_t *screen );
void dotflag_deinit( void );
Module_Register dotflag_effect = { &dotflag_text,
&dotflag_init,
@ -58,7 +58,7 @@ bopti_image_t* dotflag_miniature( void )
}
void dotflag_init( bopti_image_t *screen )
void dotflag_init( [[maybe_unused]] bopti_image_t *screen )
{
eye = libnum::num32( 150 );
scale = libnum::num32( SCALE );
@ -94,7 +94,7 @@ void dotflag_init( bopti_image_t *screen )
}
void dotflag_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
void dotflag_update( [[maybe_unused]] bopti_image_t *screen, [[maybe_unused]] float dt )
{
anglef += dt / 50000.0;
angle = (int) anglef;
@ -117,7 +117,7 @@ void dotflag_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
}
void dotflag_render( bopti_image_t *screen )
void dotflag_render( [[maybe_unused]] bopti_image_t *screen )
{
image_fill( screen, -128 );
@ -127,7 +127,7 @@ void dotflag_render( bopti_image_t *screen )
dimage( 0, 0, screen );
}
void dotflag_deinit( bopti_image_t *screen )
void dotflag_deinit( void )
{
free( Flag );
free( FMorph );

View File

@ -8,7 +8,7 @@
void pixel( bopti_image_t *screen, uint16_t sx, uint16_t sy, int8_t color )
{
if (sx<0 || sx>=DWIDTH || sy<0 || sy>=MAXHEIGHT ) return;
if (sx>=DWIDTH || sy>=MAXHEIGHT ) return;
int8_t *image = (int8_t *)screen->data;
@ -17,7 +17,7 @@ void pixel( bopti_image_t *screen, uint16_t sx, uint16_t sy, int8_t color )
void getpixel( bopti_image_t *screen, uint16_t sx, uint16_t sy, int8_t *color )
{
if (sx<0 || sx>=DWIDTH || sy<0 || sy>=MAXHEIGHT ) return;
if (sx>=DWIDTH || sy>=MAXHEIGHT ) return;
int8_t *image = (int8_t *)screen->data;
@ -27,9 +27,6 @@ void getpixel( bopti_image_t *screen, uint16_t sx, uint16_t sy, int8_t *color )
void drawline(bopti_image_t *screen, int x1, int y1, int x2, int y2, uint8_t color)
{
uint8_t *dest = (uint8_t *)screen->data;
/* Brensenham line drawing algorithm */
int i;

View File

@ -17,7 +17,7 @@ bopti_image_t *fire_miniature( void );
void fire_init( bopti_image_t *screen );
void fire_update( bopti_image_t *screen, float dt );
void fire_render( bopti_image_t *screen );
void fire_deinit( bopti_image_t *screen );
void fire_deinit( void );
Module_Register fire_effect = { &fire_text,
&fire_init,
@ -50,8 +50,8 @@ static float anglef3 = 0.0;
static int angle3 = 0;
int NumPoints = 0;
static char *message = "~~~ DemoFX for fx-CG50 - Vintage Demo Scene Effects ~~~";
static char *message2 = "~~~ Proudly cooked by SlyVTT (2023) with fxSDK/gint ~~~";
static const char *message = "~~~ DemoFX for fx-CG50 - Vintage Demo Scene Effects ~~~";
static const char *message2 = "~~~ Proudly cooked by SlyVTT (2023) with fxSDK/gint ~~~";
static float st = 0.0f;
@ -69,7 +69,7 @@ bopti_image_t* fire_miniature( void )
}
void fire_init( bopti_image_t *screen )
void fire_init( [[maybe_unused]] bopti_image_t *screen )
{
NumPoints = 0;
@ -125,7 +125,7 @@ void fire_init( bopti_image_t *screen )
}
void fire_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
void fire_update( [[maybe_unused]] bopti_image_t *screen, [[maybe_unused]] float dt )
{
int h = MAXHEIGHT;
int w = DWIDTH;
@ -166,19 +166,19 @@ char GetLetter( int i, int messageNum )
{
if (messageNum==0)
{
if (i<strlen( message )) return message[i];
if (i<(int) strlen( message )) return message[i];
else return '\0';
}
else if (messageNum==1)
{
if (i<strlen( message2 )) return message2[i];
if (i<(int) strlen( message2 )) return message2[i];
else return '\0';
}
else return '\0';
}
void fire_render( bopti_image_t *screen )
void fire_render( [[maybe_unused]] bopti_image_t *screen )
{
dimage( 0, 0, screen );
@ -198,11 +198,10 @@ void fire_render( bopti_image_t *screen )
int base_x = 400 - st * 20;
int last_letter_x = base_x + 10 * strlen( message );
int xadd = 0;
if (last_letter_x<0) st=0.0f;
for( int i=0; i<strlen( message ); i++ )
for( int i=0; i<(int) strlen( message ); i++ )
{
c = GetLetter(i, 0);
@ -219,7 +218,7 @@ void fire_render( bopti_image_t *screen )
}
void fire_deinit( bopti_image_t *screen )
void fire_deinit( void )
{
free( fire );
free( Donut );

View File

@ -18,7 +18,7 @@ bopti_image_t *firecube_miniature( void );
void firecube_init( bopti_image_t *screen );
void firecube_update( bopti_image_t *screen, float dt );
void firecube_render( bopti_image_t *screen );
void firecube_deinit( bopti_image_t *screen );
void firecube_deinit( void );
Module_Register firecube_effect = { &firecube_text,
&firecube_init,
@ -56,7 +56,7 @@ bopti_image_t* firecube_miniature( void )
}
void firecube_init( bopti_image_t *screen )
void firecube_init( [[maybe_unused]] bopti_image_t *screen )
{
eye = libnum::num32( 250 );
scale = libnum::num32( SCALE );
@ -105,7 +105,7 @@ void firecube_init( bopti_image_t *screen )
image_fill( screen, -128 );
}
void firecube_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
void firecube_update( [[maybe_unused]] bopti_image_t *screen, [[maybe_unused]] float dt )
{
anglef += dt / 10000.0;
angle = (int) anglef;
@ -119,7 +119,7 @@ void firecube_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
void firecube_render( bopti_image_t *screen )
void firecube_render( [[maybe_unused]] bopti_image_t *screen )
{
for (int j = 0; j < NB_LINES_CUBE; j++)
drawline( screen, Cube[ Lines[j].p1 ].sx, Cube[ Lines[j].p1 ].sy, Cube[ Lines[j].p2 ].sx, Cube[ Lines[j].p2 ].sy, 127 );
@ -130,7 +130,7 @@ void firecube_render( bopti_image_t *screen )
}
void firecube_deinit( bopti_image_t *screen )
void firecube_deinit( void )
{
free( Cube );
free( Lines );

View File

@ -15,7 +15,7 @@ bopti_image_t *lens_miniature( void );
void lens_init( bopti_image_t *screen );
void lens_update( bopti_image_t *screen, float dt );
void lens_render( bopti_image_t *screen );
void lens_deinit( bopti_image_t *screen );
void lens_deinit( void );
Module_Register lens_effect = { &lens_text,
&lens_init,
@ -46,11 +46,11 @@ bopti_image_t* lens_miniature( void )
void lens_init( bopti_image_t *screen )
void lens_init( [[maybe_unused]] bopti_image_t *screen )
{
image_copy_palette( &bglens, screen, -1 );
int i, x, y, r, d;
int x, y, r, d;
r = LENS_WIDTH/2;
d = LENS_ZOOM;
@ -104,7 +104,7 @@ void apply_lens(int ox, int oy, bopti_image_t *screen )
}
void lens_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
void lens_update( [[maybe_unused]] bopti_image_t *screen, [[maybe_unused]] float dt )
{
apply_lens( x3, y3, screen );
@ -116,13 +116,13 @@ void lens_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
}
void lens_render( bopti_image_t *screen )
void lens_render( [[maybe_unused]] bopti_image_t *screen )
{
dimage(0,0,screen);
}
void lens_deinit( bopti_image_t *screen )
void lens_deinit( void )
{
}

View File

@ -19,7 +19,7 @@ bopti_image_t *linemorph_miniature( void );
void linemorph_init( bopti_image_t *screen );
void linemorph_update( bopti_image_t *screen, float dt );
void linemorph_render( bopti_image_t *screen );
void linemorph_deinit( bopti_image_t *screen );
void linemorph_deinit( void );
Module_Register linemorph_effect = { &linemorph_text,
@ -31,8 +31,6 @@ Module_Register linemorph_effect = { &linemorph_text,
static double frame_counter = 0;
uint16_t x1, y1, x2, y2;
int16_t velx1, vely1, velx2, vely2;
@ -46,7 +44,7 @@ bopti_image_t* linemorph_miniature( void )
void linemorph_init( bopti_image_t *screen )
void linemorph_init( [[maybe_unused]] bopti_image_t *screen )
{
x1 = rand( ) % DWIDTH;
y1 = rand( ) % MAXHEIGHT;
@ -72,7 +70,7 @@ void linemorph_init( bopti_image_t *screen )
}
void linemorph_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
void linemorph_update( [[maybe_unused]] bopti_image_t *screen, [[maybe_unused]] float dt )
{
if (x1+velx1<3) x1=3, velx1=-velx1;
else if (x1+velx1>=DWIDTH-3) x1=DWIDTH-3, velx1=-velx1;
@ -92,7 +90,7 @@ void linemorph_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
}
void linemorph_render( bopti_image_t *screen )
void linemorph_render( [[maybe_unused]] bopti_image_t *screen )
{
drawline( screen, x1, y1, x2, y2, 127 );
drawline( screen, x1+1, y1, x2+1, y2, 127 );
@ -104,7 +102,7 @@ void linemorph_render( bopti_image_t *screen )
dimage( 0, 0, screen );
}
void linemorph_deinit( bopti_image_t *screen )
void linemorph_deinit( void )
{
}

View File

@ -14,7 +14,7 @@ bopti_image_t *matrix_miniature( void );
void matrix_init( bopti_image_t *screen );
void matrix_update( bopti_image_t *screen, float dt );
void matrix_render( bopti_image_t *screen );
void matrix_deinit( bopti_image_t *screen );
void matrix_deinit( void );
Module_Register matrix_effect = { &matrix_text,
&matrix_init,
@ -64,7 +64,7 @@ bopti_image_t* matrix_miniature( void )
void matrix_init( bopti_image_t *screen )
void matrix_init( [[maybe_unused]] bopti_image_t *screen )
{
dfont( &font_matrix );
srand( rtc_ticks() );
@ -84,7 +84,7 @@ void matrix_init( bopti_image_t *screen )
}
void matrix_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
void matrix_update( [[maybe_unused]] bopti_image_t *screen, [[maybe_unused]] float dt )
{
for( int k=0; k< NUMBER_OF_STRIPS; k++)
strips[k].y += strips[k].speed;
@ -95,7 +95,7 @@ void matrix_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
}
void matrix_render( bopti_image_t *screen )
void matrix_render( [[maybe_unused]] bopti_image_t *screen )
{
dclear( C_BLACK );
@ -116,7 +116,7 @@ void matrix_render( bopti_image_t *screen )
}
void matrix_deinit( bopti_image_t *screen )
void matrix_deinit( void )
{
free( strips );
free( colorgradient );

View File

@ -16,7 +16,7 @@ bopti_image_t *moire_miniature( void );
void moire_init( bopti_image_t *screen );
void moire_update( bopti_image_t *screen, float dt );
void moire_render( bopti_image_t *screen );
void moire_deinit( bopti_image_t *screen );
void moire_deinit( void );
Module_Register moire_effect = { &moire_text,
@ -35,7 +35,6 @@ int slx1, sly1;
int slx2, sly2;
static float moireanglef = 0.0;
static int moireangle = 0;
int8_t *image1;
int8_t *image2;
@ -48,7 +47,7 @@ bopti_image_t* moire_miniature( void )
}
void moire_init( bopti_image_t *screen )
void moire_init( [[maybe_unused]] bopti_image_t *screen )
{
IMAGE_WIDTH = xorcircles.stride;
@ -58,7 +57,7 @@ void moire_init( bopti_image_t *screen )
}
void moire_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
void moire_update( [[maybe_unused]] bopti_image_t *screen, [[maybe_unused]] float dt )
{
moireanglef += dt / 3000000.0;
@ -77,7 +76,7 @@ void moire_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
}
void moire_render( bopti_image_t *screen )
void moire_render( [[maybe_unused]] bopti_image_t *screen )
{
for (int y = 0; y < MAXHEIGHT; y++)
{
@ -92,7 +91,7 @@ void moire_render( bopti_image_t *screen )
}
void moire_deinit( bopti_image_t *screen )
void moire_deinit( void )
{
}

View File

@ -13,7 +13,7 @@ bopti_image_t *morph_miniature( void );
void morph_init( bopti_image_t *screen );
void morph_update( bopti_image_t *screen, float dt );
void morph_render( bopti_image_t *screen );
void morph_deinit( bopti_image_t *screen );
void morph_deinit( void );
Module_Register morph_effect = { &morph_text,
&morph_init,
@ -52,7 +52,7 @@ bopti_image_t* morph_miniature( void )
void morph_init( bopti_image_t *screen )
void morph_init( [[maybe_unused]] bopti_image_t *screen )
{
eye = libnum::num32( 250 );
scale = libnum::num32( SCALE );
@ -101,7 +101,7 @@ void morph_init( bopti_image_t *screen )
}
void morph_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
void morph_update( [[maybe_unused]] bopti_image_t *screen, [[maybe_unused]] float dt )
{
anglef += dt / 10000.0;
angle = (int) anglef;
@ -148,7 +148,7 @@ void morph_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
}
void morph_render( bopti_image_t *screen )
void morph_render( [[maybe_unused]] bopti_image_t *screen )
{
image_fill( screen, -128 );
@ -158,7 +158,7 @@ void morph_render( bopti_image_t *screen )
dimage( 0, 0, screen );
}
void morph_deinit( bopti_image_t *screen )
void morph_deinit( void )
{
free( Sphere );
free( Torus );

View File

@ -14,7 +14,7 @@ bopti_image_t *morphfire_miniature( void );
void morphfire_init( bopti_image_t *screen );
void morphfire_update( bopti_image_t *screen, float dt );
void morphfire_render( bopti_image_t *screen );
void morphfire_deinit( bopti_image_t *screen );
void morphfire_deinit( void );
Module_Register morphfire_effect = { &morphfire_text,
&morphfire_init,
@ -54,7 +54,7 @@ bopti_image_t* morphfire_miniature( void )
void morphfire_init( bopti_image_t *screen )
void morphfire_init( [[maybe_unused]] bopti_image_t *screen )
{
eye = libnum::num32( 250 );
scale = libnum::num32( SCALE );
@ -110,7 +110,7 @@ void morphfire_init( bopti_image_t *screen )
}
void morphfire_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
void morphfire_update( [[maybe_unused]] bopti_image_t *screen, [[maybe_unused]] float dt )
{
anglef += dt / 10000.0;
angle = (int) anglef;
@ -156,12 +156,8 @@ void morphfire_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
}
}
void morphfire_render( bopti_image_t *screen )
void morphfire_render( [[maybe_unused]] bopti_image_t *screen )
{
//image_fill( screen, -128 );
int8_t *image = (int8_t *)screen->data;
for (int i = 0; i < NB_POINTS; i++)
{
pixel( screen, Morph2[i].sx-1, Morph2[i].sy, 127 );
@ -177,7 +173,7 @@ void morphfire_render( bopti_image_t *screen )
dimage( 0, 0, screen );
}
void morphfire_deinit( bopti_image_t *screen )
void morphfire_deinit( void )
{
free( Sphere2 );
free( Torus2 );

View File

@ -16,7 +16,7 @@ bopti_image_t *motionblur_miniature( void );
void motionblur_init( bopti_image_t *screen );
void motionblur_update( bopti_image_t *screen, float dt );
void motionblur_render( bopti_image_t *screen );
void motionblur_deinit( bopti_image_t *screen );
void motionblur_deinit( void );
Module_Register motionblur_effect = { &motionblur_text,
@ -56,7 +56,7 @@ bopti_image_t* motionblur_miniature( void )
}
void motionblur_init( bopti_image_t *screen )
void motionblur_init( [[maybe_unused]] bopti_image_t *screen )
{
eye = libnum::num32( 250 );
scale = libnum::num32( SCALE );
@ -113,7 +113,7 @@ void motionblur_init( bopti_image_t *screen )
image_fill( screen, -128 );
}
void motionblur_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
void motionblur_update( [[maybe_unused]] bopti_image_t *screen, [[maybe_unused]] float dt )
{
anglef += dt / 15000.0;
angle = (int) anglef;
@ -128,7 +128,7 @@ void motionblur_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
void motionblur_render( bopti_image_t *screen )
void motionblur_render( [[maybe_unused]] bopti_image_t *screen )
{
MotionBlur( screen );
@ -139,7 +139,7 @@ void motionblur_render( bopti_image_t *screen )
}
void motionblur_deinit( bopti_image_t *screen )
void motionblur_deinit( void )
{
free( CubeBlur );
free( LinesBlur );

View File

@ -16,7 +16,7 @@ bopti_image_t *plasma_miniature( void );
void plasma_init( bopti_image_t *screen );
void plasma_update( bopti_image_t *screen, float dt );
void plasma_render( bopti_image_t *screen );
void plasma_deinit( bopti_image_t *screen );
void plasma_deinit( void );
Module_Register plasma_effect = { &plasma_text,
&plasma_init,
@ -45,7 +45,7 @@ bopti_image_t* plasma_miniature( void )
void plasma_init( bopti_image_t *screen )
void plasma_init( [[maybe_unused]] bopti_image_t *screen )
{
aSin = (int *)malloc( 512 * sizeof( int ) );
@ -65,7 +65,7 @@ void plasma_init( bopti_image_t *screen )
}
void plasma_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
void plasma_update( [[maybe_unused]] bopti_image_t *screen, [[maybe_unused]] float dt )
{
int8_t *image = (int8_t *) screen->data;
@ -104,13 +104,13 @@ void plasma_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
}
void plasma_render( bopti_image_t *screen )
void plasma_render( [[maybe_unused]] bopti_image_t *screen )
{
dimage(0,0,screen);
}
void plasma_deinit( bopti_image_t *screen )
void plasma_deinit( void )
{
free( aSin );
}

View File

@ -16,7 +16,7 @@ bopti_image_t *raindrops_miniature( void );
void raindrops_init( bopti_image_t *screen );
void raindrops_update( bopti_image_t *screen, float dt );
void raindrops_render( bopti_image_t *screen );
void raindrops_deinit( bopti_image_t *screen );
void raindrops_deinit( void );
Module_Register raindrops_effect = { &raindrops_text,
&raindrops_init,
@ -55,7 +55,7 @@ bopti_image_t* raindrops_miniature( void )
void raindrops_init( bopti_image_t *screen )
void raindrops_init( [[maybe_unused]] bopti_image_t *screen )
{
wavemap = (short *) malloc( DWIDTH * MAXHEIGHT * sizeof( short ) );
old_wavemap = (short *) malloc( DWIDTH * MAXHEIGHT* sizeof( short ) );
@ -93,7 +93,7 @@ void start_drop()
}
void raindrops_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
void raindrops_update( [[maybe_unused]] bopti_image_t *screen, [[maybe_unused]] float dt )
{
uint16_t t;
@ -151,13 +151,13 @@ void raindrops_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
}
void raindrops_render( bopti_image_t *screen )
void raindrops_render( [[maybe_unused]] bopti_image_t *screen )
{
dimage(0,0,screen);
}
void raindrops_deinit( bopti_image_t *screen )
void raindrops_deinit( void )
{
free( wavemap );
free( old_wavemap );

View File

@ -16,7 +16,7 @@ bopti_image_t *rotatesphere_miniature( void );
void rotatesphere_init( bopti_image_t *screen );
void rotatesphere_update( bopti_image_t *screen, float dt );
void rotatesphere_render( bopti_image_t *screen );
void rotatesphere_deinit( bopti_image_t *screen );
void rotatesphere_deinit( void );
Module_Register rotatesphere_effect = { &rotatesphere_text,
&rotatesphere_init,
@ -67,7 +67,7 @@ bopti_image_t* rotatesphere_miniature( void )
void rotatesphere_init( bopti_image_t *screen )
void rotatesphere_init( [[maybe_unused]] bopti_image_t *screen )
{
eye = libnum::num32( 250 );
scale = libnum::num32( SCALE_SPHERE );
@ -100,7 +100,7 @@ void rotatesphere_init( bopti_image_t *screen )
}
}
void rotatesphere_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
void rotatesphere_update( [[maybe_unused]] bopti_image_t *screen, [[maybe_unused]] float dt )
{
anglef += dt / 50000.0;
angle = (int) anglef;
@ -112,7 +112,7 @@ void rotatesphere_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
}
}
void rotatesphere_render( bopti_image_t *screen )
void rotatesphere_render( [[maybe_unused]] bopti_image_t *screen )
{
image_copy( &circuit, screen, false );
@ -124,7 +124,7 @@ void rotatesphere_render( bopti_image_t *screen )
}
void rotatesphere_deinit( bopti_image_t *screen )
void rotatesphere_deinit( void )
{
free( RotateSphere );
}

View File

@ -14,7 +14,7 @@ bopti_image_t *rotozoom_miniature( void );
void rotozoom_init( bopti_image_t *screen );
void rotozoom_update( bopti_image_t *screen, float dt );
void rotozoom_render( bopti_image_t *screen );
void rotozoom_deinit( bopti_image_t *screen );
void rotozoom_deinit( void );
Module_Register rotozoom_effect = { &rotozoom_text,
&rotozoom_init,
@ -43,7 +43,7 @@ bopti_image_t* rotozoom_miniature( void )
void rotozoom_init( bopti_image_t *screen )
void rotozoom_init( [[maybe_unused]] bopti_image_t *screen )
{
image_copy_palette( &tilerotozoom, screen, -1 );
@ -71,19 +71,26 @@ void draw_tile(bopti_image_t *screen, int stepx, int stepy, int zoom)
for (j = 0; j < MAXHEIGHT; j++)
{
x = sx; y = sy;
x = sx;
y = sy;
for (i = 0; i < screen->stride; i++)
{
a = x >> 12 & 255;
b = y >> 12 & 255;
*image++ = texture[b * tilerotozoom.stride + a];
x += xd; y += yd;
x += xd;
y += yd;
}
sx -= yd; sy += xd;
sx -= yd;
sy += xd;
}
}
void rotozoom_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
void rotozoom_update( [[maybe_unused]] bopti_image_t *screen, [[maybe_unused]] float dt )
{
draw_tile( screen, roto[path], roto[(path + 128) & 255], roto2[zpath]);
@ -92,13 +99,13 @@ void rotozoom_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
}
void rotozoom_render( bopti_image_t *screen )
void rotozoom_render( [[maybe_unused]] bopti_image_t *screen )
{
dimage(0,0,screen);
}
void rotozoom_deinit( bopti_image_t *screen )
void rotozoom_deinit( void )
{
free( roto );
free( roto2 );

View File

@ -15,7 +15,7 @@ bopti_image_t *spline_miniature( void );
void spline_init( bopti_image_t *screen );
void spline_update( bopti_image_t *screen, float dt );
void spline_render( bopti_image_t *screen );
void spline_deinit( bopti_image_t *screen );
void spline_deinit( void );
Module_Register spline_effect = { &spline_text,
&spline_init,
@ -34,8 +34,6 @@ libnum::num32 *yPointsOrigin;
libnum::num32 *xPointsVel;
libnum::num32 *yPointsVel;
static int current_morph_frame;
int random_between( int lower, int upper )
{
@ -55,7 +53,7 @@ bopti_image_t* spline_miniature( void )
void spline_init( bopti_image_t *screen )
void spline_init( [[maybe_unused]] bopti_image_t *screen )
{
xPointsOrigin = (libnum::num32 *) malloc( MAXPT * sizeof( libnum::num32 ) );
@ -91,7 +89,7 @@ void spline_init( bopti_image_t *screen )
}
void spline_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
void spline_update( [[maybe_unused]] bopti_image_t *screen, [[maybe_unused]] float dt )
{
MySpline.RemovePoints();
@ -111,7 +109,7 @@ void spline_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
}
}
void spline_render( bopti_image_t *screen )
void spline_render( [[maybe_unused]] bopti_image_t *screen )
{
image_fill( screen, -128 );
@ -136,7 +134,7 @@ void spline_render( bopti_image_t *screen )
}
void spline_deinit( bopti_image_t *screen )
void spline_deinit( void )
{
MySpline.RemovePoints();

View File

@ -14,7 +14,7 @@ bopti_image_t *splineblur_miniature( void );
void splineblur_init( bopti_image_t *screen );
void splineblur_update( bopti_image_t *screen, float dt );
void splineblur_render( bopti_image_t *screen );
void splineblur_deinit( bopti_image_t *screen );
void splineblur_deinit( void );
Module_Register splineblur_effect = { &splineblur_text,
&splineblur_init,
@ -41,7 +41,7 @@ bopti_image_t* splineblur_miniature( void )
void splineblur_init( bopti_image_t *screen )
void splineblur_init( [[maybe_unused]] bopti_image_t *screen )
{
libnum::num32 scalenum = libnum::num32(1)+ FastCosInt(scalespline);
rotate = 0;
@ -77,7 +77,7 @@ void splineblur_init( bopti_image_t *screen )
}
void splineblur_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
void splineblur_update( [[maybe_unused]] bopti_image_t *screen, [[maybe_unused]] float dt )
{
MySplineBlured.RemovePoints();
@ -107,7 +107,7 @@ void splineblur_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
}
void splineblur_render( bopti_image_t *screen )
void splineblur_render( [[maybe_unused]] bopti_image_t *screen )
{
float accumulatedTime = 0.0f;
libnum::num32 x1, y1, x2, y2;
@ -128,7 +128,7 @@ void splineblur_render( bopti_image_t *screen )
}
void splineblur_deinit( bopti_image_t *screen )
void splineblur_deinit( void )
{
MySplineBlured.RemovePoints();
}

View File

@ -15,7 +15,7 @@ bopti_image_t *starfield_miniature( void );
void starfield_init( bopti_image_t *screen );
void starfield_update( bopti_image_t *screen, float dt );
void starfield_render( bopti_image_t *screen );
void starfield_deinit( bopti_image_t *screen );
void starfield_deinit( void );
Module_Register starfield_effect = { &starfield_text,
&starfield_init,
@ -66,7 +66,7 @@ void init_star(STAR* star, int i)
}
void starfield_init( bopti_image_t *screen )
void starfield_init( [[maybe_unused]] bopti_image_t *screen )
{
centerx = (DWIDTH / 2);
centery = (MAXHEIGHT / 2);
@ -87,7 +87,7 @@ void starfield_init( bopti_image_t *screen )
}
void starfield_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
void starfield_update( [[maybe_unused]] bopti_image_t *screen, [[maybe_unused]] float dt )
{
centerx = DWIDTH >> 1;
centery = MAXHEIGHT >> 1;
@ -114,7 +114,7 @@ void starfield_update( bopti_image_t *screen, [[Maybe_unused]] float dt )
}
void starfield_render( bopti_image_t *screen )
void starfield_render( [[maybe_unused]] bopti_image_t *screen )
{
image_fill( screen, -128 );
@ -125,7 +125,7 @@ void starfield_render( bopti_image_t *screen )
}
void starfield_deinit( bopti_image_t *screen )
void starfield_deinit( void )
{
free( stars );
}

View File

@ -51,9 +51,9 @@ extern Module_Register morphfire_effect;
extern Module_Register raindrops_effect;
Module_Register* Modules[] = {
&fire_effect,
&dotflag_effect,
&dotcube_effect,
&fire_effect,
&rotatesphere_effect,
&moire_effect,
&starfield_effect,
@ -77,12 +77,12 @@ int next_effect_menu = 0;
#if(MORE_RAM)
static kmalloc_arena_t extended_ram = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0,0,0,0,0,0 };
static kmalloc_arena_t *_uram;
kmalloc_arena_t extended_ram = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0,0,0,0,0,0 };
kmalloc_arena_t *_uram;
kmalloc_gint_stats_t *_uram_stats;
kmalloc_gint_stats_t *extram_stats;
#else
static kmalloc_arena_t *_uram;
kmalloc_arena_t *_uram;
kmalloc_gint_stats_t *_uram_stats;
#endif
@ -131,10 +131,10 @@ extern font_t font_label;
bopti_image_t *screen;
static void Initialise( void );
static void Update( void );
static void Render( void );
static void Close( void );
void Initialise( void );
void Update( void );
void Render( void );
void Close( void );
@ -225,7 +225,7 @@ void FreeMoreRAM( void )
}
static void GetInputs( [[maybe_unused]] float dt )
void GetInputs( [[maybe_unused]] float dt )
{
if (Keyboard.IsKeyPressed(MYKEY_EXIT)) {exitToOS = true; };
@ -268,7 +268,7 @@ static void GetInputs( [[maybe_unused]] float dt )
}
}
static void GetInputsOption( [[maybe_unused]] float dt )
void GetInputsOption( [[maybe_unused]] float dt )
{
if (Keyboard.IsKeyPressedEvent(MYKEY_OPTN)) showOption = !showOption;
@ -329,7 +329,7 @@ static void GetInputsOption( [[maybe_unused]] float dt )
}
static void ShowOptionBox( void )
void ShowOptionBox( void )
{
extern bopti_image_t optionbox;
@ -346,8 +346,8 @@ static void ShowOptionBox( void )
dprint( (DWIDTH-w)/2 +26, (MAXHEIGHT-h)/2 +26, C_RED, "Effect Name : %s", showName == true ? "< Yes >" : "< No >" );
dprint( (DWIDTH-w)/2 +25, (MAXHEIGHT-h)/2 +25, MenuOptionSelected==2 ? RGB565_LEMONYELLOW : RGB565_WHITE, "Effect Name : %s", showName == true ? "< Yes >" : "< No >" );
dprint( (DWIDTH-w)/2 +26, (MAXHEIGHT-h)/2 +46, C_RED, "Cycling : %s", EffectLoop == STATIC ? "< Static >" : EffectLoop == LOOP_AUTOREVERSE ? "< Autoreverse >" : "< Loop >" );
dprint( (DWIDTH-w)/2 +25, (MAXHEIGHT-h)/2 +45, MenuOptionSelected==3 ? RGB565_LEMONYELLOW : RGB565_WHITE, "Cycling : %s", EffectLoop == STATIC ? "< Static >" : EffectLoop == LOOP_AUTOREVERSE ? "< Autoreverse >" : "< Loop >" );
dprint( (DWIDTH-w)/2 +26, (MAXHEIGHT-h)/2 +46, C_RED, "Cycling : %s", EffectLoop == STATIC ? "< >" : EffectLoop == LOOP_AUTOREVERSE ? "< Autoreverse >" : "< Loop >" );
dprint( (DWIDTH-w)/2 +25, (MAXHEIGHT-h)/2 +45, MenuOptionSelected==3 ? RGB565_LEMONYELLOW : RGB565_WHITE, "Cycling : %s", EffectLoop == STATIC ? "< >" : EffectLoop == LOOP_AUTOREVERSE ? "< Autoreverse >" : "< Loop >" );
if(EffectLoop != STATIC)
{
@ -358,7 +358,7 @@ static void ShowOptionBox( void )
static void GetInputsEffectSelection( [[maybe_unused]] float dt )
void GetInputsEffectSelection( [[maybe_unused]] float dt )
{
//if (Keyboard.IsKeyPressed(MYKEY_EXIT)) {exitToOS = true; };
@ -393,7 +393,7 @@ static void GetInputsEffectSelection( [[maybe_unused]] float dt )
static void ShowEffectSelectionBox( void )
void ShowEffectSelectionBox( void )
{
//bopti_image_t* Miniature= (*Effects_Miniature[next_effect_menu])();
bopti_image_t* Miniature= (*Modules[next_effect_menu]->Miniature)( );
@ -416,14 +416,14 @@ static void ShowEffectSelectionBox( void )
}
static void Initialise( void )
void Initialise( void )
{
//(*Effects_Init[ current_effect ])( screen );
(*Modules[current_effect]->Init)( screen );
}
static void Render( void )
void Render( void )
{
//(*Effects_Render[ current_effect ])( screen );
(*Modules[current_effect]->Render)( screen );
@ -456,17 +456,17 @@ static void Render( void )
}
static void Update( [[maybe_unused]] float dt )
void Update( [[maybe_unused]] float dt )
{
//(*Effects_Update[ current_effect ])( screen, dt );
(*Modules[current_effect]->Update)( screen, dt );
}
static void Close( void )
void Close( void )
{
//(*Effects_DeInit[ current_effect ])( screen );
(*Modules[current_effect]->Close)( screen );
(*Modules[current_effect]->Close)( );
}

View File

@ -1,7 +1,7 @@
#ifndef MODULE_H
#define MODULE_H
typedef void (*PtrToFuncVoid)( void );
typedef void (*PtrToFunc)( bopti_image_t * );
typedef void (*PtrToFuncDt)( bopti_image_t *, float );
typedef char* (*PtrTextFunc)( void );
@ -14,7 +14,7 @@ typedef struct
PtrToFunc Init;
PtrToFuncDt Update;
PtrToFunc Render;
PtrToFunc Close;
PtrToFuncVoid Close;
PtrImageFunc Miniature;
} Module_Register;