Commit 864cc275 authored by David Llewellyn-Jones's avatar David Llewellyn-Jones

Moved to version 0.37. Audio frequency animation extended to software as well...

Moved to version 0.37. Audio frequency animation extended to software as well as GPU-rendered functions.
parent 09b3fe71
Functy-0.37: 6-August-2015
- Audio frequency animation extended to software as well as GPU-rendered functions.
Functy-0.36: 5-August-2015
- Initial support for function animation using real-time audio frequency analysis
- Initial support for function animation using real-time audio frequency analysis.
Functy-0.35: 10-May-2015
- Added config scripts
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for Functy 0.36.
# Generated by GNU Autoconf 2.69 for Functy 0.37.
#
# Report bugs to <david@flypig.co.uk>.
#
......@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='Functy'
PACKAGE_TARNAME='functy'
PACKAGE_VERSION='0.36'
PACKAGE_STRING='Functy 0.36'
PACKAGE_VERSION='0.37'
PACKAGE_STRING='Functy 0.37'
PACKAGE_BUGREPORT='david@flypig.co.uk'
PACKAGE_URL=''
......@@ -1294,7 +1294,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures Functy 0.36 to adapt to many kinds of systems.
\`configure' configures Functy 0.37 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1360,7 +1360,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of Functy 0.36:";;
short | recursive ) echo "Configuration of Functy 0.37:";;
esac
cat <<\_ACEOF
......@@ -1469,7 +1469,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
Functy configure 0.36
Functy configure 0.37
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -1930,7 +1930,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by Functy $as_me 0.36, which was
It was created by Functy $as_me 0.37, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -2793,7 +2793,7 @@ fi
# Define the identity of the package.
PACKAGE='functy'
VERSION='0.36'
VERSION='0.37'
cat >>confdefs.h <<_ACEOF
......@@ -6553,7 +6553,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by Functy $as_me 0.36, which was
This file was extended by Functy $as_me 0.37, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -6619,7 +6619,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
Functy config.status 0.36
Functy config.status 0.37
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
......@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT([Functy], [0.36], [david@flypig.co.uk])
AC_INIT([Functy], [0.37], [david@flypig.co.uk])
AC_CONFIG_AUX_DIR([config])
AM_INIT_AUTOMAKE([-Wall -Werror])
AC_CONFIG_SRCDIR([src/functy.c])
......
functy (0.37.0-1) unstable; urgency=low
* Audio frequency animation extended to software as well as GPU-rendered functions.
-- David Llewellyn-Jones <david@flypig.co.uk> Thu, 6 Aug 2015 22:03:45 +0100
functy (0.36.0-1) unstable; urgency=low
* Initial support for function animation using real-time audio frequency analysis
......
......@@ -372,7 +372,21 @@ pa_stream * AudioGetRecordStream (AudioPersist * psAudioData) {
// Test user function approximate
double AudioApproximate (double fVar1, void * psContext) {
return 0.0;
AudioPersist * psAudioData = (AudioPersist *)psContext;
int nStart;
int nEnd;
float fInterpolate;
float fAmplitude;
float fFrequency;
fFrequency = fmodf (fVar1* AUDIO_BARS, AUDIO_BARS);
nStart = (int)(fFrequency);
nEnd = (nStart + 1) % AUDIO_BARS;
fInterpolate = (fFrequency) - floor (fFrequency);
fAmplitude = ((fInterpolate * psAudioData->auBars[nStart]) + ((1.0 - fInterpolate) * psAudioData->auBars[nEnd])) / 256.0;
return fAmplitude;
}
// Test user function differentiate
......
......@@ -100,6 +100,7 @@ void CartesianSetFunction (char const * const szFunction, FuncPersist * psFuncDa
Operation * psWRT;
char * szShaderFunction;
int nFunctionLen;
int nUserAssigned = 0;
// Free up any previous function
FreeRecursive (psFuncData->psFunction);
......@@ -108,6 +109,7 @@ void CartesianSetFunction (char const * const szFunction, FuncPersist * psFuncDa
psFuncData->psVariables = FreeVariables (psFuncData->psVariables);
psFuncData->psFunction = StringToOperation (szFunction);
nUserAssigned += AssignAllUserFuncs (psFuncData->psFunction, psFuncData->psUserFuncs);
psFuncData->psFunction = UberSimplifyOperation (psFuncData->psFunction);
// Differentiate with respect to x
......@@ -140,7 +142,9 @@ void CartesianSetFunction (char const * const szFunction, FuncPersist * psFuncDa
g_string_assign (psFuncData->szFunction, szFunction);
// Figure out if the functions are time dependent
psFuncData->boTimeDependent = (psFuncData->psVariableT != NULL);
//psFuncData->boTimeDependent = (psFuncData->psVariableT != NULL) || (nUserAssigned > 0);
SETBIT (psFuncData->uTimeDependent, (psFuncData->psVariableT != NULL), 0);
SETBIT (psFuncData->uTimeDependent, (nUserAssigned > 0), 1);
// Transfer the function details to the shader
nFunctionLen = OperationToStringCLength (psFuncData->psFunction);
......@@ -167,6 +171,7 @@ void CartesianSetFunctionColours (char const * const szRed, char const * const s
double fApproximate;
char * szShaderFunction;
int nFunctionLen;
int nUserAssigned = 0;
// Free up any previous function
FreeRecursive (psFuncData->psRed);
......@@ -176,12 +181,16 @@ void CartesianSetFunctionColours (char const * const szRed, char const * const s
psFuncData->psVariables = FreeVariables (psFuncData->psVariables);
psFuncData->psRed = StringToOperation (szRed);
nUserAssigned += AssignAllUserFuncs (psFuncData->psRed, psFuncData->psUserFuncs);
psFuncData->psRed = UberSimplifyOperation (psFuncData->psRed);
psFuncData->psGreen = StringToOperation (szGreen);
nUserAssigned += AssignAllUserFuncs (psFuncData->psGreen, psFuncData->psUserFuncs);
psFuncData->psGreen = UberSimplifyOperation (psFuncData->psGreen);
psFuncData->psBlue = StringToOperation (szBlue);
nUserAssigned += AssignAllUserFuncs (psFuncData->psBlue, psFuncData->psUserFuncs);
psFuncData->psBlue = UberSimplifyOperation (psFuncData->psBlue);
psFuncData->psAlpha = StringToOperation (szAlpha);
nUserAssigned += AssignAllUserFuncs (psFuncData->psAlpha, psFuncData->psUserFuncs);
psFuncData->psAlpha = UberSimplifyOperation (psFuncData->psAlpha);
// Check if we can avoid recalculating the colour for every vertex
......@@ -206,6 +215,9 @@ void CartesianSetFunctionColours (char const * const szRed, char const * const s
if (isnan (fApproximate)) {
psFuncData->boColourFunction = TRUE;
}
if (nUserAssigned > 0) {
psFuncData->boColourFunction = TRUE;
}
// Set up the variables
psFuncData->psVariables = CreateVariables (psFuncData->psRed, psFuncData->psVariables);
......@@ -229,7 +241,9 @@ void CartesianSetFunctionColours (char const * const szRed, char const * const s
g_string_assign (psFuncData->szAlpha, szAlpha);
// Figure out if the functions are time dependent
psFuncData->boTimeDependent = (psFuncData->psVariableT != NULL);
//psFuncData->boTimeDependent = (psFuncData->psVariableT != NULL) || (nUserAssigned > 0);
SETBIT (psFuncData->uTimeDependent, (psFuncData->psVariableT != NULL), 0);
SETBIT (psFuncData->uTimeDependent, (nUserAssigned > 0), 2);
// Transfer the colour details to the shader
nFunctionLen = OperationToStringCLength (psFuncData->psRed);
......
......@@ -237,6 +237,7 @@ void DeleteCurvePersist (CurvePersist * psCurveData) {
void CurveSetFunction (char const * const szXFunction, char const * const szYFunction, char const * const szZFunction, char const * const szRadius, FuncPersist * psFuncData) {
CurvePersist * psCurveData = psFuncData->Func.psCurveData;
int nUserAssigned = 0;
// Create the symbolic function vector if it doesn't already exit
if (psCurveData->pvCurve == NULL) {
......@@ -250,6 +251,7 @@ void CurveSetFunction (char const * const szXFunction, char const * const szYFun
}
// Set the new function
psCurveData->pvCurve->psX = StringToOperation (szXFunction);
nUserAssigned += AssignAllUserFuncs (psCurveData->pvCurve->psX, psFuncData->psUserFuncs);
psCurveData->pvCurve->psX = UberSimplifyOperation (psCurveData->pvCurve->psX);
// Set up the handy UI-related data
g_string_assign (psCurveData->szXFunction, szXFunction);
......@@ -262,6 +264,7 @@ void CurveSetFunction (char const * const szXFunction, char const * const szYFun
}
// Set the new function
psCurveData->pvCurve->psY = StringToOperation (szYFunction);
nUserAssigned += AssignAllUserFuncs (psCurveData->pvCurve->psY, psFuncData->psUserFuncs);
psCurveData->pvCurve->psY = UberSimplifyOperation (psCurveData->pvCurve->psY);
// Set up the handy UI-related data
g_string_assign (psCurveData->szYFunction, szYFunction);
......@@ -274,6 +277,7 @@ void CurveSetFunction (char const * const szXFunction, char const * const szYFun
}
// Set the new function
psCurveData->pvCurve->psZ = StringToOperation (szZFunction);
nUserAssigned += AssignAllUserFuncs (psCurveData->pvCurve->psZ, psFuncData->psUserFuncs);
psCurveData->pvCurve->psZ = UberSimplifyOperation (psCurveData->pvCurve->psZ);
// Set up the handy UI-related data
g_string_assign (psCurveData->szZFunction, szZFunction);
......@@ -286,14 +290,19 @@ void CurveSetFunction (char const * const szXFunction, char const * const szYFun
}
// Set the new function
psFuncData->psFunction = StringToOperation (szRadius);
nUserAssigned += AssignAllUserFuncs (psFuncData->psFunction, psFuncData->psUserFuncs);
psFuncData->psFunction = UberSimplifyOperation (psFuncData->psFunction);
// Set up the handy UI-related data
g_string_assign (psFuncData->szFunction, szRadius);
}
CurveDeriveFunctions (psFuncData);
//psFuncData->boTimeDependent |= (nUserAssigned > 0);
SETBIT (psFuncData->uTimeDependent, (nUserAssigned > 0), 1);
}
void CurveDeriveFunctions (FuncPersist * psFuncData) {
CurvePersist * psCurveData = psFuncData->Func.psCurveData;
Operation * psDerivA;
......@@ -356,7 +365,8 @@ void CurveDeriveFunctions (FuncPersist * psFuncData) {
psFuncData->psVariableT = FindVariable (psFuncData->psVariables, "t");
// Figure out if the functions are time dependent
psFuncData->boTimeDependent = (psFuncData->psVariableT != NULL);
//psFuncData->boTimeDependent = (psFuncData->psVariableT != NULL);
SETBIT (psFuncData->uTimeDependent, (psFuncData->psVariableT != NULL), 0);
FreeRecursive (psDerivA);
FreeRecursive (psDerivP);
......@@ -803,6 +813,7 @@ void CurveSetFunctionColours (char const * const szRed, char const * const szGre
double fApproximate;
int nFunctionLen;
char * szShaderFunction;
int nUserAssigned = 0;
// Free up any previous function
FreeRecursive (psFuncData->psRed);
......@@ -812,12 +823,16 @@ void CurveSetFunctionColours (char const * const szRed, char const * const szGre
psFuncData->psVariables = FreeVariables (psFuncData->psVariables);
psFuncData->psRed = StringToOperation (szRed);
nUserAssigned += AssignAllUserFuncs (psFuncData->psRed, psFuncData->psUserFuncs);
psFuncData->psRed = UberSimplifyOperation (psFuncData->psRed);
psFuncData->psGreen = StringToOperation (szGreen);
nUserAssigned += AssignAllUserFuncs (psFuncData->psGreen, psFuncData->psUserFuncs);
psFuncData->psGreen = UberSimplifyOperation (psFuncData->psGreen);
psFuncData->psBlue = StringToOperation (szBlue);
nUserAssigned += AssignAllUserFuncs (psFuncData->psBlue, psFuncData->psUserFuncs);
psFuncData->psBlue = UberSimplifyOperation (psFuncData->psBlue);
psFuncData->psAlpha = StringToOperation (szAlpha);
nUserAssigned += AssignAllUserFuncs (psFuncData->psAlpha, psFuncData->psUserFuncs);
psFuncData->psAlpha = UberSimplifyOperation (psFuncData->psAlpha);
// Check if we can avoid recalculating the colour for every vertex
......@@ -842,6 +857,9 @@ void CurveSetFunctionColours (char const * const szRed, char const * const szGre
if (isnan (fApproximate)) {
psFuncData->boColourFunction = TRUE;
}
if (nUserAssigned > 0) {
psFuncData->boColourFunction = TRUE;
}
// Set up the variables
psFuncData->psVariables = CreateVariables (psFuncData->psRed, psFuncData->psVariables);
......@@ -859,7 +877,9 @@ void CurveSetFunctionColours (char const * const szRed, char const * const szGre
g_string_assign (psFuncData->szAlpha, szAlpha);
// Figure out if the functions are time dependent
psFuncData->boTimeDependent = (psFuncData->psVariableT != NULL);
//psFuncData->boTimeDependent = (psFuncData->psVariableT != NULL) || (nUserAssigned > 0);
SETBIT (psFuncData->uTimeDependent, (psFuncData->psVariableT != NULL), 0);
SETBIT (psFuncData->uTimeDependent, (nUserAssigned > 0), 2);
// Transfer the colour details to the shader
nFunctionLen = OperationToStringCLength (psFuncData->psRed);
......@@ -940,6 +960,7 @@ char const * CurveGetZCentreString (FuncPersist * psFuncData) {
void CurveSetFunctionCentre (char const * const szXCentre, char const * const szYCentre, char const * const szZCentre, FuncPersist * psFuncData) {
CurvePersist * psCurveData = psFuncData->Func.psCurveData;
int nUserAssigned = 0;
// Free up any previous function
FreeRecursive (psCurveData->psXCentre);
......@@ -948,10 +969,13 @@ void CurveSetFunctionCentre (char const * const szXCentre, char const * const sz
psCurveData->psCentreVariables = FreeVariables (psCurveData->psCentreVariables);
psCurveData->psXCentre = StringToOperation (szXCentre);
nUserAssigned += AssignAllUserFuncs (psCurveData->psXCentre, psFuncData->psUserFuncs);
psCurveData->psXCentre = UberSimplifyOperation (psCurveData->psXCentre);
psCurveData->psYCentre = StringToOperation (szYCentre);
nUserAssigned += AssignAllUserFuncs (psCurveData->psYCentre, psFuncData->psUserFuncs);
psCurveData->psYCentre = UberSimplifyOperation (psCurveData->psYCentre);
psCurveData->psZCentre = StringToOperation (szZCentre);
nUserAssigned += AssignAllUserFuncs (psCurveData->psZCentre, psFuncData->psUserFuncs);
psCurveData->psZCentre = UberSimplifyOperation (psCurveData->psZCentre);
// Set up the variables
......@@ -973,7 +997,7 @@ void CurveSetFunctionCentre (char const * const szXCentre, char const * const sz
g_string_assign (psCurveData->szZCentre, szZCentre);
// Figure out if the functions are time dependent
psCurveData->boCentreTimeDependent = (psCurveData->psCentreVariableT != NULL);
psCurveData->boCentreTimeDependent = (psCurveData->psCentreVariableT != NULL) || (nUserAssigned > 0);
AddUndefinedControlVars (psFuncData->psVariables, psFuncData->psFnControlData);
AssignControlVarsToVariables (psCurveData->psCentreVariables, psFuncData->psFnControlData);
......
......@@ -106,7 +106,7 @@ FuncPersist * NewFuncPersist (FUNCTYPE eType) {
psFuncData->szBlue = g_string_new ("0.5");
psFuncData->szAlpha = g_string_new ("0.9");
psFuncData->boTimeDependent = FALSE;
psFuncData->uTimeDependent = 0u;
psFuncData->psShaderData = NULL;
psFuncData->szShaderVertexSource = NULL;
psFuncData->szShaderFragmentSource = NULL;
......@@ -139,6 +139,9 @@ FuncPersist * NewFuncPersist (FUNCTYPE eType) {
psFuncData->boMaterialFill = FALSE;
psFuncData->fMaterialThickness = 0.1f;
// Audio
psFuncData->psUserFuncs = NULL;
return psFuncData;
}
......@@ -273,6 +276,9 @@ void DeleteFuncPersist (FuncPersist * psFuncData) {
// Clear the texture data (will be freed in vis)
psFuncData->psTexData = NULL;
// Clear the audio user function data (will be freed in vis)
psFuncData->psUserFuncs = NULL;
g_free (psFuncData);
}
......@@ -280,6 +286,10 @@ void SetFunctionTextureData (TexPersist * psTexData, FuncPersist * psFuncData) {
psFuncData->psTexData = psTexData;
}
void SetFunctionUserFuncs (UserFunc * psUserFuncs, FuncPersist * psFuncData) {
psFuncData->psUserFuncs = psUserFuncs;
}
void InitShader (FuncPersist * psFuncData) {
if (psFuncData->psShaderData == NULL) {
psFuncData->psShaderData = NewShaderPersist ();
......@@ -775,7 +785,7 @@ void GenerateVertices (FuncPersist * psFuncData) {
}
bool GetTimeDependent (FuncPersist * psFuncData) {
return psFuncData->boTimeDependent;
return (psFuncData->uTimeDependent != 0);
}
bool GetCentreTimeDependent (FuncPersist const * psFuncData) {
......
......@@ -54,6 +54,7 @@ void SetFunction (char const * const szFunction, FuncPersist * psFuncData);
void SetFunctionName (char const * const szName, FuncPersist * psFuncData);
void SetFunctionColours (char const * const szRed, char const * const szGreen, char const * const szBlue, char const * const szAlpha, FuncPersist * psFuncData);
void SetFunctionTextureData (TexPersist * psTexData, FuncPersist * psFuncData);
void SetFunctionUserFuncs (UserFunc * psUserFuncs, FuncPersist * psFuncData);
char const * GetFunctionName (FuncPersist * psFuncData);
char const * GetFunctionString (FuncPersist * psFuncData);
char const * GetRedString (FuncPersist * psFuncData);
......
......@@ -24,6 +24,8 @@
///////////////////////////////////////////////////////////////////
// Defines
#define SETBIT(var, value, bit) var ^= (-(value) ^ (var)) & (1 << bit)
///////////////////////////////////////////////////////////////////
// Structures and enumerations
......@@ -88,7 +90,10 @@ struct _FuncPersist {
GLfloat * afTextureCoords;
// Time related variables
bool boTimeDependent;
// bit 0: Function or colours includes time
// bit 1: Function includes audio
// bit 2: Colours include audio
unsigned int uTimeDependent;
// Shader related variables
char * szShaderVertexSource;
......@@ -115,6 +120,9 @@ struct _FuncPersist {
// Material variables
bool boMaterialFill;
float fMaterialThickness;
// Audio
UserFunc * psUserFuncs;
};
///////////////////////////////////////////////////////////////////
......
......@@ -147,6 +147,7 @@ void SphericalSetFunction (char const * const szFunction, FuncPersist * psFuncDa
Operation * psWRT;
char * szShaderFunction;
int nFunctionLen;
int nUserAssigned = 0;
// Free up any previous function
FreeRecursive (psFuncData->psFunction);
......@@ -155,6 +156,7 @@ void SphericalSetFunction (char const * const szFunction, FuncPersist * psFuncDa
psFuncData->psVariables = FreeVariables (psFuncData->psVariables);
psFuncData->psFunction = StringToOperation (szFunction);
nUserAssigned += AssignAllUserFuncs (psFuncData->psFunction, psFuncData->psUserFuncs);
psFuncData->psFunction = UberSimplifyOperation (psFuncData->psFunction);
// Differentiate with respect to a
......@@ -187,7 +189,9 @@ void SphericalSetFunction (char const * const szFunction, FuncPersist * psFuncDa
g_string_assign (psFuncData->szFunction, szFunction);
// Figure out if the functions are time dependent
psFuncData->boTimeDependent = (psFuncData->psVariableT != NULL);
//psFuncData->boTimeDependent = (psFuncData->psVariableT != NULL) || (nUserAssigned > 0);
SETBIT (psFuncData->uTimeDependent, (psFuncData->psVariableT != NULL), 0);
SETBIT (psFuncData->uTimeDependent, (nUserAssigned > 0), 2);
// Transfer the function details to the shader
nFunctionLen = OperationToStringCLength (psFuncData->psFunction);
......@@ -214,6 +218,7 @@ void SphericalSetFunctionColours (char const * const szRed, char const * const s
double fApproximate;
char * szShaderFunction;
int nFunctionLen;
int nUserAssigned = 0;
// Free up any previous function
FreeRecursive (psFuncData->psRed);
......@@ -223,12 +228,16 @@ void SphericalSetFunctionColours (char const * const szRed, char const * const s
psFuncData->psVariables = FreeVariables (psFuncData->psVariables);
psFuncData->psRed = StringToOperation (szRed);
nUserAssigned += AssignAllUserFuncs (psFuncData->psRed, psFuncData->psUserFuncs);
psFuncData->psRed = UberSimplifyOperation (psFuncData->psRed);
psFuncData->psGreen = StringToOperation (szGreen);
nUserAssigned += AssignAllUserFuncs (psFuncData->psGreen, psFuncData->psUserFuncs);
psFuncData->psGreen = UberSimplifyOperation (psFuncData->psGreen);
psFuncData->psBlue = StringToOperation (szBlue);
nUserAssigned += AssignAllUserFuncs (psFuncData->psBlue, psFuncData->psUserFuncs);
psFuncData->psBlue = UberSimplifyOperation (psFuncData->psBlue);
psFuncData->psAlpha = StringToOperation (szAlpha);
nUserAssigned += AssignAllUserFuncs (psFuncData->psAlpha, psFuncData->psUserFuncs);
psFuncData->psAlpha = UberSimplifyOperation (psFuncData->psAlpha);
// Check if we can avoid recalculating the colour for every vertex
......@@ -253,6 +262,9 @@ void SphericalSetFunctionColours (char const * const szRed, char const * const s
if (isnan (fApproximate)) {
psFuncData->boColourFunction = TRUE;
}
if (nUserAssigned > 0) {
psFuncData->boColourFunction = TRUE;
}
// Set up the variables
psFuncData->psVariables = CreateVariables (psFuncData->psRed, psFuncData->psVariables);
......@@ -276,7 +288,9 @@ void SphericalSetFunctionColours (char const * const szRed, char const * const s
g_string_assign (psFuncData->szAlpha, szAlpha);
// Figure out if the functions are time dependent
psFuncData->boTimeDependent = (psFuncData->psVariableT != NULL);
//psFuncData->boTimeDependent = (psFuncData->psVariableT != NULL) || (nUserAssigned > 0);
SETBIT (psFuncData->uTimeDependent, (psFuncData->psVariableT != NULL), 0);
SETBIT (psFuncData->uTimeDependent, (nUserAssigned > 0), 1);
// Transfer the colour details to the shader
nFunctionLen = OperationToStringCLength (psFuncData->psRed);
......@@ -611,6 +625,7 @@ char const * SphericalGetZCentreString (FuncPersist * psFuncData) {
void SphericalSetFunctionCentre (char const * const szXCentre, char const * const szYCentre, char const * const szZCentre, FuncPersist * psFuncData) {
SphericalPersist * psSphericalData = psFuncData->Func.psSphericalData;
int nUserAssigned = 0;
// Free up any previous function
FreeRecursive (psSphericalData->psXCentre);
......@@ -619,10 +634,13 @@ void SphericalSetFunctionCentre (char const * const szXCentre, char const * cons
psSphericalData->psCentreVariables = FreeVariables (psSphericalData->psCentreVariables);
psSphericalData->psXCentre = StringToOperation (szXCentre);
nUserAssigned += AssignAllUserFuncs (psSphericalData->psXCentre, psFuncData->psUserFuncs);
psSphericalData->psXCentre = UberSimplifyOperation (psSphericalData->psXCentre);
psSphericalData->psYCentre = StringToOperation (szYCentre);
nUserAssigned += AssignAllUserFuncs (psSphericalData->psYCentre, psFuncData->psUserFuncs);
psSphericalData->psYCentre = UberSimplifyOperation (psSphericalData->psYCentre);
psSphericalData->psZCentre = StringToOperation (szZCentre);
nUserAssigned += AssignAllUserFuncs (psSphericalData->psZCentre, psFuncData->psUserFuncs);
psSphericalData->psZCentre = UberSimplifyOperation (psSphericalData->psZCentre);
// Set up the variables
......@@ -644,7 +662,7 @@ void SphericalSetFunctionCentre (char const * const szXCentre, char const * cons
g_string_assign (psSphericalData->szZCentre, szZCentre);
// Figure out if the functions are time dependent
psSphericalData->boCentreTimeDependent = (psSphericalData->psCentreVariableT != NULL);
psSphericalData->boCentreTimeDependent = (psSphericalData->psCentreVariableT != NULL) || (nUserAssigned > 0);
AddUndefinedControlVars (psFuncData->psVariables, psFuncData->psFnControlData);
AssignControlVarsToVariables (psSphericalData->psCentreVariables, psFuncData->psFnControlData);
......
......@@ -368,7 +368,7 @@ VisPersist * NewVisPersist (void) {
SetAudioTextureData (psVisData->psTexData, psVisData->psAudioData);
psVisData->psUserFuncs = NULL;
psVisData->psUserFuncs = AddNewUserFunc (psVisData->psUserFuncs, "audio");
SetUserFuncCallbacks (psVisData->psUserFuncs, AudioApproximate, AudioDifferentiate, AudioSimplify, NULL);
SetUserFuncCallbacks (psVisData->psUserFuncs, AudioApproximate, AudioDifferentiate, AudioSimplify, psVisData->psAudioData);
return psVisData;
}
......@@ -424,6 +424,7 @@ FuncPersist * AddNewFunction (FUNCTYPE eType, VisPersist * psVisData) {
SetFunctionTexture (TEXTURE_NONE, psFuncData);
SetFunctionControlVars (psVisData->psFnControlData, psFuncData);
SetFunctionShadowData (psVisData->psShadowData, psFuncData);
SetFunctionUserFuncs (psVisData->psUserFuncs, psFuncData);
uFunctionCount = GetFunctionCount (psVisData);
szName = g_string_new ("");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment