|
|
@ -39,24 +39,35 @@ static TQString getSavePath(void)
|
|
|
|
return dirs.saveLocation("data", "noatun/") + "tylerstates";
|
|
|
|
return dirs.saveLocation("data", "noatun/") + "tylerstates";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
extern "C" void save_effect(t_effect *effect)
|
|
|
|
extern "C"
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
KDE_EXPORT void save_effect(t_effect *effect)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQFile file(getSavePath());
|
|
|
|
TQFile file(getSavePath());
|
|
|
|
if(!file.open(IO_WriteOnly))
|
|
|
|
if(!file.open(IO_WriteOnly))
|
|
|
|
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for(unsigned i = 0; i < sizeof(t_effect); i++)
|
|
|
|
for(unsigned i = 0; i < sizeof(t_effect); i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
file.putch( *((byte *)effect + i) );
|
|
|
|
file.putch( *((byte *)effect + i) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
t_effect effects[100];
|
|
|
|
t_effect effects[100];
|
|
|
|
int nb_effects=0;
|
|
|
|
int nb_effects=0;
|
|
|
|
|
|
|
|
|
|
|
|
extern "C" void load_effects()
|
|
|
|
extern "C"
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
KDE_EXPORT void load_effects()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQFile file(getDataPath());
|
|
|
|
TQFile file(getDataPath());
|
|
|
|
if(!file.open(IO_ReadOnly))
|
|
|
|
if(!file.open(IO_ReadOnly))
|
|
|
|
|
|
|
|
{
|
|
|
|
exit(1);
|
|
|
|
exit(1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int i;
|
|
|
|
unsigned int i;
|
|
|
|
nb_effects = 0;
|
|
|
|
nb_effects = 0;
|
|
|
@ -64,11 +75,16 @@ extern "C" void load_effects()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
byte* ptr_effect = (byte *)&effects[nb_effects++];
|
|
|
|
byte* ptr_effect = (byte *)&effects[nb_effects++];
|
|
|
|
for(i = 0; i < sizeof(t_effect); i++)
|
|
|
|
for(i = 0; i < sizeof(t_effect); i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
ptr_effect[i] = file.getch();
|
|
|
|
ptr_effect[i] = file.getch();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
extern "C" void load_random_effect(t_effect *effect)
|
|
|
|
extern "C"
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
KDE_EXPORT void load_random_effect(t_effect *effect)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(nb_effects > 0)
|
|
|
|
if(nb_effects > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -76,6 +92,9 @@ extern "C" void load_random_effect(t_effect *effect)
|
|
|
|
unsigned int i;
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
|
|
|
|
for(i = 0; i < sizeof(t_effect) ; i++)
|
|
|
|
for(i = 0; i < sizeof(t_effect) ; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
*((byte*)effect+i) = *((byte*)(&effects[num_effect])+i);
|
|
|
|
*((byte*)effect+i) = *((byte*)(&effects[num_effect])+i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|