Esempio n. 1
0
// XML-parser support
XML_ElementParser *Landscapes_GetParser()
{
  LandscapesParser.AddChild(&LandscapeParser);
  LandscapesParser.AddChild(&LO_ClearParser);

  return &LandscapesParser;
}
XML_ElementParser*
StarGameProtocol::GetParser() {
	static bool sAddedChildren = false;
	if(!sAddedChildren)
	{
		sStarParser.AddChild(Hub_GetParser());
		sStarParser.AddChild(Spoke_GetParser());
		sAddedChildren = true;
	}

	return &sStarParser;
}
Esempio n. 3
0
XML_ElementParser *XML_ElementParser::FindChild(const char *_Name)
{
	XML_ElementParser *FoundChild = NULL;
	
	for (unsigned k=0; k<Children.size(); k++)
	{
		XML_ElementParser *TestChild = Children[k];
		if (TestChild->NameMatch(_Name))
		{
			FoundChild = TestChild;
			break;
		}
	}
	
	return FoundChild;
}
Esempio n. 4
0
// XML-parser support
XML_ElementParser *Items_GetParser()
{
	ItemParser.AddChild(Shape_GetParser());
	ItemsParser.AddChild(&ItemParser);

	return &ItemsParser;
}
Esempio n. 5
0
// XML-parser support:
XML_ElementParser *OpenGL_GetParser()
{
#ifdef HAVE_OPENGL
  OpenGL_Parser.AddChild(TextureOptions_GetParser());
  OpenGL_Parser.AddChild(Shader_GetParser());
  OpenGL_Parser.AddChild(TO_Clear_GetParser());

  OpenGL_Parser.AddChild(ModelData_GetParser());
  OpenGL_Parser.AddChild(Mdl_Clear_GetParser());
#endif

  FogParser.AddChild(Color_GetParser());
  OpenGL_Parser.AddChild(&FogParser);

  return &OpenGL_Parser;
}
Esempio n. 6
0
static void SetupLSParseTree()
{
  // Don't set up more than once!
  static bool WasSetUp = false;
  if (WasSetUp) {
    return;
  }
  else{
    WasSetUp = true;
  }

  LSRootParser.AddChild(&LevelScriptSetParser);

  LevelScriptSetParser.AddChild(LevelScript_GetParser());
  LevelScriptSetParser.AddChild(EndLevelScript_GetParser());
  LevelScriptSetParser.AddChild(DefaultLevelScript_GetParser());
  LevelScriptSetParser.AddChild(RestoreLevelScript_GetParser());
  LevelScriptSetParser.AddChild(EndScreens_GetParser());
}
Esempio n. 7
0
void Plugins::enumerate() {
  PluginParser.AddChild(&PluginMMLParser);
  PluginRootParser.AddChild(&PluginParser);

  logContext("parsing plugins");
  PluginLoader loader;
  loader.CurrentElement = &PluginRootParser;

  for (std::vector<DirectorySpecifier>::const_iterator it =
         data_search_path.begin();
       it != data_search_path.end(); ++it) {
    DirectorySpecifier path = *it + "Plugins";
    loader.ParseDirectory(path);
  }
  std::sort(m_plugins.begin(), m_plugins.end());
  clear_game_error();
}
Esempio n. 8
0
static void AddScriptCommands(XML_ElementParser& ElementParser)
{
  ElementParser.AddChild(&MMLParser);
  ElementParser.AddChild(&MusicParser);
  ElementParser.AddChild(&RandomOrderParser);
  ElementParser.AddChild(&MovieParser);
#ifdef HAVE_LUA
  ElementParser.AddChild(&LuaParser);
#endif /* HAVE_LUA */
#ifdef HAVE_OPENGL
  ElementParser.AddChild(&LoadScreenParser);
  LoadScreenParser.AddChild(Color_GetParser());
#endif
}
void SetupParseTree()
{
	// Add the only recognized XML-document-root object here
	RootParser.AddChild(&MarathonParser);

	// Add all its subobjects
	MarathonParser.AddChild(TS_GetParser());		// Text strings
	MarathonParser.AddChild(Interface_GetParser());
	MarathonParser.AddChild(PlayerName_GetParser());
	MarathonParser.AddChild(Infravision_GetParser());
	MarathonParser.AddChild(MotionSensor_GetParser());
	MarathonParser.AddChild(OverheadMap_GetParser());
	MarathonParser.AddChild(DynamicLimits_GetParser());
	MarathonParser.AddChild(AnimatedTextures_GetParser());
	MarathonParser.AddChild(Player_GetParser());
	MarathonParser.AddChild(Items_GetParser());
	MarathonParser.AddChild(ControlPanels_GetParser());
	MarathonParser.AddChild(Liquids_GetParser());
	MarathonParser.AddChild(Sounds_GetParser());
	MarathonParser.AddChild(Platforms_GetParser());
	MarathonParser.AddChild(Scenery_GetParser());
	MarathonParser.AddChild(Faders_GetParser());
	MarathonParser.AddChild(View_GetParser());
	MarathonParser.AddChild(Landscapes_GetParser());
	MarathonParser.AddChild(Weapons_GetParser());
	MarathonParser.AddChild(OpenGL_GetParser());
	MarathonParser.AddChild(Cheats_GetParser());
	MarathonParser.AddChild(TextureLoading_GetParser());
	MarathonParser.AddChild(Keyboard_GetParser());
	MarathonParser.AddChild(DamageKicks_GetParser());
	MarathonParser.AddChild(Logging_GetParser());
	MarathonParser.AddChild(Scenario_GetParser());
#ifdef SDL
	MarathonParser.AddChild(Theme_GetParser());
#endif
#ifndef HAVE_DINGOO // sw alpha dingoo exclude -- Nigel
	MarathonParser.AddChild(SW_Texture_Extras_GetParser());
#endif
	MarathonParser.AddChild(Console_GetParser());
	MarathonParser.AddChild(ExternalDefaultLevelScript_GetParser());
}
// This will reset all values changed by MML scripts which implement ResetValues() method
// and are part of the master MarathonParser tree.
void ResetAllMMLValues()
{
  MarathonParser.ResetChildrenValues();
}
Esempio n. 11
0
XML_ElementParser*
Logging_GetParser() {
	LoggingParser.AddChild(&LoggingConfigurationParser);
	
	return &LoggingParser;
}