aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/viewer.h
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/viewer.h')
-rw-r--r--linden/indra/newview/viewer.h325
1 files changed, 0 insertions, 325 deletions
diff --git a/linden/indra/newview/viewer.h b/linden/indra/newview/viewer.h
deleted file mode 100644
index afd62a7..0000000
--- a/linden/indra/newview/viewer.h
+++ /dev/null
@@ -1,325 +0,0 @@
1/**
2 * @file viewer.h
3 * @brief Main file for viewer.
4 *
5 * $LicenseInfo:firstyear=2000&license=viewergpl$
6 *
7 * Copyright (c) 2000-2007, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception
21 *
22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above,
24 * and agree to abide by those obligations.
25 *
26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
30 */
31
32#ifndef LL_VIEWER_H
33#define LL_VIEWER_H
34
35// DO NOT ADD DEPENDENCIES HERE
36// Almost every file in the viewer depends on this file.
37// If you need to add a shared class, put it in its own
38// little file. JC
39
40// *TODO: remove this, viewer.h doesn't need it, but there
41// are lots of .cpp files that depend on this recursive
42// dependency.
43#include "llviewercontrol.h"
44
45// Enabled this definition to compile a 'hacked' viewer that
46// allows a hacked godmode to be toggled on and off.
47#define TOGGLE_HACKED_GODLIKE_VIEWER
48#ifdef TOGGLE_HACKED_GODLIKE_VIEWER
49extern BOOL gHackGodmode;
50#endif
51
52
53//
54// Forward Declarations
55//
56class LLAudioEngine;
57class LLFrameTimer;
58class LLMessageSystem;
59class LLHost;
60class LLPieMenu;
61class LLWorkerThread;
62class LLTextureFetch;
63class LLTextureCache;
64class LLPumpIO;
65class LLHTTPNode;
66class LLTimer;
67class LLUUID;
68class LLVector3;
69class LLVector3d;
70class LLViewerObject;
71class LLViewerRegion;
72class LLVFS;
73
74//
75// Global Variables
76//
77
78extern LLString gSecondLife;
79
80extern S32 gNumSessions;
81extern BOOL gNoRender;
82extern LLMemoryInfo gSysMemory;
83extern BOOL gLogMessages;
84extern BOOL gUseAudio;
85extern bool gPreloadImages;
86extern BOOL gGodConnect;
87extern LLString gCmdLineFirstName;
88extern LLString gCmdLineLastName;
89extern LLString gCmdLinePassword;
90extern BOOL gAutoLogin;
91extern U32 gFrameCount;
92extern U32 gForegroundFrameCount;
93extern BOOL gRequestInventoryLibrary;
94extern BOOL gAcceptTOS;
95extern BOOL gAcceptCriticalMessage;
96extern std::string gChannelName;
97extern LLUUID gInventoryLibraryOwner;
98extern LLUUID gInventoryLibraryRoot;
99extern BOOL gLastExecFroze;
100extern F32 gLogoutMaxTime;
101extern LLTimer gRenderStartTime;
102extern LLFrameTimer gForegroundTime;
103extern LLTimer gLogoutTimer;
104extern BOOL gInProductionGrid;
105extern S32 gCrashBehavior;
106extern bool gVerifySSLCert;
107extern const char* DEFAULT_SETTINGS_FILE;
108
109// TODO: Eliminate most of these, move into a globals structure.
110extern const U32 PATCH_SIZE;
111extern const LLVector3 DEFAULT_OBJECT_SCALE;
112extern BOOL gDisconnected;
113extern BOOL gDisableVoice;
114extern BOOL gQuit; // We're done, quit after processing this message.
115extern BOOL gQuitRequested; // User wants to quit, may have modified documents open.
116extern BOOL gLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim.
117extern BOOL gInitializationComplete; // OK to call display() and idle()
118extern BOOL gUseWireframe;
119extern BOOL gPurgeCache; // Cache was purged on startup
120extern U32 gSecondsPerDay;
121extern U32 gSecondsPerYear;
122// Is the Pacific time zone (aka server time zone)
123// currently in daylight savings time?
124extern BOOL gPacificDaylightTime;
125
126extern LLString gLastVersionChannel;
127
128extern LLVector3 gWindVec;
129extern LLVector3 gRelativeWindVec;
130
131extern U64 gFrameTime; // The timestamp of the most-recently-processed frame
132extern F32 gFrameTimeSeconds; // Loses msec precision after ~4.5 hours...
133extern F32 gFrameIntervalSeconds; // Elapsed time between current and previous gFrameTimeSeconds
134extern F32 gFPSClamped; // Frames per second, smoothed, weighted toward last frame
135extern F32 gFrameDTClamped;
136extern U64 gStartTime;
137
138extern LLFrameTimer gRestoreGLTimer;
139extern BOOL gRestoreGL;
140
141extern BOOL gDisplayCameraPos;
142extern BOOL gDisplayWindInfo;
143extern BOOL gDisplayNearestWater;
144extern BOOL gDisplayFOV;
145extern BOOL gForceRenderLandFence;
146
147extern BOOL gAllowIdleAFK;
148extern F32 gAFKTimeout;
149extern BOOL gShowObjectUpdates;
150
151extern BOOL gTeleportDisplay;
152extern LLFrameTimer gTeleportDisplayTimer;
153
154extern std::map<S32,LLFrameTimer> gDebugTimers;
155
156// VFS globals - gVFS is for general use
157// gStaticVFS is read-only and is shipped w/ the viewer
158// it has pre-cache data like the UI .TGAs
159extern LLVFS *gStaticVFS;
160
161extern LLUUID gViewerDigest; // MD5 digest of the viewer's executable file.
162
163extern LLWorkerThread* gImageDecodeThread;
164extern LLTextureFetch* gTextureFetch;
165extern LLTextureCache* gTextureCache;
166
167extern LLPumpIO* gServicePump;
168
169extern LLUUID gSunTextureID;
170extern LLUUID gMoonTextureID;
171
172extern BOOL gHandleKeysAsync;
173
174// Map scale in pixels per region
175extern F32 gMapScale;
176extern F32 gMiniMapScale;
177
178extern F32 gMouseSensitivity;
179extern BOOL gInvertMouse;
180
181//
182// Defines and constants
183//
184
185const S32 AGENT_UPDATES_PER_SECOND = 10;
186
187// Global because multiple functions need to identify the window
188// by its name.
189extern LLString gWindowTitle;
190extern LLString gDisabledMessage;
191extern BOOL gHideLinks;
192
193#define REGIONS_PER_LANDSCAPE_EDGE 3
194#define NUMBER_OF_REGIONS (REGIONS_PER_LANDSCAPE_EDGE \
195 * REGIONS_PER_LANDSCAPE_EDGE)
196#define CENTER_REGION ((REGIONS_PER_LANDSCAPE_EDGE / 2) \
197 * REGIONS_PER_LANDSCAPE_EDGE \
198 + REGIONS_PER_LANDSCAPE_EDGE / 2)
199
200
201// translates constant EAST, NORTH, WEST, etc. to x,y offsets
202// eg, EAST = +1, 0
203// eg, SOUTHWEST = -1, -1
204const S32 MAP_REGION_TO_X[NUMBER_OF_REGIONS - 1] =
205{
206 1, // east
207 0, // north
208 -1, // west
209 0, // south
210 1, // northeast
211 -1, // northwest
212 -1, // southwest
213 1 // southeast
214};
215const S32 MAP_REGION_TO_Y[NUMBER_OF_REGIONS - 1] =
216{
217 0, // east
218 1, // north
219 0, // west
220 -1, // south
221 1, // northeast
222 1, // northwest
223 -1, // southwest
224 -1 // southeast
225};
226
227const BOOL FOR_SELECTION = TRUE;
228const BOOL NOT_FOR_SELECTION = FALSE;
229
230const U8 YES_PHYSICS = 1;
231const U8 NO_PHYSICS = 0;
232
233//
234// Prototypes
235//
236void display(BOOL rebuild = TRUE, F32 zoom_factor = 1.f, int subfield = 0);
237void draw_axes();
238
239void fire_shot(const U8 shot_type, const U8 use_physics );
240void add_object(LLPCode pcode,
241 U8 use_physics,
242 const LLVector3d &object_pos_global,
243 const LLQuaternion &rotation,
244 const LLVector3 &scale,
245 const LLVector3 &velocity,
246 const LLVector3 &angular_velocity);
247
248BOOL add_object(LLPCode pcode, S32 screen_x, S32 screen_y, U8 use_physics);
249
250void idle();
251void idle_network();
252void init_audio();
253void init_textures();
254void init_landscape();
255void keyboard(char key);
256void keyboard_windows(char key);
257void kill_all_trees();
258void move_sun();
259BOOL raycast_for_new_obj_pos( S32 x, S32 y, LLViewerObject** hit_obj, S32* hit_face, BOOL* b_hit_land, LLVector3* ray_start_region, LLVector3* ray_end_region, LLViewerRegion** region );
260
261void audio_update_volume(bool force_update = true);
262void audio_update_listener();
263void audio_update_wind(bool force_update = true);
264
265// Saves the final snapshot, but only once.
266void save_final_snapshot(void*);
267
268// Call when user is requesting application to quit, ask for confirmation.
269void app_user_quit();
270
271// Call when user is requesting application to quit.
272void app_request_quit();
273
274// Call when user aborts the quit, for example, canceling a required save of
275// dirty document.
276void app_abort_quit();
277
278// Call if you need to quit immediately. You can optionally
279// spawn a web page or open another application.
280void app_force_quit(const char* launch_file_on_quit = NULL);
281
282// Display an error dialog and forcibly quit.
283void app_early_exit(const LLString& message);
284
285// exit() immediately (after some cleanup)
286void app_force_exit(S32 arg);
287
288void do_disconnect(const LLString& message);
289void send_logout_request();
290void save_avatar(void*);
291
292void set_view(S32 which);
293
294void user_logout();
295
296F32 mouse_x_from_center(S32 x);
297F32 mouse_y_from_center(S32 x);
298
299void print_agent_nvpairs(void*);
300void reload_viewer(void);
301void reset_statistics();
302void output_statistics(void*);
303void write_debug(const char *str);
304void write_debug(const std::string& str);
305void login_alert_done(S32 option, void* user_data);
306void callback_cache_name(const LLUUID& id, const char* firstname, const char* lastname, BOOL is_group, void* data);
307void load_name_cache();
308void remove_marker_file();
309
310// Avoid including llagent.h everywhere. This returns gAgent.getID().
311const LLUUID& agent_get_id();
312const LLUUID& agent_get_session_id();
313void agent_send_reliable_message();
314
315// Helpers for URIs
316const std::vector<std::string>& getLoginURIs();
317const std::string& getHelperURI();
318void resetURIs();
319
320#if LL_WINDOWS
321class llLCD;
322extern llLCD *gLcdScreen;
323#endif
324
325#endif