diff options
Diffstat (limited to 'linden/indra/newview/viewer.h')
-rw-r--r-- | linden/indra/newview/viewer.h | 325 |
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 | ||
49 | extern BOOL gHackGodmode; | ||
50 | #endif | ||
51 | |||
52 | |||
53 | // | ||
54 | // Forward Declarations | ||
55 | // | ||
56 | class LLAudioEngine; | ||
57 | class LLFrameTimer; | ||
58 | class LLMessageSystem; | ||
59 | class LLHost; | ||
60 | class LLPieMenu; | ||
61 | class LLWorkerThread; | ||
62 | class LLTextureFetch; | ||
63 | class LLTextureCache; | ||
64 | class LLPumpIO; | ||
65 | class LLHTTPNode; | ||
66 | class LLTimer; | ||
67 | class LLUUID; | ||
68 | class LLVector3; | ||
69 | class LLVector3d; | ||
70 | class LLViewerObject; | ||
71 | class LLViewerRegion; | ||
72 | class LLVFS; | ||
73 | |||
74 | // | ||
75 | // Global Variables | ||
76 | // | ||
77 | |||
78 | extern LLString gSecondLife; | ||
79 | |||
80 | extern S32 gNumSessions; | ||
81 | extern BOOL gNoRender; | ||
82 | extern LLMemoryInfo gSysMemory; | ||
83 | extern BOOL gLogMessages; | ||
84 | extern BOOL gUseAudio; | ||
85 | extern bool gPreloadImages; | ||
86 | extern BOOL gGodConnect; | ||
87 | extern LLString gCmdLineFirstName; | ||
88 | extern LLString gCmdLineLastName; | ||
89 | extern LLString gCmdLinePassword; | ||
90 | extern BOOL gAutoLogin; | ||
91 | extern U32 gFrameCount; | ||
92 | extern U32 gForegroundFrameCount; | ||
93 | extern BOOL gRequestInventoryLibrary; | ||
94 | extern BOOL gAcceptTOS; | ||
95 | extern BOOL gAcceptCriticalMessage; | ||
96 | extern std::string gChannelName; | ||
97 | extern LLUUID gInventoryLibraryOwner; | ||
98 | extern LLUUID gInventoryLibraryRoot; | ||
99 | extern BOOL gLastExecFroze; | ||
100 | extern F32 gLogoutMaxTime; | ||
101 | extern LLTimer gRenderStartTime; | ||
102 | extern LLFrameTimer gForegroundTime; | ||
103 | extern LLTimer gLogoutTimer; | ||
104 | extern BOOL gInProductionGrid; | ||
105 | extern S32 gCrashBehavior; | ||
106 | extern bool gVerifySSLCert; | ||
107 | extern const char* DEFAULT_SETTINGS_FILE; | ||
108 | |||
109 | // TODO: Eliminate most of these, move into a globals structure. | ||
110 | extern const U32 PATCH_SIZE; | ||
111 | extern const LLVector3 DEFAULT_OBJECT_SCALE; | ||
112 | extern BOOL gDisconnected; | ||
113 | extern BOOL gDisableVoice; | ||
114 | extern BOOL gQuit; // We're done, quit after processing this message. | ||
115 | extern BOOL gQuitRequested; // User wants to quit, may have modified documents open. | ||
116 | extern BOOL gLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim. | ||
117 | extern BOOL gInitializationComplete; // OK to call display() and idle() | ||
118 | extern BOOL gUseWireframe; | ||
119 | extern BOOL gPurgeCache; // Cache was purged on startup | ||
120 | extern U32 gSecondsPerDay; | ||
121 | extern U32 gSecondsPerYear; | ||
122 | // Is the Pacific time zone (aka server time zone) | ||
123 | // currently in daylight savings time? | ||
124 | extern BOOL gPacificDaylightTime; | ||
125 | |||
126 | extern LLString gLastVersionChannel; | ||
127 | |||
128 | extern LLVector3 gWindVec; | ||
129 | extern LLVector3 gRelativeWindVec; | ||
130 | |||
131 | extern U64 gFrameTime; // The timestamp of the most-recently-processed frame | ||
132 | extern F32 gFrameTimeSeconds; // Loses msec precision after ~4.5 hours... | ||
133 | extern F32 gFrameIntervalSeconds; // Elapsed time between current and previous gFrameTimeSeconds | ||
134 | extern F32 gFPSClamped; // Frames per second, smoothed, weighted toward last frame | ||
135 | extern F32 gFrameDTClamped; | ||
136 | extern U64 gStartTime; | ||
137 | |||
138 | extern LLFrameTimer gRestoreGLTimer; | ||
139 | extern BOOL gRestoreGL; | ||
140 | |||
141 | extern BOOL gDisplayCameraPos; | ||
142 | extern BOOL gDisplayWindInfo; | ||
143 | extern BOOL gDisplayNearestWater; | ||
144 | extern BOOL gDisplayFOV; | ||
145 | extern BOOL gForceRenderLandFence; | ||
146 | |||
147 | extern BOOL gAllowIdleAFK; | ||
148 | extern F32 gAFKTimeout; | ||
149 | extern BOOL gShowObjectUpdates; | ||
150 | |||
151 | extern BOOL gTeleportDisplay; | ||
152 | extern LLFrameTimer gTeleportDisplayTimer; | ||
153 | |||
154 | extern 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 | ||
159 | extern LLVFS *gStaticVFS; | ||
160 | |||
161 | extern LLUUID gViewerDigest; // MD5 digest of the viewer's executable file. | ||
162 | |||
163 | extern LLWorkerThread* gImageDecodeThread; | ||
164 | extern LLTextureFetch* gTextureFetch; | ||
165 | extern LLTextureCache* gTextureCache; | ||
166 | |||
167 | extern LLPumpIO* gServicePump; | ||
168 | |||
169 | extern LLUUID gSunTextureID; | ||
170 | extern LLUUID gMoonTextureID; | ||
171 | |||
172 | extern BOOL gHandleKeysAsync; | ||
173 | |||
174 | // Map scale in pixels per region | ||
175 | extern F32 gMapScale; | ||
176 | extern F32 gMiniMapScale; | ||
177 | |||
178 | extern F32 gMouseSensitivity; | ||
179 | extern BOOL gInvertMouse; | ||
180 | |||
181 | // | ||
182 | // Defines and constants | ||
183 | // | ||
184 | |||
185 | const S32 AGENT_UPDATES_PER_SECOND = 10; | ||
186 | |||
187 | // Global because multiple functions need to identify the window | ||
188 | // by its name. | ||
189 | extern LLString gWindowTitle; | ||
190 | extern LLString gDisabledMessage; | ||
191 | extern 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 | ||
204 | const 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 | }; | ||
215 | const 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 | |||
227 | const BOOL FOR_SELECTION = TRUE; | ||
228 | const BOOL NOT_FOR_SELECTION = FALSE; | ||
229 | |||
230 | const U8 YES_PHYSICS = 1; | ||
231 | const U8 NO_PHYSICS = 0; | ||
232 | |||
233 | // | ||
234 | // Prototypes | ||
235 | // | ||
236 | void display(BOOL rebuild = TRUE, F32 zoom_factor = 1.f, int subfield = 0); | ||
237 | void draw_axes(); | ||
238 | |||
239 | void fire_shot(const U8 shot_type, const U8 use_physics ); | ||
240 | void 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 | |||
248 | BOOL add_object(LLPCode pcode, S32 screen_x, S32 screen_y, U8 use_physics); | ||
249 | |||
250 | void idle(); | ||
251 | void idle_network(); | ||
252 | void init_audio(); | ||
253 | void init_textures(); | ||
254 | void init_landscape(); | ||
255 | void keyboard(char key); | ||
256 | void keyboard_windows(char key); | ||
257 | void kill_all_trees(); | ||
258 | void move_sun(); | ||
259 | BOOL 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 | |||
261 | void audio_update_volume(bool force_update = true); | ||
262 | void audio_update_listener(); | ||
263 | void audio_update_wind(bool force_update = true); | ||
264 | |||
265 | // Saves the final snapshot, but only once. | ||
266 | void save_final_snapshot(void*); | ||
267 | |||
268 | // Call when user is requesting application to quit, ask for confirmation. | ||
269 | void app_user_quit(); | ||
270 | |||
271 | // Call when user is requesting application to quit. | ||
272 | void app_request_quit(); | ||
273 | |||
274 | // Call when user aborts the quit, for example, canceling a required save of | ||
275 | // dirty document. | ||
276 | void app_abort_quit(); | ||
277 | |||
278 | // Call if you need to quit immediately. You can optionally | ||
279 | // spawn a web page or open another application. | ||
280 | void app_force_quit(const char* launch_file_on_quit = NULL); | ||
281 | |||
282 | // Display an error dialog and forcibly quit. | ||
283 | void app_early_exit(const LLString& message); | ||
284 | |||
285 | // exit() immediately (after some cleanup) | ||
286 | void app_force_exit(S32 arg); | ||
287 | |||
288 | void do_disconnect(const LLString& message); | ||
289 | void send_logout_request(); | ||
290 | void save_avatar(void*); | ||
291 | |||
292 | void set_view(S32 which); | ||
293 | |||
294 | void user_logout(); | ||
295 | |||
296 | F32 mouse_x_from_center(S32 x); | ||
297 | F32 mouse_y_from_center(S32 x); | ||
298 | |||
299 | void print_agent_nvpairs(void*); | ||
300 | void reload_viewer(void); | ||
301 | void reset_statistics(); | ||
302 | void output_statistics(void*); | ||
303 | void write_debug(const char *str); | ||
304 | void write_debug(const std::string& str); | ||
305 | void login_alert_done(S32 option, void* user_data); | ||
306 | void callback_cache_name(const LLUUID& id, const char* firstname, const char* lastname, BOOL is_group, void* data); | ||
307 | void load_name_cache(); | ||
308 | void remove_marker_file(); | ||
309 | |||
310 | // Avoid including llagent.h everywhere. This returns gAgent.getID(). | ||
311 | const LLUUID& agent_get_id(); | ||
312 | const LLUUID& agent_get_session_id(); | ||
313 | void agent_send_reliable_message(); | ||
314 | |||
315 | // Helpers for URIs | ||
316 | const std::vector<std::string>& getLoginURIs(); | ||
317 | const std::string& getHelperURI(); | ||
318 | void resetURIs(); | ||
319 | |||
320 | #if LL_WINDOWS | ||
321 | class llLCD; | ||
322 | extern llLCD *gLcdScreen; | ||
323 | #endif | ||
324 | |||
325 | #endif | ||