Beispiel #1
0
Brainview::Brainview()
{
	critterselection = Critterselection::Instance();

	brain_maxfiringthreshold = settings->getCVarPtr("brain_maxfiringthreshold");

	active = false;
	isMovable = true;

	rowlength = 37;
	v_radius = 2;
	v_diam = 2*v_radius;
	spacing = 3;

	int brainview_width = 20 + ((v_diam+spacing) * settings->getCVar("critter_retinasize") * 4);
	if ( brainview_width < 400 )
		brainview_width = 400;

	int brainview_height = 20 + ((v_diam+spacing) * 40);
	if ( brainview_height < 400 )
		brainview_height = 400;

	v_width = 20 + brainview_width;
	v_height = 80 + brainview_height;

	int buttons_starty = v_height - brainview_height - 10;
	int brainview_starty = buttons_starty;

	position.x = 10;
	position.y = 50;

	currentCritter = 0;

	// view widgets
// 	viewbutton = addWidgetButton( "bv_view", Vector2i(0+v_width-60, 35), Vector2i(50, 50), "", Vector2i(0, 0), cmd.gen(""), 0, 0, 0 );
	brainview = addWidgetButton( "bv_bview", Vector2i(10, brainview_starty), Vector2i(brainview_width, brainview_height), "", Vector2i(0, 0), cmd.gen(""), 0, 0, 0 );
	children["bv_bview"]->isTransparant = false;

	addWidgetButton( "bv_close", Vector2i(v_width-25, 10), Vector2i(15, 15), "x", cmd.gen("gui_togglepanel", "brainview"), 0, 0, 0 );


	settings->registerLocalCVar("attract neurons", 100, 0, 1000000, false, "attract neurons");
	addSettingmutator("attract neurons", 10, 10);

	settings->registerLocalCVar("repel neurons", 100, 0, 1000000, false, "repel neurons");
	addSettingmutator("repel neurons", 10, 22);

	settings->registerLocalCVar("attract neuron inputs", 100, 0, 1000000, false, "attract neuron<>inputs");
	addSettingmutator("attract neuron inputs", 10, 36);

	settings->registerLocalCVar("repel neuron inputs", 100, 0, 1000000, false, "repel neuron<>inputs");
	addSettingmutator("repel neuron inputs", 10, 48);

	attractor1 = settings->getCVarPtr("attract neurons");
	attractor2 = settings->getCVarPtr("attract neuron inputs");
	attractor3 = settings->getCVarPtr("repel neurons");
	attractor4 = settings->getCVarPtr("repel neuron inputs");
}
Enginesettingspanel::Enginesettingspanel()
{
	isMovable = true;

	rowspacer = 15;
	col2 = 150;
	col3 = 200;
	
	m_localposition.set(2, 24);

	// FIXME camera sensitivity is missing

#if defined(HAVE_OPENMP)
	addSettingmutator("threads", 0, 0);
#endif
	addSettingmutator("fsX", 0, 0);
	addSettingmutator("fsY", 0, 0);
	addSettingmutator("fpslimit_frames", 0, 0);
	addSettingcheckbox("fpslimit", 0, 0);
	addSettingcheckbox("drawscene", 0, 0);
	addSettingcheckbox("glsl", 0, 0);
	addSettingcheckbox("hdr", 0, 0);
// 	addSettingcheckbox("drawshadows", 0, 0);
	addSettingcheckbox("window_fullscreen", 0, 0);
	addSettingmutator("camerasensitivity_move", 0, 0);
	addSettingmutator("camerasensitivity_look", 0, 0);
	addSettingmutator("camera_smoothfactor", 0, 0);
	
	
// 	addSettingcheckbox("sound", 0, 0);

	m_dimensions.set(col3 + 50,row-rowspacer+10+10);
	BeWidgetPtr w = addWidgetButton( "enginesettingspanel_close", Vector2i(2, 2), Vector2i(11, 11), "x", BeCommand("gui_togglepanel", "enginesettingspanel"), EVENT_NOREPEAT, 0 );
		w->isAlignedRight = true;
}
Settingsbrainpanel::Settingsbrainpanel()
{
	v_width = 490;
	v_height = 510;

	isMovable = true;

	position.x = 50;
	position.y = 35;

	mutatorcol2 = 350;
	mutatorcol3 = 430;
	
	unsigned int vint = 12;
	unsigned int vspace;
	unsigned int hspace = 10;
	
	vspace = 7;  addSettingmutator("brain_maxneurons", hspace, vspace);
	vspace += vint; addSettingmutator("brain_minsynapses", hspace, vspace);
	vspace += vint; addSettingmutator("brain_maxsynapses", hspace, vspace);
	vspace += vint; addSettingmutator("brain_minneuronsatbuildtime", hspace, vspace);
	vspace += vint; addSettingmutator("brain_maxneuronsatbuildtime", hspace, vspace);
	vspace += vint; addSettingmutator("brain_minsynapsesatbuildtime", hspace, vspace);
	vspace += vint; addSettingmutator("brain_maxsynapsesatbuildtime", hspace, vspace);
	vspace += vint; addSettingmutator("brain_percentchanceinhibitoryneuron", hspace, vspace);
	vspace += vint; addSettingmutator("brain_mutate_percentchanceinhibitoryneuron", hspace, vspace);
	vspace += vint; addSettingmutator("brain_percentchancemotorneuron", hspace, vspace);
	vspace += vint; addSettingmutator("brain_mutate_percentchancemotorneuron", hspace, vspace);
	vspace += vint; addSettingmutator("brain_percentchanceplasticneuron", hspace, vspace);
	vspace += vint; addSettingmutator("brain_mutate_percentchanceplasticneuron", hspace, vspace);
	vspace += vint; addSettingmutator("brain_minplasticitystrengthen", hspace, vspace);
	vspace += vint; addSettingmutator("brain_maxplasticitystrengthen", hspace, vspace);
	vspace += vint; addSettingmutator("brain_minplasticityweaken", hspace, vspace);
	vspace += vint; addSettingmutator("brain_maxplasticityweaken", hspace, vspace);
	vspace += vint; addSettingmutator("brain_mutate_plasticityfactors", hspace, vspace);
	vspace += vint; addSettingmutator("brain_minfiringthreshold", hspace, vspace);
	vspace += vint; addSettingmutator("brain_mutate_minfiringthreshold", hspace, vspace);
	vspace += vint; addSettingmutator("brain_maxfiringthreshold", hspace, vspace);
	vspace += vint; addSettingmutator("brain_mutate_maxfiringthreshold", hspace, vspace);
// 	vspace += vint; addSettingmutator("brain_maxdendridicbranches", hspace, vspace);
// 	vspace += vint; addSettingmutator("brain_mutate_maxdendridicbranches", hspace, vspace);
	vspace += vint; addSettingmutator("brain_percentchanceconsistentsynapses", hspace, vspace);
	vspace += vint; addSettingmutator("brain_mutate_percentchanceconsistentsynapses", hspace, vspace);
	vspace += vint; addSettingmutator("brain_percentchanceinhibitorysynapses", hspace, vspace);
	vspace += vint; addSettingmutator("brain_mutate_percentchanceinhibitorysynapses", hspace, vspace);
	vspace += vint; addSettingmutator("brain_percentchancesensorysynapse", hspace, vspace);
	vspace += vint; addSettingmutator("brain_mutate_percentchancesensorysynapse", hspace, vspace);
	vspace += vint; addSettingmutator("brain_percentmutateeffectaddneuron", hspace, vspace);
	vspace += vint; addSettingmutator("brain_percentmutateeffectremoveneuron", hspace, vspace);

	vspace += vint; addSettingmutator("brain_percentmutateeffectalterneuron", hspace, vspace);
	vspace += vint; addSettingmutator("brain_percentmutateeffectaddsynapse", hspace, vspace);
	vspace += vint; addSettingmutator("brain_percentmutateeffectremovesynapse", hspace, vspace);
	vspace += vint; addSettingmutator("brain_mutate_mutateeffects", hspace, vspace);
	
	vspace += vint; addSettingmutator("brain_percentmutateeffectaltermutable", hspace, vspace);
	vspace += vint; addSettingmutator("brain_costhavingneuron", hspace, vspace);
	vspace += vint; addSettingmutator("brain_costfiringneuron", hspace, vspace);
	vspace += vint; addSettingmutator("brain_costfiringmotorneuron", hspace, vspace);
	vspace += vint; addSettingmutator("brain_costhavingsynapse", hspace, vspace);
}
Settingslightpanel::Settingslightpanel()
{
	isMovable = true;

	m_localposition.set(2, 24);

	col2 = 200;
	col3 = 250;

	addSettingmutator("light_ambient_modelR", 0, 0);
	addSettingmutator("light_ambient_modelG", 0, 0);
	addSettingmutator("light_ambient_modelB", 0, 0);
	
	row+=8;

	addSettingmutator("light_ambientR", 0, 0);
	addSettingmutator("light_ambientG", 0, 0);
	addSettingmutator("light_ambientB", 0, 0);

	row+=8;

	addSettingmutator("light_diffuseR", 0, 0);
	addSettingmutator("light_diffuseG", 0, 0);
	addSettingmutator("light_diffuseB", 0, 0);

	row+=8;

	addSettingmutator("light_specularR", 0, 0);
	addSettingmutator("light_specularG", 0, 0);
	addSettingmutator("light_specularB", 0, 0);
	
	row+=8;

	addSettingmutator("light_attenuation_constant", 0, 0);
	addSettingmutator("light_attenuation_linear", 0, 0);
	addSettingmutator("light_attenuation_quadratic", 0, 0);

	m_dimensions.set(col3 + 50, row-rowspacer+10+10);  // 10 = height of 1 line, 10 = horizontal margin
	BeWidgetPtr w = addWidgetButton( "settingslightpanel_close", Vector2i(2, 2), Vector2i(12, 12), "x", BeCommand("gui_togglepanel", "settingslightpanel"), EVENT_NOREPEAT, 0 );
		w->isAlignedRight = true;
}
Settingsbodypanel::Settingsbodypanel()
{
	v_width = 490;
	v_height = 265;

	isMovable = true;

	position.x = 50;
	position.y = 35;

	mutatorcol2 = 350;
	mutatorcol3 = 430;

	unsigned int vint = 12;
	unsigned int vspace;
	unsigned int hspace = 10;
	vspace = 7; addSettingmutator("body_maxbodyparts", hspace, vspace);
	vspace += vint; addSettingmutator("body_maxbodypartsatbuildtime", hspace, vspace);
	vspace += vint; addSettingmutator("body_minbodypartsize", hspace, vspace);
	vspace += vint; addSettingmutator("body_maxbodypartsize", hspace, vspace);
	vspace += vint; addSettingmutator("body_minheadsize", hspace, vspace);
	vspace += vint; addSettingmutator("body_maxheadsize", hspace, vspace);
	vspace += vint; addSettingmutator("body_percentmutateeffectchangecolor", hspace, vspace);
	vspace += vint; addSettingmutator("body_percentmutateeffectchangecolor_slightly", hspace, vspace);
	vspace += vint; addSettingmutator("body_percentmutateeffectaddbodypart", hspace, vspace);
	vspace += vint; addSettingmutator("body_percentmutateeffectremovebodypart", hspace, vspace);
	vspace += vint; addSettingmutator("body_percentmutateeffectresizebodypart", hspace, vspace);
	vspace += vint; addSettingmutator("body_percentmutateeffectresizebodypart_slightly", hspace, vspace);
	vspace += vint; addSettingmutator("body_percentmutateeffectchangeconstraintlimits", hspace, vspace);
	vspace += vint; addSettingmutator("body_percentmutateeffectchangeconstraintlimits_slightly", hspace, vspace);
	vspace += vint; addSettingmutator("body_percentmutateeffectchangeconstraintangles", hspace, vspace);
	vspace += vint; addSettingmutator("body_percentmutateeffectchangeconstraintangles_slightly", hspace, vspace);
	vspace += vint; addSettingmutator("body_percentmutateeffectchangeconstraintposition", hspace, vspace);
	vspace += vint; addSettingmutator("body_percentmutateeffectchangeconstraintposition_slightly", hspace, vspace);
	vspace += vint; addSettingmutator("body_percentmutateeffectresizehead", hspace, vspace);
	vspace += vint; addSettingmutator("body_percentmutateeffectresizehead_slightly", hspace, vspace);
	vspace += vint; addSettingmutator("body_percentmutateeffectrepositionhead", hspace, vspace);
}