added permanent effect option + effect selection menu by user with miniatures
This commit is contained in:
parent
e6747bd361
commit
8ee1cf8762
27
src/main.cpp
27
src/main.cpp
|
@ -56,6 +56,15 @@ int next_effect_menu = 0;
|
|||
#endif
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
FIRST_LOOP_OPTION,
|
||||
STATIC,
|
||||
LOOP_CYCLE,
|
||||
LOOP_AUTOREVERSE,
|
||||
LAST_LOOP_OPTION,
|
||||
};
|
||||
|
||||
|
||||
bool exitToOS = false;
|
||||
bool skip_intro = false;
|
||||
|
@ -64,7 +73,7 @@ bool record = false;
|
|||
bool showFPS = false;
|
||||
bool showName = true;
|
||||
bool showOption = false;
|
||||
bool EffectLoop = true;
|
||||
int EffectLoop = LOOP_CYCLE;
|
||||
|
||||
bool changeEffectMenu = false;
|
||||
|
||||
|
@ -251,7 +260,8 @@ static void GetInputsOption( [[maybe_unused]] float dt )
|
|||
showName = !showName;
|
||||
break;
|
||||
case 3:
|
||||
EffectLoop = !EffectLoop;
|
||||
EffectLoop--;
|
||||
if (EffectLoop==FIRST_LOOP_OPTION) EffectLoop=LAST_LOOP_OPTION-1;
|
||||
break;
|
||||
case 4:
|
||||
effect_duration_seconds--;
|
||||
|
@ -270,7 +280,8 @@ static void GetInputsOption( [[maybe_unused]] float dt )
|
|||
showName = !showName;
|
||||
break;
|
||||
case 3:
|
||||
EffectLoop = !EffectLoop;
|
||||
EffectLoop++;
|
||||
if (EffectLoop==LAST_LOOP_OPTION) EffectLoop=FIRST_LOOP_OPTION+1;
|
||||
break;
|
||||
case 4:
|
||||
effect_duration_seconds++;
|
||||
|
@ -298,8 +309,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 == false ? "< Autoreverse >" : "< Loop >" );
|
||||
dprint( (DWIDTH-w)/2 +25, (MAXHEIGHT-h)/2 +45, MenuOptionSelected==3 ? RGB565_LEMONYELLOW : RGB565_WHITE, "Cycling : %s", EffectLoop == false ? "< Autoreverse >" : "< Loop >" );
|
||||
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 +66, C_RED, "Effect Duration : < %d s >", effect_duration_seconds );
|
||||
dprint( (DWIDTH-w)/2 +25, (MAXHEIGHT-h)/2 +65, MenuOptionSelected==4 ? RGB565_LEMONYELLOW : RGB565_WHITE, "Effect Duration : < %d s >", effect_duration_seconds );
|
||||
|
@ -322,6 +333,8 @@ static void GetInputsEffectSelection( [[maybe_unused]] float dt )
|
|||
timeSinceLastEffect = 0.0f;
|
||||
|
||||
Initialise();
|
||||
|
||||
changeEffectMenu = !changeEffectMenu;
|
||||
}
|
||||
|
||||
if (Keyboard.IsKeyPressedEvent(MYKEY_LEFT))
|
||||
|
@ -482,7 +495,7 @@ int main(void)
|
|||
timeSinceLastEffect += elapsedTime / 1000000.0f;
|
||||
if (timeSinceLastEffect >= effect_duration_seconds)
|
||||
{
|
||||
if(EffectLoop)
|
||||
if(EffectLoop == LOOP_CYCLE)
|
||||
{
|
||||
Close();
|
||||
|
||||
|
@ -494,7 +507,7 @@ int main(void)
|
|||
|
||||
Initialise();
|
||||
}
|
||||
else
|
||||
else if(EffectLoop == LOOP_AUTOREVERSE)
|
||||
{
|
||||
if(!reverse)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue