UFO: Alien Invasion
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. More...
 
void GEO_DrawMarkers (const uiNode_t *node)
 Draws all ufos, aircraft, bases and so on to the geoscape map (2D and 3D) More...
 
bool GEO_Click (const uiNode_t *node, int x, int y, const vec2_t pos)
 Click on the map/geoscape. More...
 
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 cgame_import_t::Alloc(), and 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, cgame_import_t::csi, index, and csi_t::mds.

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, cgame_import_t::csi, and csi_t::numMDs.

◆ FS_CloseFile()

◆ GEO_Click()

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

◆ GEO_Draw()

◆ GEO_DrawMarkers()

void GEO_DrawMarkers ( const uiNode_t node)

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, ccs_t::frametime, ccs_t::gameTimeScale, 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, ccs_t::numProjectiles, mapline_t::point, aircraft_t::pos, aircraftProjectile_t::pos, aircraftProjectile_t::projectedPos, ccs_t::projectiles, Q_strcat(), aircraft_t::route, RS_IsResearched_ptr(), SELECT_CIRCLE_RADIUS, aircraft_t::tech, TEXT_XVI, UFO_GetNextOnGeoscape(), cgame_import_t::UI_GetFontFromNode(), 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, and cgame_import_t::LIST_CopyStructure().

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().