mirror of
https://github.com/projectM-visualizer/projectm.git
synced 2026-03-30 11:13:51 +00:00
refactored code builds! seriously broken however
git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/personal/carm/dev-1.0@196 6778bc44-b910-0410-a7a0-be141de4315d
This commit is contained in:
@ -27,7 +27,7 @@
|
||||
#include "common.h"
|
||||
#include "fatal.h"
|
||||
|
||||
#include "builtin_funcs.h"
|
||||
#include "BuiltinFuncs.hpp"
|
||||
#include "CustomWave.h"
|
||||
#include "CustomShape.h"
|
||||
#include "Expr.h"
|
||||
@ -35,7 +35,7 @@
|
||||
#include "Func.h"
|
||||
#include "InitCond.h"
|
||||
#include "Param.h"
|
||||
#include "Preset.h"
|
||||
#include "Preset.hpp"
|
||||
#include "Parser.h"
|
||||
#include "PerFrameEqn.h"
|
||||
#include "PerPixelEqn.h"
|
||||
@ -260,9 +260,9 @@ if (init_string != 0) {
|
||||
|
||||
/* Add the per pixel equation */
|
||||
if (preset->add_per_pixel_eqn(string, gen_expr) < 0) {
|
||||
if (PARSE_DEBUG) {
|
||||
DWRITE( "parse_per_pixel: no param associated with \"%s\" (LINE %d)", string, line_count);
|
||||
|
||||
if (PARSE_DEBUG) {
|
||||
DWRITE( "parse_per_pixel: no param associated with \"%s\" (LINE %d)", string, line_count);
|
||||
|
||||
}
|
||||
delete gen_expr;
|
||||
return PROJECTM_PARSE_ERROR;
|
||||
@ -602,18 +602,18 @@ GenExpr * Parser::parse_gen_expr ( FILE * fs, TreeExpr * tree_expr, Preset * pre
|
||||
case tLPr:
|
||||
|
||||
/* CASE 1 (Left Parentice): See if the previous string before this parentice is a function name */
|
||||
if ((func = projectM::currentEngine->find_func(string)) != NULL) {
|
||||
if (PARSE_DEBUG) {
|
||||
DWRITE( "parse_gen_expr: found prefix function (name = %s) (LINE %d)\n", func->name, line_count);
|
||||
|
||||
if ((func = BuiltinFuncs::find_func(string)) != NULL) {
|
||||
if (PARSE_DEBUG) {
|
||||
DWRITE( "parse_gen_expr: found prefix function (name = %s) (LINE %d)\n", func->name, line_count);
|
||||
|
||||
}
|
||||
|
||||
/* Parse the functions arguments */
|
||||
if ((expr_list = parse_prefix_args(fs, func->num_args, preset)) == NULL) {
|
||||
if (PARSE_DEBUG) {
|
||||
DWRITE( "parse_prefix_args: failed to generate an expresion list! (LINE %d) \n", line_count);
|
||||
|
||||
}
|
||||
if (PARSE_DEBUG) {
|
||||
DWRITE( "parse_prefix_args: failed to generate an expresion list! (LINE %d) \n", line_count);
|
||||
|
||||
}
|
||||
if ( tree_expr != NULL ) {
|
||||
delete tree_expr;
|
||||
}
|
||||
@ -707,9 +707,9 @@ GenExpr * Parser::parse_gen_expr ( FILE * fs, TreeExpr * tree_expr, Preset * pre
|
||||
|
||||
/* CASE 0: Empty string, parse error */
|
||||
if (*string == 0) {
|
||||
if (PARSE_DEBUG) {
|
||||
DWRITE( "parse_gen_expr: empty string coupled with infix op (ERROR!) (LINE %d) \n", line_count);
|
||||
|
||||
if (PARSE_DEBUG) {
|
||||
DWRITE( "parse_gen_expr: empty string coupled with infix op (ERROR!) (LINE %d) \n", line_count);
|
||||
|
||||
}
|
||||
delete tree_expr;
|
||||
return NULL;
|
||||
@ -721,17 +721,17 @@ GenExpr * Parser::parse_gen_expr ( FILE * fs, TreeExpr * tree_expr, Preset * pre
|
||||
delete tree_expr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* Parse the rest of the line */
|
||||
return parse_infix_op(fs, token, insert_gen_expr(gen_expr, &tree_expr), preset);
|
||||
|
||||
return parse_infix_op(fs, token, insert_gen_expr(gen_expr, &tree_expr), preset);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* CASE 4: custom shape variable */
|
||||
if (current_shape != NULL) {
|
||||
if ((param = current_shape->param_tree->find_param_db(string, FALSE)) == NULL) {
|
||||
if ((param = projectM::currentEngine->find_builtin_param(string)) == NULL)
|
||||
if ((param = preset->builtinParams.find_builtin_param(string)) == NULL)
|
||||
if ((param = current_shape->param_tree->find_param_db(string, TRUE)) == NULL) {
|
||||
delete tree_expr;
|
||||
return NULL;
|
||||
@ -758,7 +758,7 @@ GenExpr * Parser::parse_gen_expr ( FILE * fs, TreeExpr * tree_expr, Preset * pre
|
||||
/* CASE 5: custom wave variable */
|
||||
if (current_wave != NULL) {
|
||||
if ((param = current_wave->param_tree->find_param_db(string, FALSE)) == NULL) {
|
||||
if ((param = projectM::currentEngine->find_builtin_param(string)) == NULL)
|
||||
if ((param = preset->builtinParams.find_builtin_param(string)) == NULL)
|
||||
if ((param = current_wave->param_tree->find_param_db(string, TRUE)) == NULL) {
|
||||
delete tree_expr;
|
||||
return NULL;
|
||||
@ -792,7 +792,7 @@ GenExpr * Parser::parse_gen_expr ( FILE * fs, TreeExpr * tree_expr, Preset * pre
|
||||
|
||||
}
|
||||
|
||||
/* Convert parameter to an expression */
|
||||
/* Convert parameter to an expression */
|
||||
if ((gen_expr = GenExpr::param_to_expr(param)) == NULL) {
|
||||
delete tree_expr;
|
||||
return NULL;
|
||||
@ -806,9 +806,9 @@ GenExpr * Parser::parse_gen_expr ( FILE * fs, TreeExpr * tree_expr, Preset * pre
|
||||
}
|
||||
|
||||
/* CASE 7: Bad string, give up */
|
||||
if (PARSE_DEBUG) {
|
||||
DWRITE( "parse_gen_expr: syntax error [string = \"%s\"] (LINE %d)\n", string, line_count);
|
||||
|
||||
if (PARSE_DEBUG) {
|
||||
DWRITE( "parse_gen_expr: syntax error [string = \"%s\"] (LINE %d)\n", string, line_count);
|
||||
|
||||
}
|
||||
delete tree_expr;
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user