bool XML_OvhdMapParser::Start()
{
	ShowAliensParser.GotUsed = false;
	ShowItemsParser.GotUsed = false;
	ShowProjectilesParser.GotUsed = false;
	ShowPathsParser.GotUsed = false;
	
	// Copy in the colors
	rgb_color *ColorPtr = Colors;
	
	rgb_color *PolyColorPtr = OvhdMap_ConfigData.polygon_colors;
	for (int k=0; k<NUMBER_OF_OLD_POLYGON_COLORS; k++)
		*(ColorPtr++) = *(PolyColorPtr++);

	line_definition *LineDefPtr = OvhdMap_ConfigData.line_definitions;
	for (int k=0; k<NUMBER_OF_LINE_DEFINITIONS; k++)
		*(ColorPtr++) = (LineDefPtr++)->color;
	
	thing_definition *ThingDefPtr = OvhdMap_ConfigData.thing_definitions;
	for (int k=0; k<NUMBER_OF_THINGS; k++)
		*(ColorPtr++) = (ThingDefPtr++)->color;
	
	annotation_definition *NoteDefPtr = OvhdMap_ConfigData.annotation_definitions;
	for (int k=0; k<NUMBER_OF_ANNOTATION_DEFINITIONS; k++)
		*(ColorPtr++) = (NoteDefPtr++)->color;
	
	*(ColorPtr++) = OvhdMap_ConfigData.map_name_data.color;
	*(ColorPtr++) = OvhdMap_ConfigData.path_color;
	
	for (int k=NUMBER_OF_OLD_POLYGON_COLORS; k<NUMBER_OF_POLYGON_COLORS; k++)
		*(ColorPtr++) = *(PolyColorPtr++);
	
	assert(ColorPtr == Colors + TOTAL_NUMBER_OF_COLORS);
	
	Color_SetArray(Colors,TOTAL_NUMBER_OF_COLORS);
	
	// Copy in the fonts
	FontSpecifier *FontPtr = Fonts;
	
	NoteDefPtr = OvhdMap_ConfigData.annotation_definitions;
	for (int k=0; k<NUMBER_OF_ANNOTATION_DEFINITIONS; k++)
	{
		FontSpecifier *NoteFontPtr = NoteDefPtr[k].Fonts;
		for (int s=0; s<=OVERHEAD_MAP_MAXIMUM_SCALE-OVERHEAD_MAP_MINIMUM_SCALE; s++)
			*(FontPtr++) = *(NoteFontPtr++);
	}
	*(FontPtr++) = OvhdMap_ConfigData.map_name_data.Font;
	
	assert(FontPtr == Fonts + TOTAL_NUMBER_OF_FONTS);
	
	Font_SetArray(Fonts,TOTAL_NUMBER_OF_FONTS);
	
	return true;
}
Exemple #2
0
bool XML_FogParser::AttributesDone()
{
  OGL_FogData& Data = FogData[Type];
  if (IsPresent[0]) {
    Data.IsPresent = FogPresent;
  }
  if (IsPresent[1]) {
    Data.Depth = Depth;
  }
  if (IsPresent[2]) {
    Data.AffectsLandscapes = AffectsLandscapes;
  }
  Color_SetArray(&Data.Color);
  return true;
}