UFO: Alien Invasion
Loading...
Searching...
No Matches
cl_game_campaign.cpp File Reference

Singleplayer campaign game type code. More...

#include "../../cl_shared.h"
#include "../cl_game.h"
#include "cp_cgame_callbacks.h"
#include "cl_game_campaign.h"
Include dependency graph for cl_game_campaign.cpp:

Go to the source code of this file.

Functions

void GEO_Draw (geoscapeData_t *data)
 Draw the geoscape.
void GEO_DrawMarkers (const uiNode_t *node)
 Draws all ufos, aircraft, bases and so on to the geoscape map (2D and 3D).
bool GEO_Click (const uiNode_t *node, int x, int y, const vec2_t pos)
 Click on the map/geoscape.
CGAME_HARD_LINKED_FUNCTIONS linkedList_tLIST_Add (linkedList_t **listDest, void const *data, size_t length)
void FS_CloseFile (qFILE *f)
void LIST_Sort (linkedList_t **list, linkedListSort_t sorter, const void *userData)
linkedList_tLIST_CopyStructure (linkedList_t *src)
void_Mem_Alloc (size_t size, bool zeroFill, memPool_t *pool, const int tagNum, const char *fileName, const int fileLine)
int Com_GetMapDefNumber (void)
mapDef_tCom_GetMapDefByIDX (int index)
const cgame_export_tGetCGameAPI (const cgame_import_t *import)

Detailed Description

Singleplayer campaign game type code.

Definition in file cl_game_campaign.cpp.

Function Documentation

◆ _Mem_Alloc()

void * _Mem_Alloc ( size_t size,
bool zeroFill,
memPool_t * pool,
const int tagNum,
const char * fileName,
const int fileLine )

Definition at line 56 of file cl_game_campaign.cpp.

References cgi.

Referenced by GAME_GetImportData(), and SV_TagAlloc().

◆ Com_GetMapDefByIDX()

mapDef_t * Com_GetMapDefByIDX ( int index)

Definition at line 64 of file cl_game_campaign.cpp.

References cgi, and index.

Referenced by GAME_GetCurrentSelectedMap(), and UI_MapInfoGetNext().

◆ Com_GetMapDefNumber()

int Com_GetMapDefNumber ( void )

Definition at line 60 of file cl_game_campaign.cpp.

References cgi.

◆ FS_CloseFile()

◆ GEO_Click()

bool GEO_Click ( const uiNode_t * node,
int x,
int y,
const vec2_t pos )
extern

Click on the map/geoscape.

Parameters
[in]nodeUI Node of the geoscape map
[in]x,yMouse click coordinates
[in]posGeoscape (longitude, latitude) coordinate of the click
Returns
True if the event is used for something
Todo
make this a function in cp_base.c - B_BuildBaseAtPos

Definition at line 107 of file cp_geoscape.cpp.

References AIR_AircraftHasEnoughFuel(), AIR_Foreach, AIR_IsAircraftOnGeoscape(), AIR_TRANSIT, aircraft_t::aircraftTarget, B_GetCount(), B_GetNext(), ccs, cgi, CP_GameTimeStop(), GEO_CalcLine(), GEO_GetColor(), GEO_GetSelectedAircraft, GEO_IsPositionSelected(), GEO_ResetAction(), base_t::idx, INS_Foreach, MA_NEWBASE, MA_NEWINSTALLATION, MapIsWater, MAPTYPE_TERRAIN, MAX_BASES, MIS_Foreach, MIS_GetIdx(), MIS_GetName(), base_t::name, aircraft_t::point, aircraft_t::pos, base_t::pos, aircraft_t::route, STAGE_NOT_ACTIVE, aircraft_t::status, aircraft_t::time, UFO_GetGeoscapeIDX, UFO_GetName(), UFO_GetNextOnGeoscape(), and Vector2Copy.

Referenced by GetCGameAPI().

◆ GEO_Draw()

◆ GEO_DrawMarkers()

void GEO_DrawMarkers ( const uiNode_t * node)
extern

Draws all ufos, aircraft, bases and so on to the geoscape map (2D and 3D).

Parameters
[in]nodeThe menu node which will be used for drawing markers.
Note
This is a drawing function only, called each time a frame is drawn. Therefore you should not use this function to calculate eg. the distance between 2 items on the geoscape (you should instead calculate it just after one of the items moved – distance is not going to change when you rotate the earth around itself and the time is stopped eg.).
See also
GEO_Draw
Todo
we should only show healthbar if aircraft is fighting but it's a slow algo

Definition at line 1432 of file cp_geoscape.cpp.

References _, aircraftProjectile_t::aimedAircraft, AIR_Foreach, AIR_IsAircraftOnGeoscape(), aircraftProjectile_t::aircraftItem, ALIGN_UC, aircraftProjectile_t::angle, aircraftProjectile_t::attackerPos, aircraftProjectile_t::attackingAircraft, B_GetNext(), aircraftProjectile_t::beam, craftItem::beamColor, aircraftProjectile_t::bullets, ccs, cgi, uiNode_t::color, CP_IsXVIVisible(), objDef_t::craftitem, data, aircraft_t::direction, GEO_3DMapDrawLine(), GEO_AllMapToScreen(), GEO_AngleOfPath(), GEO_Draw3DMarkerIfVisible(), GEO_DrawAircraftHealthBar(), GEO_DrawBeam(), GEO_DrawBullets(), GEO_DrawMapOneBase(), GEO_DrawMapOneInstallation(), GEO_DrawMapOneMission(), GEO_DrawMapOnePhalanxAircraft(), GEO_IsUFOSelected, GEO_MapDrawEquidistantPoints(), GEO_MapDrawLine(), GEO_RenderImage(), aircraftProjectile_t::hasMoved, i, aircraftProjectile_t::idleTarget, INS_Foreach, LinearInterpolation, MIS_Foreach, aircraft_t::model, objDef_t::model, NAT_Foreach, NAT_GetCurrentMonthInfo(), aircraftProjectile_t::numInterpolationPoints, mapline_t::numPoints, mapline_t::point, aircraft_t::pos, aircraftProjectile_t::pos, aircraftProjectile_t::projectedPos, Q_strcat(), aircraft_t::route, RS_IsResearched_ptr(), SELECT_CIRCLE_RADIUS, aircraft_t::tech, TEXT_XVI, UFO_GetNextOnGeoscape(), UI_MAPEXTRADATACONST, VectorCopy, nationInfo_t::xviInfection, and yellow.

Referenced by GetCGameAPI().

◆ GetCGameAPI()

◆ LIST_Add()

◆ LIST_CopyStructure()

linkedList_t * LIST_CopyStructure ( linkedList_t * src)

Definition at line 52 of file cl_game_campaign.cpp.

References cgi.

Referenced by GAME_GetImportData(), and TEST_F().

◆ LIST_Sort()

void LIST_Sort ( linkedList_t ** list,
linkedListSort_t sorter,
const void * userData )

Definition at line 48 of file cl_game_campaign.cpp.

References cgi.

Referenced by GAME_GetImportData(), and TEST_F().