mirror of
https://github.com/projectM-visualizer/projectm.git
synced 2026-03-06 15:35:04 +00:00
almost finished with copy safe q variables
git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/trunk@403 6778bc44-b910-0410-a7a0-be141de4315d
This commit is contained in:
@ -169,6 +169,7 @@ CustomShape::CustomShape ( int id ) : imageUrl("")
|
||||
{
|
||||
DWRITE ( "%s\n", "failed to insert param!" );
|
||||
}
|
||||
|
||||
param = Param::new_param_float ( "t1", P_FLAG_TVAR, &this->t1, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0 );
|
||||
if ( ParamUtils::insert ( param, &this->param_tree ) < 0 )
|
||||
{
|
||||
@ -210,6 +211,47 @@ CustomShape::CustomShape ( int id ) : imageUrl("")
|
||||
DWRITE ( "%s\n", "failed to insert param!" );
|
||||
}
|
||||
|
||||
param = Param::new_param_float ( "q1", P_FLAG_QVAR, &this->q1, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0 );
|
||||
if ( ParamUtils::insert ( param, &this->param_tree ) < 0 )
|
||||
{
|
||||
DWRITE ( "%s\n", "failed to insert param!" );
|
||||
}
|
||||
param = Param::new_param_float ( "q2", P_FLAG_QVAR, &this->q2, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0 );
|
||||
if ( ParamUtils::insert ( param, &this->param_tree ) < 0 )
|
||||
{
|
||||
DWRITE ( "%s\n", "failed to insert param!" );
|
||||
}
|
||||
param = Param::new_param_float ( "q3", P_FLAG_QVAR, &this->q3, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0 );
|
||||
if ( ParamUtils::insert ( param, &this->param_tree ) < 0 )
|
||||
{
|
||||
DWRITE ( "%s\n", "failed to insert param!" );
|
||||
}
|
||||
param = Param::new_param_float ( "q4", P_FLAG_QVAR, &this->q4, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0 );
|
||||
if ( ParamUtils::insert ( param, &this->param_tree ) < 0 )
|
||||
{
|
||||
DWRITE ( "%s\n", "failed to insert param!" );
|
||||
}
|
||||
param = Param::new_param_float ( "q5", P_FLAG_QVAR, &this->q5, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0 );
|
||||
if ( ParamUtils::insert ( param, &this->param_tree ) < 0 )
|
||||
{
|
||||
DWRITE ( "%s\n", "failed to insert param!" );
|
||||
}
|
||||
param = Param::new_param_float ( "q6", P_FLAG_QVAR, &this->q6, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0 );
|
||||
if ( ParamUtils::insert ( param, &this->param_tree ) < 0 )
|
||||
{
|
||||
DWRITE ( "%s\n", "failed to insert param!" );
|
||||
}
|
||||
param = Param::new_param_float ( "q7", P_FLAG_QVAR, &this->q7, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0 );
|
||||
if ( ParamUtils::insert ( param, &this->param_tree ) < 0 )
|
||||
{
|
||||
DWRITE ( "%s\n", "failed to insert param!" );
|
||||
}
|
||||
param = Param::new_param_float ( "q8", P_FLAG_QVAR, &this->q8, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0 );
|
||||
if ( ParamUtils::insert ( param, &this->param_tree ) < 0 )
|
||||
{
|
||||
DWRITE ( "%s\n", "failed to insert param!" );
|
||||
}
|
||||
|
||||
param = Param::new_param_string ( "imageurl", P_FLAG_NONE, &this->imageUrl);
|
||||
if ( ParamUtils::insert ( param, &this->text_properties_tree ) < 0 )
|
||||
{
|
||||
@ -235,7 +277,6 @@ void CustomShape::loadUnspecInitConds()
|
||||
// NOTE: This is verified to be same behavior as trunk
|
||||
|
||||
InitCondUtils::LoadUnspecInitCond fun ( this->init_cond_tree, this->per_frame_init_eqn_tree );
|
||||
|
||||
traverse ( param_tree, fun );
|
||||
}
|
||||
|
||||
|
||||
@ -87,6 +87,15 @@ public:
|
||||
float t7;
|
||||
float t8;
|
||||
|
||||
/* stupider q variables */
|
||||
float q1;
|
||||
float q2;
|
||||
float q3;
|
||||
float q4;
|
||||
float q5;
|
||||
float q6;
|
||||
float q7;
|
||||
float q8;
|
||||
|
||||
// projectM exclusive parameter to load textures over a shape
|
||||
std::string imageUrl;
|
||||
|
||||
@ -426,6 +426,47 @@ CustomWave::CustomWave(int _id):
|
||||
abort();
|
||||
}
|
||||
|
||||
|
||||
param = Param::new_param_float ( "q1", P_FLAG_QVAR, &this->q1, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0 );
|
||||
if ( ParamUtils::insert ( param, &this->param_tree ) < 0 )
|
||||
{
|
||||
DWRITE ( "%s\n", "failed to insert param!" );
|
||||
}
|
||||
param = Param::new_param_float ( "q2", P_FLAG_QVAR, &this->q2, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0 );
|
||||
if ( ParamUtils::insert ( param, &this->param_tree ) < 0 )
|
||||
{
|
||||
DWRITE ( "%s\n", "failed to insert param!" );
|
||||
}
|
||||
param = Param::new_param_float ( "q3", P_FLAG_QVAR, &this->q3, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0 );
|
||||
if ( ParamUtils::insert ( param, &this->param_tree ) < 0 )
|
||||
{
|
||||
DWRITE ( "%s\n", "failed to insert param!" );
|
||||
}
|
||||
param = Param::new_param_float ( "q4", P_FLAG_QVAR, &this->q4, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0 );
|
||||
if ( ParamUtils::insert ( param, &this->param_tree ) < 0 )
|
||||
{
|
||||
DWRITE ( "%s\n", "failed to insert param!" );
|
||||
}
|
||||
param = Param::new_param_float ( "q5", P_FLAG_QVAR, &this->q5, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0 );
|
||||
if ( ParamUtils::insert ( param, &this->param_tree ) < 0 )
|
||||
{
|
||||
DWRITE ( "%s\n", "failed to insert param!" );
|
||||
}
|
||||
param = Param::new_param_float ( "q6", P_FLAG_QVAR, &this->q6, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0 );
|
||||
if ( ParamUtils::insert ( param, &this->param_tree ) < 0 )
|
||||
{
|
||||
DWRITE ( "%s\n", "failed to insert param!" );
|
||||
}
|
||||
param = Param::new_param_float ( "q7", P_FLAG_QVAR, &this->q7, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0 );
|
||||
if ( ParamUtils::insert ( param, &this->param_tree ) < 0 )
|
||||
{
|
||||
DWRITE ( "%s\n", "failed to insert param!" );
|
||||
}
|
||||
param = Param::new_param_float ( "q8", P_FLAG_QVAR, &this->q8, NULL, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, 0.0 );
|
||||
if ( ParamUtils::insert ( param, &this->param_tree ) < 0 )
|
||||
{
|
||||
DWRITE ( "%s\n", "failed to insert param!" );
|
||||
}
|
||||
/* End of parameter loading. Note that the read only parameters associated
|
||||
with custom waves (ie, sample) are variables stored in PresetFrameIO.hpp,
|
||||
and not specific to the custom wave datastructure. */
|
||||
|
||||
@ -107,6 +107,18 @@ public:
|
||||
float t6;
|
||||
float t7;
|
||||
float t8;
|
||||
|
||||
|
||||
/* stupider q variables */
|
||||
float q1;
|
||||
float q2;
|
||||
float q3;
|
||||
float q4;
|
||||
float q5;
|
||||
float q6;
|
||||
float q7;
|
||||
float q8;
|
||||
|
||||
float v1,v2;
|
||||
|
||||
/* Data structures to hold per frame and per point equations */
|
||||
|
||||
@ -30,12 +30,12 @@ inline void LoadUnspecInitCond::operator() (Param * param) {
|
||||
/* Don't count these parameters as initial conditions */
|
||||
if (param->flags & P_FLAG_READONLY)
|
||||
return;
|
||||
if (param->flags & P_FLAG_QVAR)
|
||||
return;
|
||||
if (param->flags & P_FLAG_TVAR)
|
||||
return;
|
||||
if (param->flags & P_FLAG_USERDEF)
|
||||
return;
|
||||
// if (param->flags & P_FLAG_QVAR)
|
||||
// return;
|
||||
// if (param->flags & P_FLAG_TVAR)
|
||||
// return;
|
||||
// if (param->flags & P_FLAG_USERDEF)
|
||||
// return;
|
||||
|
||||
/* If initial condition was not defined by the preset file, force a default one
|
||||
with the following code */
|
||||
|
||||
@ -2162,7 +2162,7 @@ int Parser::parse_shape_per_frame_init_eqn(std::istream & fs, CustomShape * cus
|
||||
return PROJECTM_SUCCESS;
|
||||
}
|
||||
|
||||
int Parser::parse_shape_per_frame_eqn(std::istream & fs, CustomShape * custom_shape, Preset * preset) {
|
||||
int Parser::parse_shape_per_frame_eqn(std::istream & fs, CustomShape * custom_shape, Preset * preset) {
|
||||
|
||||
Param * param;
|
||||
GenExpr * gen_expr;
|
||||
@ -2187,7 +2187,7 @@ if (PARSE_DEBUG) printf("parse_shape (per_frame): [start] (custom shape id = %d)
|
||||
/* Make sure parameter is writable */
|
||||
if (param->flags & P_FLAG_READONLY) {
|
||||
if (PARSE_DEBUG) printf("parse_shape (per_frame): parameter %s is marked as read only (LINE %d)\n", param->name.c_str(), line_count);
|
||||
return PROJECTM_FAILURE;
|
||||
return PROJECTM_PARSE_ERROR;
|
||||
}
|
||||
|
||||
/* Parse right side of equation as an expression */
|
||||
|
||||
@ -223,6 +223,7 @@ void Preset::evalCustomShapePerFrameEquations()
|
||||
assert(_pos->second);
|
||||
_pos->second->evaluate();
|
||||
}
|
||||
|
||||
std::map<int, PerFrameEqn*> & per_frame_eqn_tree = (*pos)->per_frame_eqn_tree;
|
||||
for (std::map<int, PerFrameEqn*>::iterator _pos = per_frame_eqn_tree.begin(); _pos != per_frame_eqn_tree.end(); ++_pos)
|
||||
{
|
||||
@ -339,6 +340,7 @@ void Preset::loadBuiltinParamsUnspecInitConds() {
|
||||
InitCondUtils::LoadUnspecInitCond loadUnspecInitCond(this->init_cond_tree, this->per_frame_init_eqn_tree);
|
||||
|
||||
this->builtinParams.traverse(loadUnspecInitCond);
|
||||
Algorithms::traverse(user_param_tree, loadUnspecInitCond);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user