Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <string>
#include "macosx_math.h"
#include <math.h>
#include <time.h>
#include <assert.h>
#include "configxml.h"
#include "vs_globals.h"
#include "xml_support.h"
#include "gfxlib.h"
#include "galaxy_xml.h"
#include "galaxy_gen.h"
#include "vs_random.h"
#include <ctype.h>
#include "vsfilesystem.h"
Go to the source code of this file.
Classes | |
struct | StarSystemGent::Color |
class | StarSystemGent::Vector |
struct | StarSystemGent::GradColor |
struct | StarSystemGent::PlanetInfo |
struct | StarSystemGent::StarInfo |
Namespaces | |
StarSystemGent | |
Constant Groups | |
StarSystemGent | |
Macros | |
#define | M_PI 3.1415926536 |
Functions | |
static void | seedrand (unsigned long seed) |
static int | stringhash (const string &key) |
static unsigned int | ssrand () |
static string | GetWrapXY (string cname, int &wrapx, int &wrapy) |
string | getStarSystemName (const string &in) |
float | StarSystemGent::mmax (float a, float b) |
int | StarSystemGent::rnd (int lower, int upper) |
string | StarSystemGent::getGenericName (vector< string > &s) |
string | StarSystemGent::getRandName (vector< string > &s) |
float | StarSystemGent::grand () |
static void | StarSystemGent::Tab () |
float | StarSystemGent::difffunc (float inputdiffuse) |
void | StarSystemGent::WriteLight (unsigned int i) |
void | StarSystemGent::ResetGlobalVariables () |
void | StarSystemGent::readColorGrads (vector< string > &entity, const char *file) |
float | StarSystemGent::clamp01 (float a) |
float | StarSystemGent::getcolor (float c, float var) |
GradColor | StarSystemGent::whichGradColor (float r, unsigned int &j) |
Color | StarSystemGent::StarColor (float radius, unsigned int &entityindex) |
GFXColor | StarSystemGent::getStarColorFromRadius (float radius) |
float | StarSystemGent::LengthOfYear (Vector r, Vector s) |
void | StarSystemGent::CreateLight (unsigned int i) |
Vector | StarSystemGent::generateCenter (float minradii, bool jumppoint) |
float | StarSystemGent::makeRS (Vector &r, Vector &s, float minradii, bool jumppoint) |
void | StarSystemGent::Updateradii (float orbitsize, float thisplanetradius) |
Vector | StarSystemGent::generateAndUpdateRS (Vector &r, Vector &s, float thisplanetradius, bool jumppoint) |
vector< string > | StarSystemGent::parseBigUnit (const string &input) |
void | StarSystemGent::WriteUnit (const string &tag, const string &name, const string &filename, const Vector &r, const Vector &s, const Vector ¢er, const string &nebfile, const string &destination, bool faction, float thisloy=0) |
string | StarSystemGent::getJumpTo (const string &s) |
string | StarSystemGent::starin (const string &input) |
string | StarSystemGent::GetNebFile (string &input) |
string | StarSystemGent::AnalyzeType (string &input, string &nebfile, float &radius) |
void | StarSystemGent::MakeSmallUnit () |
void | StarSystemGent::MakeJump (float radius, bool forceRS=false, Vector R=Vector(0, 0, 0), Vector S=Vector(0, 0, 0), Vector center=Vector(0, 0, 0), float thisloy=0) |
void | StarSystemGent::MakeBigUnit (int callingentitytype, string name=string(), float orbitalradius=0) |
void | StarSystemGent::MakeMoons (float callingradius, int callingentitytype) |
void | StarSystemGent::MakeJumps (float callingradius, int callingentitytype, int numberofjumps) |
void | StarSystemGent::MakePlanet (float radius, int entitytype, string texturename, string unitname, string technique, int texturenum, int numberofjumps, int numberofstarbases) |
void | StarSystemGent::beginStar () |
void | StarSystemGent::endStar () |
void | StarSystemGent::CreateStar () |
void | StarSystemGent::CreateFirstStar () |
void | StarSystemGent::CreatePrimaries () |
void | StarSystemGent::CreateStarSystem () |
void | StarSystemGent::readentity (vector< string > &entity, const char *filename) |
const char * | StarSystemGent::noslash (const char *in) |
string | getStarSystemFileName (const string &input) |
string | getStarSystemSector (const string &in) |
void | readnames (vector< string > &entity, const char *filename) |
void | readplanetentity (vector< StarInfo > &starinfos, string planetlist, unsigned int numstars) |
static int | pushDown (int val) |
static int | pushDownTowardsMean (int mean, int val) |
static int | pushTowardsMean (int mean, int val) |
void | generateStarSystem (SystemInfo &si) |
#define M_PI 3.1415926536 |
Definition at line 27 of file galaxy_gen.cpp.
Referenced by GamePlanet::AddCity(), GamePlanet::AddRing(), aim_assist(), Atmosphere::Atmosphere(), Unit::DamageRandSys(), anonymous_namespace{plane_display.cpp}::Degree2Radian(), Bolt::Draw(), DrawOneTargetBox(), GameCockpit::GameCockpit(), GFXCircle(), GFXPerspective(), Planet::InitPlanet(), SphereMesh::InitSphere(), StarSystemGent::LengthOfYear(), Audio::TemplateManager::loadSourceTemplate(), MinRotationFromDirections(), StarSystemGent::Vector::Pitch(), Radar::PlaneDisplay::PlaneDisplay(), StarSystemGent::Vector::Roll(), SetDirection(), Orders::FireAt::ShouldFire(), Audio::Test::testComplexScene(), and StarSystemGent::Vector::Yaw().
void generateStarSystem | ( | SystemInfo & | si) |
Definition at line 1344 of file galaxy_gen.cpp.
References SystemInfo::asteroids, SystemInfo::asteroidslist, StarSystemGent::background, SystemInfo::backgrounds, SystemInfo::compactness, StarSystemGent::compactness, VSFileSystem::CreateDirectoryHome(), StarSystemGent::CreateStarSystem(), f, SystemInfo::faction, StarSystemGent::faction, SystemInfo::filename, VegaConfig::getVariable(), StarSystemGent::gradtex, i, int, StarSystemGent::jumpcompactness, SystemInfo::jumps, StarSystemGent::jumps, SystemInfo::name, SystemInfo::names, StarSystemGent::names, StarSystemGent::naturalphenomena, SystemInfo::nebulae, SystemInfo::nebulaelist, StarSystemGent::numnaturalphenomena, StarSystemGent::numstarbases, StarSystemGent::numstarentities, SystemInfo::numstars, SystemInfo::numun1, SystemInfo::numun2, VSFileSystem::Ok, XMLSupport::parse_float(), XMLSupport::parse_int(), SystemInfo::planetlist, pushTowardsMean(), StarSystemGent::readColorGrads(), StarSystemGent::readentity(), readnames(), readplanetentity(), StarSystemGent::ResetGlobalVariables(), SystemInfo::ringlist, StarSystemGent::rings, SystemInfo::sector, SystemInfo::seed, seedrand(), VSFileSystem::sharedsectors, SystemInfo::smallun, StarSystemGent::starbases, StarSystemGent::starradius, SystemInfo::stars, StarSystemGent::stars, stringhash(), SystemInfo::sunradius, VSFileSystem::SystemFile, StarSystemGent::systemname, VSFileSystem::universe_name, vs_config, and VSFileSystem::vs_fprintf().
Referenced by MakeStarSystem().
string getStarSystemFileName | ( | const string & | input) |
Definition at line 1165 of file galaxy_gen.cpp.
string getStarSystemName | ( | const string & | in) |
Definition at line 1169 of file galaxy_gen.cpp.
References StarSystemGent::noslash().
Referenced by Universe::getAdjacentStarSystems(), StarSystem::getFileName(), Universe::getGalaxyProperty(), Universe::getGalaxyPropertyDefault(), StarSystemGent::MakeJump(), MakeStarSystem(), and GalaxyXML::SGalaxy::processSystem().
string getStarSystemSector | ( | const string & | in) |
Definition at line 1173 of file galaxy_gen.cpp.
Definition at line 1323 of file galaxy_gen.cpp.
References StarSystemGent::grand().
Referenced by pushDownTowardsMean().
Definition at line 1329 of file galaxy_gen.cpp.
References pushDown().
Referenced by pushTowardsMean().
Definition at line 1334 of file galaxy_gen.cpp.
References VegaConfig::getVariable(), XMLSupport::parse_bool(), pushDownTowardsMean(), and vs_config.
Referenced by generateStarSystem().
void readnames | ( | vector< string > & | entity, |
const char * | filename | ||
) |
warning... obvious vulnerability
Definition at line 1182 of file galaxy_gen.cpp.
References VSFileSystem::VSFile::Close(), VSFileSystem::VSFile::Eof(), f, i, input_buffer, VSFileSystem::Ok, VSFileSystem::VSFile::OpenReadOnly(), VSFileSystem::VSFile::ReadLine(), and VSFileSystem::UniverseFile.
Referenced by generateStarSystem().
Definition at line 1207 of file galaxy_gen.cpp.
References _Universe, Universe::getGalaxy(), GalaxyXML::Galaxy::getPlanetNameFromInitial(), GalaxyXML::Galaxy::getPlanetVariable(), i, j, StarSystemGent::jumps, k, StarSystemGent::numstarbases, XMLSupport::parse_int(), rnd(), size, and VSFileSystem::vs_fprintf().
Referenced by generateStarSystem().
|
static |
Definition at line 36 of file galaxy_gen.cpp.
References starsysrandom.
Referenced by generateStarSystem().
|
static |
Definition at line 49 of file galaxy_gen.cpp.
References VSRandom::rand(), and starsysrandom.
Referenced by StarSystemGent::grand(), and StarSystemGent::rnd().
|
static |
Definition at line 40 of file galaxy_gen.cpp.
Referenced by generateStarSystem().
|
static |
Referenced by seedrand(), and ssrand().