25 #include "../../cl_shared.h"
26 #include "../../ui/ui_dataids.h"
27 #include "../../ui/node/ui_node_geoscape.h"
41 static cvar_t* debug_showInterest;
44 #define GLOBE_ROTATE -90
45 #define ZOOM_LIMIT 2.5f
86 return cgi->Cvar_GetInteger(
"geo_overlay_radar");
91 return cgi->Cvar_GetInteger(
"geo_overlay_nation");
96 return cgi->Cvar_GetInteger(
"geo_overlay_xvi");
116 cgi->Cmd_ExecuteString(
"mn_set_base_title");
117 cgi->UI_PushWindow(
"popup_newbase");
127 cgi->UI_PushWindow(
"popup_newinstallation");
136 cgi->UI_ExecuteConfunc(
"ui_clear_geoscape_selection");
137 int selection_count = 0;
144 cgi->UI_ExecuteConfunc(
"ui_add_geoscape_selection \"%s\" \"%d\" \"%s\"",
152 cgi->UI_ExecuteConfunc(
"ui_add_geoscape_selection \"%s\" \"%d\" \"%s\"",
153 "aircraft", aircraft->idx, aircraft->name);
160 while ((base =
B_GetNext(base)) !=
nullptr) {
163 cgi->UI_ExecuteConfunc(
"ui_add_geoscape_selection \"%s\" \"%d\" \"%s\"",
164 "base", base->
idx, base->
name);
172 cgi->UI_ExecuteConfunc(
"ui_add_geoscape_selection \"%s\" \"%d\" \"%s\"",
173 "installation", installation->idx, installation->name);
181 cgi->UI_ExecuteConfunc(
"ui_add_geoscape_selection \"%s\" \"%lu\" \"%s\"",
187 if (selection_count > 0) {
189 cgi->UI_PushWindow(
"popup_geoscape_selection");
250 *x = (
int) (mid[0] - radius * v[1]);
251 *y = (
int) (mid[1] - radius * v[0]);
254 *z = (
int) (radius * v[2]);
282 float sx = pos[0] / 360 + data.
center[0] - 0.5;
324 #define UI_MAP_DIST_SELECTION 15
358 cgi->R_Draw2DMapMarkers(screenPos, theta, model, skin);
376 float cosTrafo, sinTrafo;
377 float phiStart, phiEnd, dPhi, phi;
398 cosTrafo = cos(trafo[1] *
torad);
399 sinTrafo = sin(trafo[1] * torad);
401 sa[0] = start[0] - trafo[0];
404 ea[0] = end[0] - trafo[0];
408 phiStart = atan2(s[1], cosTrafo * s[2] - sinTrafo * s[0]);
409 phiEnd = atan2(e[1], cosTrafo * e[2] - sinTrafo * e[0]);
412 if (phiEnd < phiStart -
M_PI)
414 if (phiEnd > phiStart +
M_PI)
427 dPhi = (phiEnd - phiStart) / n;
429 for (phi = phiStart, i = 0; i <= n; phi += dPhi, i++) {
430 const float* last = p;
432 VectorSet(v, -sinTrafo * cos(phi), sin(phi), cosTrafo * cos(phi));
437 while (p[0] < -180.0)
439 while (p[0] > +180.0)
442 while (p[0] - last[0] > +180.0)
444 while (p[0] - last[0] < -180.0)
459 const vec4_t color = {1, 0.5, 0.5, 1};
469 for (i = 0, p = pts; i < line->
numPoints; i++, p++) {
473 if (i > start && abs(p->
x - old) > data.
mapSize[0] / 2) {
477 if (p->
x - old > data.
mapSize[0] / 2)
484 cgi->R_DrawLineStrip(i - start, (
int*)(&pts));
489 pts[0].
x = p[-1].
x - diff;
496 cgi->R_DrawLineStrip(i - start, (
int*)(&pts));
497 cgi->R_Color(
nullptr);
509 const vec4_t color = {1, 0.5, 0.5, 1};
511 int numPoints, start;
526 cgi->R_DrawLineStrip(numPoints, (
int*)(&pts[start]));
527 cgi->R_Color(
nullptr);
530 #define CIRCLE_DRAW_POINTS 60
544 vec3_t initialVector, rotationAxis, currentPoint, centerPos;
556 bool oldDraw =
false;
560 int xCircle, yCircle;
567 if (data.
flatgeoscape && numPoints != 0 && abs(pts[numPoints - 1].x - xCircle) > 512)
573 if (draw != oldDraw &&
i != 0) {
574 cgi->R_DrawLineStrip(numPoints, (
int*)(&pts));
579 pts[numPoints].
x = xCircle;
580 pts[numPoints].
y = yCircle;
588 cgi->R_DrawLineStrip(numPoints, (
int*)(&pts));
589 cgi->R_Color(
nullptr);
602 vec3_t start3D, end3D, north3D, ortToDest, ortToPole,
v;
603 const vec2_t northPole = {0.0f, 90.0f};
662 vec3_t start3D, end3D, tangentVector,
v, rotationAxis;
699 float angle =
todeg * atan(tangentVector[0] / tangentVector[1]);
700 if (tangentVector[1] > 0)
737 Vector2Set(vector, objectPos[0], objectPos[1]);
739 VectorSet(vector, objectPos[0], -objectPos[1], 0);
748 if (mission ==
nullptr)
836 if (
cgi->Cmd_Argc() != 3) {
837 cgi->Com_Printf(
"Usage: %s <mission|ufo> <id>\n",
cgi->
Cmd_Argv(0));
844 const bool flatgeoscape = data.flatgeoscape;
848 vector = data.smoothFinal2DGeoscapeCenter;
850 vector = data.smoothFinalGlobeAngle;
857 cgi->Com_Printf(
"GEO_SelectObject_f: type %s unsupported.", type);
877 maxEventIdx = numMissions + numBases +
INS_GetCount() - 1;
879 while ((base =
B_GetNext(base)) !=
nullptr) {
890 if (maxEventIdx < 0) {
904 if (!mission->onGeoscape)
914 counter = numMissions;
919 while ((base =
B_GetNext(base)) !=
nullptr) {
987 #define BULLET_SIZE 1
1019 cgi->R_Color(color);
1020 cgi->R_DrawLine(points, 2.0);
1021 cgi->R_Color(
nullptr);
1026 cgi->R_DrawImageCentered(x, y, image);
1029 #define SELECT_CIRCLE_RADIUS 1.5f + 3.0f / UI_MAPEXTRADATACONST(node).zoom
1041 if (isCurrentSelectedMission)
1048 if (isCurrentSelectedMission) {
1080 const vec4_t color = {1., 1., 1., .4};
1111 const vec4_t color = {1., 1., 1., .3};
1112 cgi->R_Color(color);
1118 cgi->R_DrawLineStrip(2, (
int*)pts);
1121 cgi->R_Color(
nullptr);
1133 bool oneUFOVisible,
const char* font)
1173 bool oneUFOVisible,
const char* font)
1227 const int width = 8 * data.
zoom;
1228 const int height = 1 * data.
zoom * 0.9f;
1253 const vec4_t bordercolor = {1, 1, 1, 1};
1255 cgi->R_DrawRect(centerX - width / 2, centerY - 5 * data.
zoom, width, height, bordercolor, 1.0, 1);
1324 if (oneUFOVisible ||
cgi->Cvar_GetInteger(
"debug_showcrafthealth") >= 1)
1338 Com_sprintf(buffer, size,
_(
"Name: %s\nObjective: %s"),
1358 Q_strcat(buffer, size,
_(
"Distance to target:\t\t%.0f\n"), distance);
1402 cgi->UI_ExecuteConfunc(
"clean_geoscape_object");
1406 if (!mission->onGeoscape)
1408 cgi->UI_ExecuteConfunc(
"add_geoscape_object mission %i \"%s\" \"%s\n%s\"",
1410 (mission->mapDef) ?
_(mission->mapDef->description) :
"");
1417 cgi->UI_ExecuteConfunc(
"add_geoscape_object ufo %i %s \"%s\"",
1437 const vec4_t white = {1.f, 1.f, 1.f, 0.7f};
1438 int maxInterpolationPoints;
1452 if (!mission->onGeoscape)
1464 while ((base =
B_GetNext(base)) !=
nullptr)
1478 if (
cgi->Cvar_GetInteger(
"debug_showufos")) {
1506 ||
cgi->Cvar_GetInteger(
"debug_showcrafthealth") >= 1)
1514 maxInterpolationPoints = 0;
1519 vec3_t drawPos = {0, 0, 0};
1530 const float xInterpolStep = (projectile->
projectedPos[0][0] - projectile->
pos[0][0]) / (
float)maxInterpolationPoints;
1541 }
else if (projectile->
beam) {
1562 static char buffer[512];
1569 cgi->UI_DrawString(
"f_verysmall",
ALIGN_UC, x , y,
_(nation->name));
1581 cgi->R_Color(
nullptr);
1609 cgi->UI_RegisterText(
TEXT_STANDARD,
_(
"Select the desired location of the new base on the map.\n"));
1612 cgi->UI_RegisterText(
TEXT_STANDARD,
_(
"Select the desired location of the new installation on the map.\n"));
1633 if (debug_showInterest->
integer) {
1747 const vec3_t fcolor = {color[0] / 255.0f, color[1] / 255.0f, color[2] / 255.0f};
1749 cgi->Com_DPrintf(
DEBUG_CLIENT,
"GEO_GetNation: color value for %.0f:%.0f is r:%i, g:%i, b: %i\n", pos[0], pos[1], color[0], color[1], color[2]);
1757 cgi->Com_DPrintf(
DEBUG_CLIENT,
"GEO_GetNation: No nation found at %.0f:%.0f - color: %i:%i:%i\n", pos[0], pos[1], color[0], color[1], color[2]);
1802 return "nopopulation";
1853 cgi->Com_Error(
ERR_DROP,
"GEO_GetPopulationType: Trying to get number of civilian in a position on water");
1882 cgi->Com_Printf(
" (Terrain: %s, Culture: %s, Population: %s, Coast: %s)\n",
1883 terrainType, cultureType, populationType, coast ?
"true" :
"false");
1892 while (pos[0] > 180.0)
1894 while (pos[0] < -180.0)
1896 while (pos[1] > 90.0)
1898 while (pos[1] < -90.0)
1909 float p, q, a, root, x;
1915 p = (0.5 + pos[0] / 360 - p) * (2 *
M_PI) - q;
1916 a = -sin(pos[1] *
torad);
1917 root = sqrt(1.0 - a * a);
1963 cgi->Com_Error(
ERR_DROP,
"Unknown maptype %i\n", type);
1969 assert(pos[0] >= -180);
1970 assert(pos[0] <= 180);
1971 assert(pos[1] >= -90);
1972 assert(pos[1] <= 90);
1975 x = (180 - pos[0]) / 360 * width;
1977 y = (90 - pos[1]) / 180 * height;
1987 assert(4 * (x + y * width) < width * height * 4);
1988 color = mask + 4 * (x + y * width);
1989 if (coast !=
nullptr) {
1996 const byte* coastCheck = mask + 4 * ((x - gap) + y * width);
1999 if (!*coast && x < width - 1 - gap) {
2000 const byte* coastCheck = mask + 4 * ((x + gap) + y * width);
2006 const byte* coastCheck = mask + 4 * (x + (y - gap) * width);
2009 if (!*coast && y < height - 1 - gap) {
2010 const byte* coastCheck = mask + 4 * (x + (y + gap) * width);
2032 while ((base =
B_GetNext(base)) !=
nullptr)
2087 pos[0] = (
frand() - 0.5f) * 360.0
f;
2091 cgi->Com_DPrintf(
DEBUG_CLIENT,
"CP_GetRandomPosOnGeoscape: Get random position on geoscape %.2f:%.2f\n", pos[0], pos[1]);
2117 const float numPoints = 360.0 /
RASTER;
2120 const float offsetY = -1.0 +
frand() * 2.0 / numPoints;
2128 for (y = 0; y < numPoints; y++) {
2129 const float posY = asin(2.0 * y / numPoints + offsetY) *
todeg;
2130 for (x = 0; x < numPoints; x++) {
2131 const float posX = x *
RASTER - 180.0 + offsetX;
2150 randomNum = num = rand() % hits;
2153 for (y = 0; y < numPoints; y++) {
2154 const float posY = asin(2.0 * y / numPoints + offsetY) *
todeg;
2155 for (x = 0; x < numPoints; x++) {
2156 const float posX = x *
RASTER - 180.0 + offsetX;
2165 cgi->Com_DPrintf(
DEBUG_CLIENT,
"CP_GetRandomPosOnGeoscapeWithParameters: New random coords for a mission are %.0f:%.0f, chosen as #%i out of %i possible locations\n",
2166 pos[0], pos[1], randomNum, hits);
2173 cgi->Com_DPrintf(
DEBUG_CLIENT,
"CP_GetRandomPosOnGeoscapeWithParameters: New random coordinates for a mission are %.0f:%.0f, chosen as #%i out of %i possible locations\n",
2174 pos[0], pos[1], num, hits);
2178 assert(pos[0] >= -180);
2179 assert(pos[0] <= 180);
2180 assert(pos[1] >= -90);
2181 assert(pos[1] <= 90);
2206 cgi->Com_Error(
ERR_DROP,
"Couldn't load map mask %s_terrain in pics/geoscape", map);
2211 cgi->Com_Error(
ERR_DROP,
"Couldn't load map mask %s_culture in pics/geoscape", map);
2216 cgi->Com_Error(
ERR_DROP,
"Couldn't load map mask %s_population in pics/geoscape", map);
2221 cgi->Com_Error(
ERR_DROP,
"Couldn't load map mask %s_nations in pics/geoscape", map);
2251 if (
Q_streq(overlayID,
"nation")) {
2252 cgi->Cvar_SetValue(
"geo_overlay_nation", status);
2260 if (
Q_streq(overlayID,
"xvi")) {
2261 cgi->Cvar_SetValue(
"geo_overlay_xvi", status);
2263 if (
Q_streq(overlayID,
"radar")) {
2264 cgi->Cvar_SetValue(
"geo_overlay_radar", status);
2275 if (
cgi->Cmd_Argc() != 3) {
2276 cgi->Com_Printf(
"Usage: %s <nation|xvi|radar> <1|0>\n",
cgi->
Cmd_Argv(0));
2282 const bool setRadar =
Q_streq(overlay,
"radar");
2300 debug_showInterest =
cgi->
Cvar_Get(
"debug_showinterest",
"0",
CVAR_DEVELOPER,
"Shows the global interest value on geoscape");
static void GEO_DrawRadarInMap(const uiNode_t *node, const radar_t *radar, const vec2_t pos)
Draw only the "wire" part of the radar coverage in geoscape.
vec_t VectorLength(const vec3_t v)
Calculate the length of a vector.
static char textStandard[2048]
void GEO_UpdateGeoscapeDock(void)
Will add missions and UFOs to the geoscape dock panel.
static float GEO_AngleOfPath2D(const vec2_t start, const vec2_t end, vec3_t direction, vec3_t ortVector)
Return the angle of a model given its position and destination, on 2D geoscape.
#define VectorCopy(src, dest)
const nationInfo_t * NAT_GetCurrentMonthInfo(const nation_t *const nation)
Get the current month nation stats.
void GEO_NotifyAircraftRemoved(const aircraft_t *aircraft)
Notify that an aircraft has been removed from game.
bool AIR_IsAircraftInBase(const aircraft_t *aircraft)
Checks whether given aircraft is in its homebase.
bool CP_IsRunning(void)
Checks whether a campaign mode game is running.
static const char * GEO_GetCultureTypeByPos(const vec2_t pos)
Determine the culture type under a given position.
static const char * GEO_GetAircraftText(char *buffer, size_t size, const aircraft_t *aircraft)
Assembles a string for an aircraft that is on the geoscape.
#define VectorSet(v, x, y, z)
#define GEO_SetSelectedAircraft(aircraft)
#define GEO_SetInterceptorAircraft(interceptor)
static void GEO_Draw3DMarkerIfVisible(const uiNode_t *node, const vec2_t pos, float theta, const char *model, int skin)
Draws a 3D marker on geoscape if the player can see it.
bool RS_IsResearched_ptr(const technology_t *tech)
Checks whether an item is already researched.
A installation with all it's data.
QGL_EXTERN GLint GLenum type
static void GEO_GetMissionAngle(bool flatgeoscape, float *vector, int id)
center to a mission
float GEO_AngleOfPath(const vec2_t start, const vec2_t end, vec3_t direction, vec3_t ortVector)
Select which function should be used for calculating the direction of model on 2D or 3D geoscape...
#define MapIsSuburban(color)
static byte * populationPic
struct ccs_s::@1 geoscape
void GEO_Init(const char *map)
const char * va(const char *format,...)
does a varargs printf into a temp buffer, so I don't need to have varargs versions of all text functi...
static bool GEO_MapToScreen(const uiNode_t *node, const vec2_t pos, int *x, int *y)
Transform a 2D position on the map to screen coordinates.
void VecToPolar(const vec3_t v, vec2_t a)
Converts vector coordinates into polar coordinates.
static int populationWidth
#define MapIsWestern(color)
This is a cvar definition. Cvars can be user modified and used in our menus e.g.
int AIR_AircraftMenuStatsValues(const int value, const int stat)
Some of the aircraft values needs special calculations when they are shown in the menus...
#define MIS_Foreach(var)
iterates through missions
const char * AIR_AircraftStatusToName(const aircraft_t *aircraft)
Translates the aircraft status id to a translatable string.
static void GEO_RenderImage(int x, int y, const char *image)
static void GEO_DrawMapOneBase(const uiNode_t *node, const base_t *base, bool oneUFOVisible, const char *font)
Draws one base on the geoscape map (2D and 3D)
bool UFO_IsUFOSeenOnGeoscape(const aircraft_t *ufo)
Check if an aircraft should be seen on geoscape.
bool Com_sprintf(char *dest, size_t size, const char *fmt,...)
copies formatted string with buffer-size checking
#define B_IsUnderAttack(base)
void GEO_NotifyUFODisappear(const aircraft_t *ufo)
Notify that a UFO disappears on radars.
void GEO_CalcLine(const vec2_t start, const vec2_t end, mapline_t *line)
Calculate the shortest way to go from start to end on a sphere.
static const char * GEO_GetUFOText(char *buffer, size_t size, const aircraft_t *ufo)
Assembles a string for a UFO that is on the geoscape.
bool AII_InstallationCanShoot(const installation_t *installation)
Check if the installation has a weapon and ammo.
void GEO_InitStartup(void)
Initialise MAP/Geoscape.
void GEO_Draw(geoscapeData_t *data)
Draw the geoscape.
static void GEO_MapDrawLine(const uiNode_t *node, const mapline_t *line)
Draw a path on a menu node (usually the 2D geoscape map)
const struct aircraft_s * ufos[MAX_UFOONGEOSCAPE]
#define B_AtLeastOneExists()
#define MapIsOriental(color)
void CrossProduct(const vec3_t v1, const vec3_t v2, vec3_t cross)
binary operation on vectors in a three-dimensional space
void GEO_NotifyMissionRemoved(const mission_t *mission)
Notify that a mission has been removed.
void GEO_CenterPosition(const vec2_t pos)
Start to rotate or shift the globe to the given position.
void RotatePointAroundVector(vec3_t dst, const vec3_t dir, const vec3_t point, float degrees)
Rotate a point around a given vector.
const byte * GEO_GetColor(const vec2_t pos, mapType_t type, bool *coast)
Returns the color value from geoscape of a certain mask (terrain, culture or population) at a given p...
static const char * GEO_GetMissionText(char *buffer, size_t size, const mission_t *mission)
Assembles a string for a mission that is on the geoscape.
static void GEO_SetOverlay_f(void)
Console command to call GEO_SetOverlay.
#define GEO_GetSelectedAircraft()
int CP_CountMissionOnGeoscape(void)
Count the number of mission active and displayed on geoscape.
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
bool GEO_IsRadarOverlayActivated(void)
float stats[AIR_STATS_MAX]
#define UI_MAPEXTRADATACONST(node)
const char * UFO_GetName(const aircraft_t *ufocraft)
Returns name of the UFO if UFO has been researched.
aircraft_t * UFO_GetNextOnGeoscape(aircraft_t *lastUFO)
static void GEO_StartCenter(uiNode_t *node)
Start center to the selected point.
const char *IMPORT * UI_GetFontFromNode(const uiNode_t *const node)
static bool GEO_AllMapToScreen(const uiNode_t *node, const vec2_t pos, int *x, int *y, int *z)
Call either GEO_MapToScreen or GEO_3DMapToScreen depending on the geoscape you're using...
int INS_GetCount(void)
Get number of installations.
void CP_GameTimeStop(void)
Stop game time speed.
A base with all it's data.
static int centerOnEventIdx
void GEO_ResetAction(void)
No more special action on the geoscape.
int GEO_GetCivilianNumberByPosition(const vec2_t pos)
Get number of civilian on a map at given position.
const linkedList_t *IMPORT * LIST_ContainsString(const linkedList_t *list, const char *string)
static void GEO_DrawAircraftHealthBar(const uiNode_t *node, const aircraft_t *aircraft)
Draws health bar for an aircraft (either phalanx or ufo)
int numInterpolationPoints
Functions to generate and render overlay for geoscape.
int B_GetCount(void)
Returns the count of founded bases.
static int populationHeight
struct technology_s * tech
cvar_t *IMPORT * Cvar_Set(const char *varName, const char *value,...) __attribute__((format(__printf__
#define LinearInterpolation(a, b, x, y)
#define DotProduct(x, y)
Returns the distance between two 3-dimensional vectors.
bool AIR_AircraftHasEnoughFuel(const aircraft_t *aircraft, const vec2_t destination)
check if aircraft has enough fuel to go to destination, and then come back home
#define NAT_Foreach(var)
iterates trough nations
void GEO_NotifyUFORemoved(const aircraft_t *ufo, bool destroyed)
Notify that a UFO has been removed.
#define UFO_GetGeoscapeIDX(ufo)
#define GEO_SetSelectedUFO(ufo)
#define Vector2Set(v, x, y)
int MIS_GetIdx(const mission_t *mis)
Find idx corresponding to mission.
base_t * GEO_PositionCloseToBase(const vec2_t pos)
Check if given pos is close to an existing base.
static void GEO_DrawMapOneMission(const uiNode_t *node, const mission_t *mission)
Draws one mission on the geoscape map (2D and 3D)
Campaign missions headers.
base_t * B_GetNext(base_t *lastBase)
Iterates through founded bases.
#define UI_MAPEXTRADATA(node)
void PolarToVec(const vec2_t a, vec3_t v)
Converts longitude and latitude to a 3D vector in Euclidean coordinates.
const cgame_import_t * cgi
bool GEO_Click(const uiNode_t *node, int x, int y, const vec2_t pos)
Click on the map/geoscape.
bool GEO_PositionFitsTCPNTypes(const vec2_t pos, const linkedList_t *terrainTypes, const linkedList_t *cultureTypes, const linkedList_t *populationTypes, const linkedList_t *nations)
Checks for a given location, if it fulfills all criteria given via parameters (terrain, culture, population, nation type)
static void GEO_DrawBullets(const uiNode_t *node, const vec3_t pos)
Draws a bunch of bullets on the geoscape map.
#define GEO_IsMissionSelected(mission)
#define SELECT_CIRCLE_RADIUS
bool CP_IsXVIVisible(void)
Returns true if the XVI effect should be visible to the player.
static void GEO_GetGeoscapeAngle(vec2_t pos)
Returns position of the model corresponding to centerOnEventIdx.
struct aircraft_s * aircraftTarget
static void GEO_GetUFOAngle(bool flatgeoscape, float *vector, int idx)
center to a ufo
Campaign geoscape time header.
#define GEO_IsInterceptorSelected(aircraft)
Header for Geoscape management.
static void GEO_DrawMapOnePhalanxAircraft(const uiNode_t *node, aircraft_t *aircraft, bool oneUFOVisible)
Draws one Phalanx aircraft on the geoscape map (2D and 3D)
Atomic structure used to define most of the UI.
bool CP_GetRandomPosOnGeoscapeWithParameters(vec2_t pos, const linkedList_t *terrainTypes, const linkedList_t *cultureTypes, const linkedList_t *populationTypes, const linkedList_t *nations)
Determines a random position on geoscape that fulfills certain criteria given via parameters...
const installationTemplate_t * installationTemplate
cvar_t *IMPORT * Cvar_Get(const char *varName, const char *value, int flags, const char *desc)
void PerpendicularVector(vec3_t dst, const vec3_t src)
Finds a vector perpendicular to the source vector.
static const vec4_t yellow
#define GLOBE_RADIUS
radius of the globe in screen coordinates
#define GEO_SetSelectedMission(mission)
bool AIR_IsAircraftOnGeoscape(const aircraft_t *aircraft)
Checks whether given aircraft is on geoscape.
const objDef_t * aircraftItem
static const vec4_t green
bool GEO_IsNight(const vec2_t pos)
Check whether given position is Day or Night.
#define AIR_ForeachFromBase(var, base)
iterates trough all aircraft from a specific homebase
#define MapIsNopopulation(color)
static const char * GEO_GetTerrainTypeByPos(const vec2_t pos, bool *coast)
Determine the terrain type under a given position.
baseWeapon_t batteries[MAX_BASE_SLOT]
vec2_t point[LINE_MAXPTS]
#define CIRCLE_DRAW_POINTS
void GEO_DrawMarkers(const uiNode_t *node)
Draws all ufos, aircraft, bases and so on to the geoscape map (2D and 3D)
static bool GEO_IsNationOverlayActivated(void)
#define DAYS_PER_YEAR_AVG
#define UI_MAP_DIST_SELECTION
maximum distance (in pixel) to get a valid mouse click
#define MapIsAfrican(color)
aircraft_t * attackingAircraft
void CP_GetRandomPosOnGeoscape(vec2_t pos, bool noWater)
Determines a random position on geoscape.
float frand(void)
Return random values between 0 and 1.
aircraftProjectile_t projectiles[MAX_PROJECTILESONGEOSCAPE]
vec3_t projectedPos[MAX_MULTIPLE_PROJECTILES]
#define MapIsEastern(color)
int AIR_GetTeamSize(const aircraft_t *aircraft)
Counts the number of soldiers in given aircraft.
Header for slot management related stuff.
const char *IMPORT * UI_GetActiveWindowName(void)
void GEO_CenterOnPoint_f(void)
Switch to next model on 2D and 3D geoscape.
vec_t VectorNormalize(vec3_t v)
Calculate unit vector for a given vec3_t.
#define MapIsRural(color)
#define MapIsVillage(color)
static const float defaultBaseAngle
static void GEO_3DMapDrawLine(const uiNode_t *node, const mapline_t *line)
Draw a path on a menu node (usually the 3Dgeoscape map)
static uiNode_t * geoscapeNode
void GEO_CheckPositionBoundaries(float *pos)
Check that a position (in latitude / longitude) is within boundaries.
#define VectorEqualEpsilon(a, b, epsilon)
#define GEO_IsUFOSelected(ufo)
static void GEO_DrawRadarLineCoverage(const uiNode_t *node, const radar_t *radar, const vec2_t pos)
Draw only the "wire" Radar coverage.
static void GEO_MapDrawEquidistantPoints(const uiNode_t *node, const vec2_t center, const float angle, const vec4_t color)
Draw equidistant points from a given point on a menu node.
void Q_strcat(char *dest, size_t destsize, const char *format,...)
Safely (without overflowing the destination buffer) concatenates two strings.
#define GEO_GetSelectedMission()
void GEO_PrintParameterStringByPos(const vec2_t pos)
Prints positions parameter in console.
#define MapIsWater(color)
void GEO_SelectUFO(aircraft_t *ufo)
Select the specified ufo on the geoscape.
#define Vector2Copy(src, dest)
static void GEO_SelectObject_f(void)
Center the view and select an object from the geoscape.
Header file for single player campaign control.
void RADAR_UpdateWholeRadarOverlay(void)
Update radar overlay of base, installation and aircraft range.
#define GEO_GetSelectedUFO()
static void GEO_DrawMapOneInstallation(const uiNode_t *node, const installation_t *installation, bool oneUFOVisible, const char *font)
Draws one installation on the geoscape map (2D and 3D)
baseWeapon_t lasers[MAX_BASE_SLOT]
#define MapIsUrban(color)
int AII_BaseCanShoot(const base_t *base)
Check if the base has weapon and ammo.
static bool GEO_IsXVIOverlayActivated(void)
static void GEO_DrawBeam(const uiNode_t *node, const vec3_t start, const vec3_t end, const vec4_t color)
Draws a energy beam on the geoscape map (laser/particle)
GLsizei const GLvoid * data
aircraft_t * aimedAircraft
static void GEO_ConvertObjectPositionToGeoscapePosition(bool flatgeoscape, float *vector, const vec2_t objectPos)
Will set the vector for the geoscape position.
#define AIR_Foreach(var)
iterates trough all aircraft
projectile used during fight between two or more aircraft
static bool GEO_IsPositionSelected(const uiNode_t *node, const vec2_t pos, int x, int y)
Tell if the specified position is considered clicked.
const char * MIS_GetName(const mission_t *mission)
Returns a short translated name for a mission.
An aircraft with all it's data.
vec3_t pos[MAX_MULTIPLE_PROJECTILES]
static const char * GEO_GetPopulationType(const byte *color)
Translate color value to population type.
void GEO_SetOverlay(const char *overlayID, int status)
Turn overlay on/off.
static const char * GEO_GetCultureType(const byte *color)
Translate color value to culture type.
static bool GEO_3DMapToScreen(const uiNode_t *node, const vec2_t pos, int *x, int *y, int *z)
Transform a 2D position on the map to screen coordinates.
QGL_EXTERN int GLboolean GLfloat * v
#define VectorEqual(a, b)
mission_t * MIS_GetByIdx(int id)
Find mission corresponding to idx.
#define Vector4Copy(src, dest)
static float GEO_AngleOfPath3D(const vec2_t start, const vec2_t end, vec3_t direction, vec3_t ortVector)
Return the angle of a model given its position and destination, on 3D geoscape.
nation_t * GEO_GetNation(const vec2_t pos)
Translate nation map color to nation.
A path on the map described by 2D points.
const char *IMPORT * Cmd_Argv(int n)
const char * CP_SecondConvert(int second)
Converts a number of second into a char to display.
static const float MIN_DIST_BASE
Minimum distance between a new mission and an existing base.
#define VectorSubtract(a, b, dest)
mission_t * GEO_SelectMission(mission_t *mission)
Select the specified mission.
baseWeapon_t batteries[MAX_INSTALLATION_BATTERIES]
const char * MIS_GetModel(const mission_t *mission)
Get mission model that should be shown on the geoscape.
void GEO_SelectAircraft(aircraft_t *aircraft)
Select the specified aircraft on the geoscape.
double GetDistanceOnGlobe(const vec2_t pos1, const vec2_t pos2)
Calculate distance on the geoscape.
Detailed information about the nation relationship (currently per month, but could be used elsewhere)...
static const char * GEO_GetPopulationTypeByPos(const vec2_t pos)
Determine the population type under a given position.
#define GEO_IsAircraftSelected(aircraft)
void GEO_Reset(const char *map)
const char * getTerrainName(const byte *const color) const
Translate color value to terrain type.