Beispiel #1
0
/*
    MAINLINE
*/
int main(int argc, const char *argv[]){
  printf("MakeTreeSpawn - Gareth Bradshaw Feb 2003\n");

  /*
     parse command line
  */
  decodeIntParam(argc, argv, intParams);
  decodeBoolParam(argc, argv, boolParams);
  printf("Options : \n");
  writeParam(stdout, intParams);
  writeParam(stdout, boolParams);

  /*
     look for filenames and construct trees
  */
  int numFiles = 0;
  for (int i = 1; i < argc; i++){
    if (argv[i] != NULL){
      constructTree(argv[i], yaml);
      numFiles++;
      }
    }

  /*
     check we had a file name
  */
  if (numFiles == 0)
    error("no files given :(");

  waitForKey();
}
Beispiel #2
0
void KeyBinding::performAction(string action) {
	if(action == "exit") {
		pres->closeEvent();
	} else if(action == "toggleFullscreen") {
		pres->switchFullscreen();
	} else if(action == "toggleVSync") {
		pres->switchVSync();
	} else if(action == "toggleRGBRange") {
		pres->toggleRGBRange();
	} else if(action == "captureScreenshot") {
		pres->saveScreenshot();
	} else if(action == "setDisplayHz") {
		pres->setDisplayHz();
	} else if(isFunCall("resizeTo", action)) {
		pres->resizeTo(decodeIntParam(action));
	} else if(action == "switchAspect") {
		pres->switchAspect();
	} 
	// image processing
	else if(action == "toggleLocalContrast") {
		pres->getIPManager()->toggleFilter(IPManager::LOCAL_CONTRAST);
	} else if(isFunCall("adjustLocalContrast", action)) {
		pres->getIPManager()->adjustContrastIncrease(decodeFloatParam(action));
	} else if(action == "toggleGammaCorrection") {
		pres->getIPManager()->toggleFilter(IPManager::GAMMA_CORRECTION);
	} else if(isFunCall("adjustGamma", action)) {
		pres->getIPManager()->adjustGamma(decodeFloatParam(action));
	}
	// scaling & AA
	else if(action == "changeScaling") {
		pres->changeScaling();
	} else if(isFunCall("setScaling", action)) {
		pres->setScaling(decodeIntParam(action));
	} else if(action == "changeAA") {
		pres->changeAA();
	} else if(isFunCall("setAA", action)) {
		pres->setAA(decodeIntParam(action));
	} else if(isFunCall("adjustPredicate", action)) {
		pres->adjustPredicate(decodeFloatParam(action, 0), decodeFloatParam(action, 1));
	} else if(isFunCall("toggleOneToNScaling", action)) {
		pres->toggleOneToNScaling(decodeFloatParam(action));
	} 
	// audio
	else if(action == "toggleSound") {
		AudioRenderer::get().toggleMuted();
	} else if(action == "toggleExpandStereo") {
		AudioRenderer::get().toggleExpandStereo();
	} else if(action == "toggleDTSDecoding") {
		AudioRenderer::get().toggleDTS();
	}  else if(action == "toggleDDDecoding") {
		AudioRenderer::get().toggleDD();
	} else if(isFunCall("adjustVolume", action)) {
		AudioRenderer::get().adjustVolume(decodeFloatParam(action));
	} else if(isFunCall("boostAudioLevels", action)) {
		AudioRenderer::get().adjustBoost(decodeIntParam(action));
	}
	// testing
	else if(action == "testAA") {
		pres->testAA();
	}
	// unrecognized command
	else {
		WARN("Unknown action: "<< action);
	}
}