UFO: Alien Invasion
Loading...
Searching...
No Matches
ui_node_geoscape.h
Go to the documentation of this file.
1
4
5/*
6Copyright (C) 2002-2025 UFO: Alien Invasion.
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; either version 2
11of the License, or (at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23*/
24
25#pragma once
26
27#include "../ui_nodes.h"
29#include "../../cl_shared.h"
30
32protected:
33 void smoothTranslate (uiNode_t* node);
34 void smoothRotate (uiNode_t* node);
35 void screenTo3DMap (const uiNode_t* node, int x, int y, vec2_t pos);
36 void screenToMap (const uiNode_t* node, int x, int y, vec2_t pos);
37 void calcAndUploadDayAndNightTexture (uiNode_t* node, float q);
38public:
39 void draw(uiNode_t* node) override;
40 void onMouseUp(uiNode_t* node, int x, int y, int button) override;
41 void onCapturedMouseMove(uiNode_t* node, int x, int y) override;
42 void onCapturedMouseLost(uiNode_t* node) override;
43 void onLoading(uiNode_t* node) override;
44 bool onScroll(uiNode_t* node, int deltaX, int deltaY) override;
45 void onLeftClick(uiNode_t* node, int x, int y) override;
46 bool onStartDragging(uiNode_t* node, int startX, int startY, int currentX, int currentY, int button) override;
47 void zoom(uiNode_t* node, bool out);
48 void startMouseShifting(uiNode_t* node, int x, int y);
49};
50
51#define UI_MAPEXTRADATA_TYPE mapExtraData_t
52#define UI_MAPEXTRADATA(node) UI_EXTRADATA(node, UI_MAPEXTRADATA_TYPE)
53#define UI_MAPEXTRADATACONST(node) UI_EXTRADATACONST(node, UI_MAPEXTRADATA_TYPE)
54
55#define DAN_WIDTH 2048
56#define DAN_HEIGHT 1024
57
62#define STANDARD_3D_ZOOM 40.0f
63
64#define EARTH_RADIUS 8192.0f
65#define MOON_RADIUS 1024.0f
66#define SUN_RADIUS 1024.0f
67
69#define GLOBE_RADIUS EARTH_RADIUS * (UI_MAPEXTRADATACONST(node).zoom / STANDARD_3D_ZOOM)
70
98
Share stuff between the different cgame implementations.
void onLoading(uiNode_t *node) override
Called before loading. Used to set default attribute values.
void screenToMap(const uiNode_t *node, int x, int y, vec2_t pos)
Return longitude and latitude of a point of the screen for 2D geoscape.
void screenTo3DMap(const uiNode_t *node, int x, int y, vec2_t pos)
Return longitude and latitude of a point of the screen for 3D geoscape (globe).
void smoothTranslate(uiNode_t *node)
smooth translation of the 2D geoscape
void startMouseShifting(uiNode_t *node, int x, int y)
void onMouseUp(uiNode_t *node, int x, int y, int button) override
bool onStartDragging(uiNode_t *node, int startX, int startY, int currentX, int currentY, int button) override
Send mouse event when a pressed mouse button is dragged.
void calcAndUploadDayAndNightTexture(uiNode_t *node, float q)
Applies alpha values to the night overlay image for 2d geoscape.
void onCapturedMouseLost(uiNode_t *node) override
Called when the node have lost the captured node We clean cached data.
void draw(uiNode_t *node) override
void smoothRotate(uiNode_t *node)
smooth rotation of the 3D geoscape
bool onScroll(uiNode_t *node, int deltaX, int deltaY) override
void zoom(uiNode_t *node, bool out)
void onCapturedMouseMove(uiNode_t *node, int x, int y) override
void onLeftClick(uiNode_t *node, int x, int y) override
vec2_t smoothFinal2DGeoscapeCenter
geoscapeData_t * geoscapeData
vec3_t smoothFinalGlobeAngle
node behaviour, how a node work
Atomic structure used to define most of the UI.
Definition ui_nodes.h:80
vec_t vec3_t[3]
Definition ufotypes.h:39
vec_t vec2_t[2]
Definition ufotypes.h:38
static int startY
static int startX
void UI_RegisterGeoscapeNode(uiBehaviour_t *behaviour)