Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cockpit_xml.cpp File Reference
#include "config.h"
#include "cockpit.h"
#include "xml_support.h"
#include "gauge.h"
#include <float.h>
#include "hud.h"
#include "vdu.h"
#include "mesh.h"

Go to the source code of this file.

Namespaces

 CockpitXML
 

Constant Groups

 CockpitXML
 

Enumerations

enum  CockpitXML::Names {
  CockpitXML::UNKNOWN =UnitImages< void >::NUMGAUGES, CockpitXML::COCKPIT, CockpitXML::MESH, CockpitXML::CROSSHAIRS,
  CockpitXML::RADAR, CockpitXML::REARRADAR, CockpitXML::LVDU, CockpitXML::RVDU,
  CockpitXML::AVDU, CockpitXML::VDUTYPE, CockpitXML::PANEL, CockpitXML::ROWS,
  CockpitXML::COLS, CockpitXML::XFILE, CockpitXML::SOUNDFILE, CockpitXML::XCENT,
  CockpitXML::YCENT, CockpitXML::TOPY, CockpitXML::BOTY, CockpitXML::XSIZE,
  CockpitXML::YSIZE, CockpitXML::MYFONT, CockpitXML::RED, CockpitXML::GREEN,
  CockpitXML::BLUE, CockpitXML::COCKPITOFFSET, CockpitXML::VIEWOFFSET, CockpitXML::FRONT,
  CockpitXML::BACK, CockpitXML::LEFT, CockpitXML::RIGHT, CockpitXML::NETWORK,
  CockpitXML::G_UP, CockpitXML::G_DOWN, CockpitXML::G_LEFT, CockpitXML::G_RIGHT,
  CockpitXML::G_TIME, CockpitXML::ALPH
}
 

Functions

string getRes (string inp)
 

Variables

const EnumMap::Pair CockpitXML::element_names []
 
const EnumMap::Pair CockpitXML::attribute_names []
 
const EnumMap CockpitXML::element_map (element_names, sizeof(element_names)/sizeof(element_names[0]))
 
const EnumMap CockpitXML::attribute_map (attribute_names, sizeof(attribute_names)/sizeof(attribute_names[0]))
 

Function Documentation

string getRes ( string  inp)

Definition at line 195 of file cockpit_xml.cpp.

References g_game, XMLSupport::tostring(), x, and game_data_t::x_resolution.

196 {
197  string::size_type where = inp.rfind( "." );
198  int x = g_game.x_resolution;
199  if (x < 700) x = 640;
200  else if (x < 840)
201  x = 800;
202  else if (x < 1100)
203  x = 1024;
204  else if (x < 1400)
205  x = 1280;
206  else if (x < 1700)
207  x = 1600;
208  else x = 1600;
209  string rez = XMLSupport::tostring( x );
210  if (where == string::npos)
211  return inp+"_"+rez+".spr";
212  else
213  return inp.substr( 0, where )+"_"+rez+".spr";
214 }