diff options
author | Jacek Antonelli | 2008-08-15 23:45:42 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:42 -0500 |
commit | ce28e056c20bf2723f565bbf464b87781ec248a2 (patch) | |
tree | ef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/llcommon | |
parent | Second Life viewer sources 1.19.1.4b (diff) | |
download | meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2 meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz |
Second Life viewer sources 1.20.2
Diffstat (limited to '')
27 files changed, 267 insertions, 211 deletions
diff --git a/linden/indra/llcommon/imageids.h b/linden/indra/llcommon/imageids.h index 4a1e221..9361479 100644 --- a/linden/indra/llcommon/imageids.h +++ b/linden/indra/llcommon/imageids.h | |||
@@ -43,60 +43,34 @@ | |||
43 | // pre-cached on viewer | 43 | // pre-cached on viewer |
44 | 44 | ||
45 | // Grass Images | 45 | // Grass Images |
46 | //const LLUUID IMG_GRASS1 ("990c4086-46ce-49bd-8cae-afcc23a08f4e"); // dataserver | ||
47 | //const LLUUID IMG_GRASS2 ("869e2dcf-21b9-402d-a36d-9a23365cf723"); // dataserver | ||
48 | //const LLUUID IMG_GRASS3 ("8f97e7a7-f664-4967-9e8f-8d9e8039c1b7"); // dataserver | ||
49 | |||
50 | //const LLUUID IMG_GRASS4 ("8a05131d-35b7-4812-bcfc-a989b0f954ef"); // dataserver | ||
51 | |||
52 | //const LLUUID IMG_GRASS5 ("7d092acb-c69a-4122-b09b-f285e009b185"); // dataserver | ||
53 | |||
54 | const LLUUID IMG_CLEAR ("11ee27f5-43c0-414e-afd5-d7f5688c351f"); // VIEWER | ||
55 | const LLUUID IMG_SMOKE ("b4ba225c-373f-446d-9f7e-6cb7b5cf9b3d"); // VIEWER | 46 | const LLUUID IMG_SMOKE ("b4ba225c-373f-446d-9f7e-6cb7b5cf9b3d"); // VIEWER |
56 | 47 | ||
57 | const LLUUID IMG_DEFAULT ("d2114404-dd59-4a4d-8e6c-49359e91bbf0"); // VIEWER | 48 | const LLUUID IMG_DEFAULT ("d2114404-dd59-4a4d-8e6c-49359e91bbf0"); // VIEWER |
58 | 49 | ||
59 | //const LLUUID IMG_SAND ("0ff70ead-4562-45f9-9e8a-52b1a3286868"); // VIEWER 1.5k | ||
60 | //const LLUUID IMG_GRASS ("5ab48dd5-05d0-4f1a-ace6-efd4e2fb3508"); // VIEWER 1.2k | ||
61 | //const LLUUID IMG_ROCK ("402f8b24-5f9d-4905-b5f8-37baff603e88"); // VIEWER 1.2k | ||
62 | //const LLUUID IMG_ROCKFACE ("9c88539c-fd04-46b8-bea2-ddf1bcffe3bd"); // VIEWER 1.2k | ||
63 | const LLUUID IMG_SUN ("cce0f112-878f-4586-a2e2-a8f104bba271"); // dataserver | 50 | const LLUUID IMG_SUN ("cce0f112-878f-4586-a2e2-a8f104bba271"); // dataserver |
64 | const LLUUID IMG_MOON ("d07f6eed-b96a-47cd-b51d-400ad4a1c428"); // dataserver | 51 | const LLUUID IMG_MOON ("d07f6eed-b96a-47cd-b51d-400ad4a1c428"); // dataserver |
65 | const LLUUID IMG_CLOUD_POOF ("fc4b9f0b-d008-45c6-96a4-01dd947ac621"); // dataserver | 52 | const LLUUID IMG_CLOUD_POOF ("fc4b9f0b-d008-45c6-96a4-01dd947ac621"); // dataserver |
66 | const LLUUID IMG_SHOT ("35f217a3-f618-49cf-bbca-c86d486551a9"); // dataserver | 53 | const LLUUID IMG_SHOT ("35f217a3-f618-49cf-bbca-c86d486551a9"); // dataserver |
67 | const LLUUID IMG_SPARK ("d2e75ac1-d0fb-4532-820e-a20034ac814d"); // dataserver | 54 | const LLUUID IMG_SPARK ("d2e75ac1-d0fb-4532-820e-a20034ac814d"); // dataserver |
68 | const LLUUID IMG_FIRE ("aca40aa8-44cf-44ca-a0fa-93e1a2986f82"); // dataserver | 55 | const LLUUID IMG_FIRE ("aca40aa8-44cf-44ca-a0fa-93e1a2986f82"); // dataserver |
69 | //const LLUUID IMG_WATER ("e510b068-d20d-4612-a08d-fde4d5c15789"); // VIEWER | ||
70 | const LLUUID IMG_FACE_SELECT ("a85ac674-cb75-4af6-9499-df7c5aaf7a28"); // face selector | 56 | const LLUUID IMG_FACE_SELECT ("a85ac674-cb75-4af6-9499-df7c5aaf7a28"); // face selector |
71 | |||
72 | //const LLUUID IMG_SHADOW ("5e1de0a8-f9f8-4237-9396-d221126a7c4a"); // dataserver | ||
73 | //const LLUUID IMG_AVATARSHADOW ("c7d8bbf3-21ee-4f6e-9b20-3cf18425af1d"); // dataserver | ||
74 | //const LLUUID IMG_BOXSHADOW ("8d86b8cc-4889-408a-8b72-c1961bae53d7"); // dataserver | ||
75 | //const LLUUID IMG_EYE ("5e3551ae-9971-4814-af99-5117591e937b"); // dataserver | ||
76 | //const LLUUID IMG_BLUE_FLAME ("d8b62059-7b31-4511-a479-1fe45117948f"); // dataserver | ||
77 | |||
78 | const LLUUID IMG_DEFAULT_AVATAR ("c228d1cf-4b5d-4ba8-84f4-899a0796aa97"); // dataserver | 57 | const LLUUID IMG_DEFAULT_AVATAR ("c228d1cf-4b5d-4ba8-84f4-899a0796aa97"); // dataserver |
79 | //const LLUUID IMG_ENERGY_BEAM ("09e7bc54-11b9-442a-ae3d-f52e599e466a"); // dataserver | ||
80 | //const LLUUID IMG_ENERGY_BEAM2 ("de651394-f926-48db-b666-e49d83af1bbc"); // dataserver | ||
81 | |||
82 | //const LLUUID IMG_BRICK_PATH ("a9d0019b-3783-4c7f-959c-322d301918bc"); // dataserver | ||
83 | 58 | ||
84 | const LLUUID IMG_EXPLOSION ("68edcf47-ccd7-45b8-9f90-1649d7f12806"); // On dataserver | 59 | const LLUUID IMG_EXPLOSION ("68edcf47-ccd7-45b8-9f90-1649d7f12806"); // On dataserver |
85 | const LLUUID IMG_EXPLOSION_2 ("21ce046c-83fe-430a-b629-c7660ac78d7c"); // On dataserver | 60 | const LLUUID IMG_EXPLOSION_2 ("21ce046c-83fe-430a-b629-c7660ac78d7c"); // On dataserver |
86 | const LLUUID IMG_EXPLOSION_3 ("fedea30a-1be8-47a6-bc06-337a04a39c4b"); // On dataserver | 61 | const LLUUID IMG_EXPLOSION_3 ("fedea30a-1be8-47a6-bc06-337a04a39c4b"); // On dataserver |
87 | const LLUUID IMG_EXPLOSION_4 ("abf0d56b-82e5-47a2-a8ad-74741bb2c29e"); // On dataserver | 62 | const LLUUID IMG_EXPLOSION_4 ("abf0d56b-82e5-47a2-a8ad-74741bb2c29e"); // On dataserver |
88 | //const LLUUID IMG_EXPLOSION_5 ("60f2dec7-675b-4950-b614-85b907d552ea"); // On dataserver | ||
89 | //const LLUUID IMG_SPLASH_SPRITE ("8a101f63-fe45-49e7-9f8a-e64817daa475"); // On dataserver | ||
90 | const LLUUID IMG_SMOKE_POOF ("1e63e323-5fe0-452e-92f8-b98bd0f764e3"); // On dataserver | 63 | const LLUUID IMG_SMOKE_POOF ("1e63e323-5fe0-452e-92f8-b98bd0f764e3"); // On dataserver |
91 | 64 | ||
92 | const LLUUID IMG_BIG_EXPLOSION_1 ("5e47a0dc-97bf-44e0-8b40-de06718cee9d"); // On dataserver | 65 | const LLUUID IMG_BIG_EXPLOSION_1 ("5e47a0dc-97bf-44e0-8b40-de06718cee9d"); // On dataserver |
93 | const LLUUID IMG_BIG_EXPLOSION_2 ("9c8eca51-53d5-42a7-bb58-cef070395db8"); // On dataserver | 66 | const LLUUID IMG_BIG_EXPLOSION_2 ("9c8eca51-53d5-42a7-bb58-cef070395db8"); // On dataserver |
94 | //const LLUUID IMG_BLUE_BLOOD ("8bc2e3f8-097e-4c87-b417-b0d699d07189"); // On dataserver | ||
95 | 67 | ||
96 | const LLUUID IMG_BLOOM1 ("3c59f7fe-9dc8-47f9-8aaf-a9dd1fbc3bef"); | 68 | const LLUUID IMG_BLOOM1 ("3c59f7fe-9dc8-47f9-8aaf-a9dd1fbc3bef"); // VIEWER |
97 | //const LLUUID IMG_BLOOM2 ("9fb76e81-eca0-4b6a-96e1-a6c5a685150b"); | 69 | const LLUUID TERRAIN_DIRT_DETAIL ("0bc58228-74a0-7e83-89bc-5c23464bcec5"); // VIEWER |
98 | //const LLUUID IMG_BLOOM3 ("fb1fecba-9585-415b-ad15-6e6e3d6c5479"); | 70 | const LLUUID TERRAIN_GRASS_DETAIL ("63338ede-0037-c4fd-855b-015d77112fc8"); // VIEWER |
71 | const LLUUID TERRAIN_MOUNTAIN_DETAIL ("303cd381-8560-7579-23f1-f0a880799740"); // VIEWER | ||
72 | const LLUUID TERRAIN_ROCK_DETAIL ("53a2f406-4895-1d13-d541-d2e3b86bc19c"); // VIEWER | ||
99 | 73 | ||
100 | const LLUUID IMG_PTT_SPEAKER ("89e9fc7c-0b16-457d-be4f-136270759c4d"); // On cache | 74 | const LLUUID DEFAULT_WATER_NORMAL ("822ded49-9a6c-f61c-cb89-6df54f42cdf4"); // VIEWER |
101 | 75 | ||
102 | #endif | 76 | #endif |
diff --git a/linden/indra/llcommon/indra_constants.h b/linden/indra/llcommon/indra_constants.h index eceb576..77f3d8c 100644 --- a/linden/indra/llcommon/indra_constants.h +++ b/linden/indra/llcommon/indra_constants.h | |||
@@ -38,9 +38,10 @@ | |||
38 | // At 45 Hz collisions seem stable and objects seem | 38 | // At 45 Hz collisions seem stable and objects seem |
39 | // to settle down at a reasonable rate. | 39 | // to settle down at a reasonable rate. |
40 | // JC 3/18/2003 | 40 | // JC 3/18/2003 |
41 | const F32 HAVOK_TIMESTEP = 1.f / 45.f; | 41 | const F32 PHYSICS_TIMESTEP = 1.f / 45.f; |
42 | 42 | ||
43 | const F32 COLLISION_TOLERANCE = 0.1f; | 43 | const F32 COLLISION_TOLERANCE = 0.1f; |
44 | const F32 HALF_COLLISION_TOLERANCE = COLLISION_TOLERANCE * 0.5f; | ||
44 | 45 | ||
45 | // Time constants | 46 | // Time constants |
46 | const U32 HOURS_PER_LINDEN_DAY = 4; | 47 | const U32 HOURS_PER_LINDEN_DAY = 4; |
@@ -53,6 +54,8 @@ const F32 REGION_WIDTH_METERS = 256.f; | |||
53 | const S32 REGION_WIDTH_UNITS = 256; | 54 | const S32 REGION_WIDTH_UNITS = 256; |
54 | const U32 REGION_WIDTH_U32 = 256; | 55 | const U32 REGION_WIDTH_U32 = 256; |
55 | 56 | ||
57 | const F32 REGION_HEIGHT_METERS = 4096.f; | ||
58 | |||
56 | // Bits for simulator performance query flags | 59 | // Bits for simulator performance query flags |
57 | enum LAND_STAT_FLAGS | 60 | enum LAND_STAT_FLAGS |
58 | { | 61 | { |
@@ -87,7 +90,7 @@ const F32 MAX_AGENT_HEIGHT = 2.65f - 2.0f * COLLISION_TOLERANCE; | |||
87 | 90 | ||
88 | // For linked sets | 91 | // For linked sets |
89 | const S32 MAX_CHILDREN_PER_TASK = 255; | 92 | const S32 MAX_CHILDREN_PER_TASK = 255; |
90 | const S32 MAX_CHILDREN_PER_PHYSICAL_TASK = 31; | 93 | const S32 MAX_CHILDREN_PER_PHYSICAL_TASK = 32; |
91 | 94 | ||
92 | const S32 MAX_JOINTS_PER_OBJECT = 1; // limiting to 1 until Havok 2.x | 95 | const S32 MAX_JOINTS_PER_OBJECT = 1; // limiting to 1 until Havok 2.x |
93 | 96 | ||
@@ -339,7 +342,7 @@ const U32 MAP_ITEM_LAND_FOR_SALE = 0x07; | |||
339 | const U32 MAP_ITEM_CLASSIFIED = 0x08; | 342 | const U32 MAP_ITEM_CLASSIFIED = 0x08; |
340 | 343 | ||
341 | // Crash reporter behavior | 344 | // Crash reporter behavior |
342 | const char* const CRASH_SETTINGS_FILE = "crash_settings.xml"; | 345 | const char* const CRASH_SETTINGS_FILE = "settings_crash_behavior.xml"; |
343 | const char* const CRASH_BEHAVIOR_SETTING = "CrashSubmitBehavior"; | 346 | const char* const CRASH_BEHAVIOR_SETTING = "CrashSubmitBehavior"; |
344 | const S32 CRASH_BEHAVIOR_ASK = 0; | 347 | const S32 CRASH_BEHAVIOR_ASK = 0; |
345 | const S32 CRASH_BEHAVIOR_ALWAYS_SEND = 1; | 348 | const S32 CRASH_BEHAVIOR_ALWAYS_SEND = 1; |
diff --git a/linden/indra/llcommon/llagentconstants.h b/linden/indra/llcommon/llagentconstants.h index 5757751..48c097a 100644 --- a/linden/indra/llcommon/llagentconstants.h +++ b/linden/indra/llcommon/llagentconstants.h | |||
@@ -67,43 +67,43 @@ const U32 CONTROL_ML_LBUTTON_DOWN_INDEX = 30; | |||
67 | const U32 CONTROL_ML_LBUTTON_UP_INDEX = 31; | 67 | const U32 CONTROL_ML_LBUTTON_UP_INDEX = 31; |
68 | const U32 TOTAL_CONTROLS = 32; | 68 | const U32 TOTAL_CONTROLS = 32; |
69 | 69 | ||
70 | const U32 AGENT_CONTROL_AT_POS = 0x1 << CONTROL_AT_POS_INDEX; | 70 | const U32 AGENT_CONTROL_AT_POS = 0x1 << CONTROL_AT_POS_INDEX; // 0x00000001 |
71 | const U32 AGENT_CONTROL_AT_NEG = 0x1 << CONTROL_AT_NEG_INDEX; | 71 | const U32 AGENT_CONTROL_AT_NEG = 0x1 << CONTROL_AT_NEG_INDEX; // 0x00000002 |
72 | const U32 AGENT_CONTROL_LEFT_POS = 0x1 << CONTROL_LEFT_POS_INDEX; | 72 | const U32 AGENT_CONTROL_LEFT_POS = 0x1 << CONTROL_LEFT_POS_INDEX; // 0x00000004 |
73 | const U32 AGENT_CONTROL_LEFT_NEG = 0x1 << CONTROL_LEFT_NEG_INDEX; | 73 | const U32 AGENT_CONTROL_LEFT_NEG = 0x1 << CONTROL_LEFT_NEG_INDEX; // 0x00000008 |
74 | const U32 AGENT_CONTROL_UP_POS = 0x1 << CONTROL_UP_POS_INDEX; | 74 | const U32 AGENT_CONTROL_UP_POS = 0x1 << CONTROL_UP_POS_INDEX; // 0x00000010 |
75 | const U32 AGENT_CONTROL_UP_NEG = 0x1 << CONTROL_UP_NEG_INDEX; | 75 | const U32 AGENT_CONTROL_UP_NEG = 0x1 << CONTROL_UP_NEG_INDEX; // 0x00000020 |
76 | const U32 AGENT_CONTROL_PITCH_POS = 0x1 << CONTROL_PITCH_POS_INDEX; | 76 | const U32 AGENT_CONTROL_PITCH_POS = 0x1 << CONTROL_PITCH_POS_INDEX; // 0x00000040 |
77 | const U32 AGENT_CONTROL_PITCH_NEG = 0x1 << CONTROL_PITCH_NEG_INDEX; | 77 | const U32 AGENT_CONTROL_PITCH_NEG = 0x1 << CONTROL_PITCH_NEG_INDEX; // 0x00000080 |
78 | const U32 AGENT_CONTROL_YAW_POS = 0x1 << CONTROL_YAW_POS_INDEX; | 78 | const U32 AGENT_CONTROL_YAW_POS = 0x1 << CONTROL_YAW_POS_INDEX; // 0x00000100 |
79 | const U32 AGENT_CONTROL_YAW_NEG = 0x1 << CONTROL_YAW_NEG_INDEX; | 79 | const U32 AGENT_CONTROL_YAW_NEG = 0x1 << CONTROL_YAW_NEG_INDEX; // 0x00000200 |
80 | 80 | ||
81 | const U32 AGENT_CONTROL_FAST_AT = 0x1 << CONTROL_FAST_AT_INDEX; | 81 | const U32 AGENT_CONTROL_FAST_AT = 0x1 << CONTROL_FAST_AT_INDEX; // 0x00000400 |
82 | const U32 AGENT_CONTROL_FAST_LEFT = 0x1 << CONTROL_FAST_LEFT_INDEX; | 82 | const U32 AGENT_CONTROL_FAST_LEFT = 0x1 << CONTROL_FAST_LEFT_INDEX; // 0x00000800 |
83 | const U32 AGENT_CONTROL_FAST_UP = 0x1 << CONTROL_FAST_UP_INDEX; | 83 | const U32 AGENT_CONTROL_FAST_UP = 0x1 << CONTROL_FAST_UP_INDEX; // 0x00001000 |
84 | 84 | ||
85 | const U32 AGENT_CONTROL_FLY = 0x1 << CONTROL_FLY_INDEX; | 85 | const U32 AGENT_CONTROL_FLY = 0x1 << CONTROL_FLY_INDEX; // 0x00002000 |
86 | const U32 AGENT_CONTROL_STOP = 0x1 << CONTROL_STOP_INDEX; | 86 | const U32 AGENT_CONTROL_STOP = 0x1 << CONTROL_STOP_INDEX; // 0x00004000 |
87 | const U32 AGENT_CONTROL_FINISH_ANIM = 0x1 << CONTROL_FINISH_ANIM_INDEX; | 87 | const U32 AGENT_CONTROL_FINISH_ANIM = 0x1 << CONTROL_FINISH_ANIM_INDEX; // 0x00008000 |
88 | const U32 AGENT_CONTROL_STAND_UP = 0x1 << CONTROL_STAND_UP_INDEX; | 88 | const U32 AGENT_CONTROL_STAND_UP = 0x1 << CONTROL_STAND_UP_INDEX; // 0x00010000 |
89 | const U32 AGENT_CONTROL_SIT_ON_GROUND = 0x1 << CONTROL_SIT_ON_GROUND_INDEX; | 89 | const U32 AGENT_CONTROL_SIT_ON_GROUND = 0x1 << CONTROL_SIT_ON_GROUND_INDEX; // 0x00020000 |
90 | const U32 AGENT_CONTROL_MOUSELOOK = 0x1 << CONTROL_MOUSELOOK_INDEX; | 90 | const U32 AGENT_CONTROL_MOUSELOOK = 0x1 << CONTROL_MOUSELOOK_INDEX; // 0x00040000 |
91 | 91 | ||
92 | const U32 AGENT_CONTROL_NUDGE_AT_POS = 0x1 << CONTROL_NUDGE_AT_POS_INDEX; | 92 | const U32 AGENT_CONTROL_NUDGE_AT_POS = 0x1 << CONTROL_NUDGE_AT_POS_INDEX; // 0x00080000 |
93 | const U32 AGENT_CONTROL_NUDGE_AT_NEG = 0x1 << CONTROL_NUDGE_AT_NEG_INDEX; | 93 | const U32 AGENT_CONTROL_NUDGE_AT_NEG = 0x1 << CONTROL_NUDGE_AT_NEG_INDEX; // 0x00100000 |
94 | const U32 AGENT_CONTROL_NUDGE_LEFT_POS = 0x1 << CONTROL_NUDGE_LEFT_POS_INDEX; | 94 | const U32 AGENT_CONTROL_NUDGE_LEFT_POS = 0x1 << CONTROL_NUDGE_LEFT_POS_INDEX; // 0x00200000 |
95 | const U32 AGENT_CONTROL_NUDGE_LEFT_NEG = 0x1 << CONTROL_NUDGE_LEFT_NEG_INDEX; | 95 | const U32 AGENT_CONTROL_NUDGE_LEFT_NEG = 0x1 << CONTROL_NUDGE_LEFT_NEG_INDEX; // 0x00400000 |
96 | const U32 AGENT_CONTROL_NUDGE_UP_POS = 0x1 << CONTROL_NUDGE_UP_POS_INDEX; | 96 | const U32 AGENT_CONTROL_NUDGE_UP_POS = 0x1 << CONTROL_NUDGE_UP_POS_INDEX; // 0x00800000 |
97 | const U32 AGENT_CONTROL_NUDGE_UP_NEG = 0x1 << CONTROL_NUDGE_UP_NEG_INDEX; | 97 | const U32 AGENT_CONTROL_NUDGE_UP_NEG = 0x1 << CONTROL_NUDGE_UP_NEG_INDEX; // 0x01000000 |
98 | const U32 AGENT_CONTROL_TURN_LEFT = 0x1 << CONTROL_TURN_LEFT_INDEX; | 98 | const U32 AGENT_CONTROL_TURN_LEFT = 0x1 << CONTROL_TURN_LEFT_INDEX; // 0x02000000 |
99 | const U32 AGENT_CONTROL_TURN_RIGHT = 0x1 << CONTROL_TURN_RIGHT_INDEX; | 99 | const U32 AGENT_CONTROL_TURN_RIGHT = 0x1 << CONTROL_TURN_RIGHT_INDEX; // 0x04000000 |
100 | 100 | ||
101 | const U32 AGENT_CONTROL_AWAY = 0x1 << CONTROL_AWAY_INDEX; | 101 | const U32 AGENT_CONTROL_AWAY = 0x1 << CONTROL_AWAY_INDEX; // 0x08000000 |
102 | 102 | ||
103 | const U32 AGENT_CONTROL_LBUTTON_DOWN = 0x1 << CONTROL_LBUTTON_DOWN_INDEX; | 103 | const U32 AGENT_CONTROL_LBUTTON_DOWN = 0x1 << CONTROL_LBUTTON_DOWN_INDEX; // 0x10000000 |
104 | const U32 AGENT_CONTROL_LBUTTON_UP = 0x1 << CONTROL_LBUTTON_UP_INDEX; | 104 | const U32 AGENT_CONTROL_LBUTTON_UP = 0x1 << CONTROL_LBUTTON_UP_INDEX; // 0x20000000 |
105 | const U32 AGENT_CONTROL_ML_LBUTTON_DOWN = 0x1 << CONTROL_ML_LBUTTON_DOWN_INDEX; | 105 | const U32 AGENT_CONTROL_ML_LBUTTON_DOWN = 0x1 << CONTROL_ML_LBUTTON_DOWN_INDEX; // 0x40000000 |
106 | const U32 AGENT_CONTROL_ML_LBUTTON_UP = ((U32)0x1) << CONTROL_ML_LBUTTON_UP_INDEX; | 106 | const U32 AGENT_CONTROL_ML_LBUTTON_UP = ((U32)0x1) << CONTROL_ML_LBUTTON_UP_INDEX; // 0x80000000 |
107 | 107 | ||
108 | const U32 AGENT_CONTROL_AT = AGENT_CONTROL_AT_POS | 108 | const U32 AGENT_CONTROL_AT = AGENT_CONTROL_AT_POS |
109 | | AGENT_CONTROL_AT_NEG | 109 | | AGENT_CONTROL_AT_NEG |
diff --git a/linden/indra/llcommon/llapp.cpp b/linden/indra/llcommon/llapp.cpp index a10436a..bd2e377 100644 --- a/linden/indra/llcommon/llapp.cpp +++ b/linden/indra/llcommon/llapp.cpp | |||
@@ -65,6 +65,7 @@ BOOL LLApp::sLogInSignal = FALSE; | |||
65 | // static | 65 | // static |
66 | LLApp::EAppStatus LLApp::sStatus = LLApp::APP_STATUS_STOPPED; // Keeps track of application status | 66 | LLApp::EAppStatus LLApp::sStatus = LLApp::APP_STATUS_STOPPED; // Keeps track of application status |
67 | LLAppErrorHandler LLApp::sErrorHandler = NULL; | 67 | LLAppErrorHandler LLApp::sErrorHandler = NULL; |
68 | LLAppErrorHandler LLApp::sSyncErrorHandler = NULL; | ||
68 | BOOL LLApp::sErrorThreadRunning = FALSE; | 69 | BOOL LLApp::sErrorThreadRunning = FALSE; |
69 | #if !LL_WINDOWS | 70 | #if !LL_WINDOWS |
70 | LLApp::child_map LLApp::sChildMap; | 71 | LLApp::child_map LLApp::sChildMap; |
@@ -262,6 +263,21 @@ void LLApp::setErrorHandler(LLAppErrorHandler handler) | |||
262 | LLApp::sErrorHandler = handler; | 263 | LLApp::sErrorHandler = handler; |
263 | } | 264 | } |
264 | 265 | ||
266 | |||
267 | void LLApp::setSyncErrorHandler(LLAppErrorHandler handler) | ||
268 | { | ||
269 | LLApp::sSyncErrorHandler = handler; | ||
270 | } | ||
271 | |||
272 | // static | ||
273 | void LLApp::runSyncErrorHandler() | ||
274 | { | ||
275 | if (LLApp::sSyncErrorHandler) | ||
276 | { | ||
277 | LLApp::sSyncErrorHandler(); | ||
278 | } | ||
279 | } | ||
280 | |||
265 | // static | 281 | // static |
266 | void LLApp::runErrorHandler() | 282 | void LLApp::runErrorHandler() |
267 | { | 283 | { |
@@ -285,7 +301,13 @@ void LLApp::setStatus(EAppStatus status) | |||
285 | // static | 301 | // static |
286 | void LLApp::setError() | 302 | void LLApp::setError() |
287 | { | 303 | { |
288 | setStatus(APP_STATUS_ERROR); | 304 | if (!isError()) |
305 | { | ||
306 | // perform any needed synchronous error-handling | ||
307 | runSyncErrorHandler(); | ||
308 | // set app status to ERROR so that the LLErrorThread notices | ||
309 | setStatus(APP_STATUS_ERROR); | ||
310 | } | ||
289 | } | 311 | } |
290 | 312 | ||
291 | 313 | ||
diff --git a/linden/indra/llcommon/llapp.h b/linden/indra/llcommon/llapp.h index 1a700cc..50a70ae 100644 --- a/linden/indra/llcommon/llapp.h +++ b/linden/indra/llcommon/llapp.h | |||
@@ -189,6 +189,7 @@ public: | |||
189 | // Error handling methods | 189 | // Error handling methods |
190 | // | 190 | // |
191 | void setErrorHandler(LLAppErrorHandler handler); | 191 | void setErrorHandler(LLAppErrorHandler handler); |
192 | void setSyncErrorHandler(LLAppErrorHandler handler); | ||
192 | 193 | ||
193 | #if !LL_WINDOWS | 194 | #if !LL_WINDOWS |
194 | // | 195 | // |
@@ -245,13 +246,15 @@ protected: | |||
245 | private: | 246 | private: |
246 | void setupErrorHandling(); // Do platform-specific error-handling setup (signals, structured exceptions) | 247 | void setupErrorHandling(); // Do platform-specific error-handling setup (signals, structured exceptions) |
247 | 248 | ||
248 | static void runErrorHandler(); | 249 | static void runErrorHandler(); // run shortly after we detect an error, ran in the relatively robust context of the LLErrorThread - preferred. |
250 | static void runSyncErrorHandler(); // run IMMEDIATELY when we get an error, ran in the context of the faulting thread. | ||
249 | 251 | ||
250 | // *NOTE: On Windows, we need a routine to reset the structured | 252 | // *NOTE: On Windows, we need a routine to reset the structured |
251 | // exception handler when some evil driver has taken it over for | 253 | // exception handler when some evil driver has taken it over for |
252 | // their own purposes | 254 | // their own purposes |
253 | typedef int(*signal_handler_func)(int signum); | 255 | typedef int(*signal_handler_func)(int signum); |
254 | static LLAppErrorHandler sErrorHandler; | 256 | static LLAppErrorHandler sErrorHandler; |
257 | static LLAppErrorHandler sSyncErrorHandler; | ||
255 | 258 | ||
256 | // Default application threads | 259 | // Default application threads |
257 | LLErrorThread* mThreadErrorp; // Waits for app to go to status ERROR, then runs the error callback | 260 | LLErrorThread* mThreadErrorp; // Waits for app to go to status ERROR, then runs the error callback |
diff --git a/linden/indra/llcommon/llapr.cpp b/linden/indra/llcommon/llapr.cpp index 770cd3f..08c40a4 100644 --- a/linden/indra/llcommon/llapr.cpp +++ b/linden/indra/llcommon/llapr.cpp | |||
@@ -116,8 +116,10 @@ void LLScopedLock::unlock() | |||
116 | bool ll_apr_warn_status(apr_status_t status) | 116 | bool ll_apr_warn_status(apr_status_t status) |
117 | { | 117 | { |
118 | if(APR_SUCCESS == status) return false; | 118 | if(APR_SUCCESS == status) return false; |
119 | #ifndef LL_WINDOWS | ||
119 | char buf[MAX_STRING]; /* Flawfinder: ignore */ | 120 | char buf[MAX_STRING]; /* Flawfinder: ignore */ |
120 | llwarns << "APR: " << apr_strerror(status, buf, MAX_STRING) << llendl; | 121 | llwarns << "APR: " << apr_strerror(status, buf, MAX_STRING) << llendl; |
122 | #endif | ||
121 | return true; | 123 | return true; |
122 | } | 124 | } |
123 | 125 | ||
diff --git a/linden/indra/llcommon/llcommon.vcproj b/linden/indra/llcommon/llcommon.vcproj index 6b4a0e8..ab4e67a 100644 --- a/linden/indra/llcommon/llcommon.vcproj +++ b/linden/indra/llcommon/llcommon.vcproj | |||
@@ -432,10 +432,10 @@ | |||
432 | RelativePath=".\lllivefile.h"> | 432 | RelativePath=".\lllivefile.h"> |
433 | </File> | 433 | </File> |
434 | <File | 434 | <File |
435 | RelativePath=".\lllog.h"> | 435 | RelativePath=".\lllocalidhashmap.h"> |
436 | </File> | 436 | </File> |
437 | <File | 437 | <File |
438 | RelativePath=".\lllocalidhashmap.h"> | 438 | RelativePath=".\lllog.h"> |
439 | </File> | 439 | </File> |
440 | <File | 440 | <File |
441 | RelativePath=".\lllslconstants.h"> | 441 | RelativePath=".\lllslconstants.h"> |
@@ -504,6 +504,9 @@ | |||
504 | RelativePath=".\llskipmap.h"> | 504 | RelativePath=".\llskipmap.h"> |
505 | </File> | 505 | </File> |
506 | <File | 506 | <File |
507 | RelativePath=".\llsmoothstep.h"> | ||
508 | </File> | ||
509 | <File | ||
507 | RelativePath=".\llstat.h"> | 510 | RelativePath=".\llstat.h"> |
508 | </File> | 511 | </File> |
509 | <File | 512 | <File |
diff --git a/linden/indra/llcommon/lldarray.h b/linden/indra/llcommon/lldarray.h index 9bffd63..45e564f 100644 --- a/linden/indra/llcommon/lldarray.h +++ b/linden/indra/llcommon/lldarray.h | |||
@@ -119,11 +119,12 @@ inline S32 LLDynamicArray<Type,BlockSize>::removeObj(const Type& obj) | |||
119 | typename std::vector<Type>::iterator iter = std::find(this->begin(), this->end(), obj); | 119 | typename std::vector<Type>::iterator iter = std::find(this->begin(), this->end(), obj); |
120 | if (iter != this->end()) | 120 | if (iter != this->end()) |
121 | { | 121 | { |
122 | S32 res = iter - this->begin(); | ||
122 | typename std::vector<Type>::iterator last = this->end(); | 123 | typename std::vector<Type>::iterator last = this->end(); |
123 | --last; | 124 | --last; |
124 | *iter = *last; | 125 | *iter = *last; |
125 | this->pop_back(); | 126 | this->pop_back(); |
126 | return iter - this->begin(); | 127 | return res; |
127 | } | 128 | } |
128 | return FAIL; | 129 | return FAIL; |
129 | } | 130 | } |
diff --git a/linden/indra/llcommon/lldefs.h b/linden/indra/llcommon/lldefs.h index d081245..0e69626 100644 --- a/linden/indra/llcommon/lldefs.h +++ b/linden/indra/llcommon/lldefs.h | |||
@@ -218,7 +218,15 @@ inline LLDATATYPE llmin(const LLDATATYPE& d1, const LLDATATYPE& d2, const LLDATA | |||
218 | template <class LLDATATYPE> | 218 | template <class LLDATATYPE> |
219 | inline LLDATATYPE llclamp(const LLDATATYPE& a, const LLDATATYPE& minval, const LLDATATYPE& maxval) | 219 | inline LLDATATYPE llclamp(const LLDATATYPE& a, const LLDATATYPE& minval, const LLDATATYPE& maxval) |
220 | { | 220 | { |
221 | return llmin(llmax(a, minval), maxval); | 221 | if ( a < minval ) |
222 | { | ||
223 | return minval; | ||
224 | } | ||
225 | else if ( a > maxval ) | ||
226 | { | ||
227 | return maxval; | ||
228 | } | ||
229 | return a; | ||
222 | } | 230 | } |
223 | 231 | ||
224 | template <class LLDATATYPE> | 232 | template <class LLDATATYPE> |
@@ -234,3 +242,4 @@ inline LLDATATYPE llclampb(const LLDATATYPE& a) | |||
234 | } | 242 | } |
235 | 243 | ||
236 | #endif // LL_LLDEFS_H | 244 | #endif // LL_LLDEFS_H |
245 | |||
diff --git a/linden/indra/llcommon/llerror.cpp b/linden/indra/llcommon/llerror.cpp index d9ab57c..0e7db89 100644 --- a/linden/indra/llcommon/llerror.cpp +++ b/linden/indra/llcommon/llerror.cpp | |||
@@ -37,15 +37,16 @@ | |||
37 | 37 | ||
38 | #include <cctype> | 38 | #include <cctype> |
39 | #ifdef __GNUC__ | 39 | #ifdef __GNUC__ |
40 | #include <cxxabi.h> | 40 | # include <cxxabi.h> |
41 | #endif | 41 | #endif // __GNUC__ |
42 | #include <sstream> | 42 | #include <sstream> |
43 | #if !LL_WINDOWS | 43 | #if !LL_WINDOWS |
44 | #include <syslog.h> | 44 | # include <syslog.h> |
45 | #endif | 45 | # include <unistd.h> |
46 | #endif // !LL_WINDOWS | ||
46 | #if LL_WINDOWS | 47 | #if LL_WINDOWS |
47 | #include <windows.h> | 48 | # include <windows.h> |
48 | #endif | 49 | #endif // LL_WINDOWS |
49 | #include <vector> | 50 | #include <vector> |
50 | 51 | ||
51 | #include "llapp.h" | 52 | #include "llapp.h" |
@@ -133,18 +134,58 @@ namespace { | |||
133 | class RecordToStderr : public LLError::Recorder | 134 | class RecordToStderr : public LLError::Recorder |
134 | { | 135 | { |
135 | public: | 136 | public: |
136 | RecordToStderr(bool timestamp) : mTimestamp(timestamp) { } | 137 | RecordToStderr(bool timestamp) : mTimestamp(timestamp), mUseANSI(ANSI_PROBE) { } |
137 | 138 | ||
138 | virtual bool wantsTime() { return mTimestamp; } | 139 | virtual bool wantsTime() { return mTimestamp; } |
139 | 140 | ||
140 | virtual void recordMessage(LLError::ELevel level, | 141 | virtual void recordMessage(LLError::ELevel level, |
141 | const std::string& message) | 142 | const std::string& message) |
142 | { | 143 | { |
144 | if (ANSI_PROBE == mUseANSI) | ||
145 | mUseANSI = (checkANSI() ? ANSI_YES : ANSI_NO); | ||
146 | |||
147 | if (ANSI_YES == mUseANSI) | ||
148 | { | ||
149 | // Default all message levels to bold so we can distinguish our own messages from those dumped by subprocesses and libraries. | ||
150 | colorANSI("1"); // bold | ||
151 | switch (level) { | ||
152 | case LLError::LEVEL_ERROR: | ||
153 | colorANSI("31"); // red | ||
154 | break; | ||
155 | case LLError::LEVEL_WARN: | ||
156 | colorANSI("34"); // blue | ||
157 | break; | ||
158 | case LLError::LEVEL_DEBUG: | ||
159 | colorANSI("35"); // magenta | ||
160 | break; | ||
161 | default: | ||
162 | break; | ||
163 | } | ||
164 | } | ||
143 | fprintf(stderr, "%s\n", message.c_str()); | 165 | fprintf(stderr, "%s\n", message.c_str()); |
166 | if (ANSI_YES == mUseANSI) colorANSI("0"); // reset | ||
144 | } | 167 | } |
145 | 168 | ||
146 | private: | 169 | private: |
147 | bool mTimestamp; | 170 | bool mTimestamp; |
171 | typedef enum ANSIState {ANSI_PROBE, ANSI_YES, ANSI_NO}; | ||
172 | ANSIState mUseANSI; | ||
173 | void colorANSI(const std::string color) | ||
174 | { | ||
175 | // ANSI color code escape sequence | ||
176 | fprintf(stderr, "\033[%sm", color.c_str() ); | ||
177 | }; | ||
178 | bool checkANSI(void) | ||
179 | { | ||
180 | #if LL_LINUX || LL_DARWIN | ||
181 | // Check whether it's okay to use ANSI; if stderr is | ||
182 | // a tty then we assume yes. Can be turned off with | ||
183 | // the LL_NO_ANSI_COLOR env var. | ||
184 | return (0 != isatty(2)) && | ||
185 | (NULL == getenv("LL_NO_ANSI_COLOR")); | ||
186 | #endif // LL_LINUX | ||
187 | return false; | ||
188 | }; | ||
148 | }; | 189 | }; |
149 | 190 | ||
150 | class RecordToFixedBuffer : public LLError::Recorder | 191 | class RecordToFixedBuffer : public LLError::Recorder |
diff --git a/linden/indra/llcommon/llevent.h b/linden/indra/llcommon/llevent.h index 83cb79f..ef96ef7 100644 --- a/linden/indra/llcommon/llevent.h +++ b/linden/indra/llcommon/llevent.h | |||
@@ -185,13 +185,6 @@ protected: | |||
185 | LLPointer<LLEventDispatcher> mDispatcher; | 185 | LLPointer<LLEventDispatcher> mDispatcher; |
186 | }; | 186 | }; |
187 | 187 | ||
188 | // Utility mixer class which fires & handles events | ||
189 | class LLSimpleListenerObservable : public LLObservable, public LLSimpleListener | ||
190 | { | ||
191 | public: | ||
192 | virtual bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) = 0; | ||
193 | }; | ||
194 | |||
195 | class LLValueChangedEvent : public LLEvent | 188 | class LLValueChangedEvent : public LLEvent |
196 | { | 189 | { |
197 | public: | 190 | public: |
diff --git a/linden/indra/llcommon/llfile.cpp b/linden/indra/llcommon/llfile.cpp index d551f28..32e9622 100644 --- a/linden/indra/llcommon/llfile.cpp +++ b/linden/indra/llcommon/llfile.cpp | |||
@@ -272,9 +272,11 @@ void llofstream::open(const char* _Filename, /* Flawfinder: ignore */ | |||
272 | 272 | ||
273 | void llofstream::close() | 273 | void llofstream::close() |
274 | { // close the C stream | 274 | { // close the C stream |
275 | llassert(_Filebuffer); | 275 | if(is_open()) |
276 | if (_Filebuffer->close() == 0) | 276 | { |
277 | _Myios::setstate(ios_base::failbit); /*Flawfinder: ignore*/ | 277 | if (_Filebuffer->close() == 0) |
278 | _Myios::setstate(ios_base::failbit); /*Flawfinder: ignore*/ | ||
279 | } | ||
278 | } | 280 | } |
279 | 281 | ||
280 | llofstream::llofstream(const char *_Filename, | 282 | llofstream::llofstream(const char *_Filename, |
@@ -286,7 +288,8 @@ llofstream::llofstream(const char *_Filename, | |||
286 | } | 288 | } |
287 | 289 | ||
288 | llofstream::~llofstream() | 290 | llofstream::~llofstream() |
289 | { // destroy the object | 291 | { |
292 | // destroy the object | ||
290 | if (_ShouldClose) | 293 | if (_ShouldClose) |
291 | { | 294 | { |
292 | close(); | 295 | close(); |
diff --git a/linden/indra/llcommon/llframetimer.cpp b/linden/indra/llcommon/llframetimer.cpp index 9de3be2..96e5014 100644 --- a/linden/indra/llcommon/llframetimer.cpp +++ b/linden/indra/llcommon/llframetimer.cpp | |||
@@ -140,3 +140,18 @@ F32 LLFrameTimer::getFrameDeltaTimeF32() | |||
140 | { | 140 | { |
141 | return (F32)(U64_to_F64(sFrameDeltaTime) * USEC_TO_SEC_F64); | 141 | return (F32)(U64_to_F64(sFrameDeltaTime) * USEC_TO_SEC_F64); |
142 | } | 142 | } |
143 | |||
144 | |||
145 | // static | ||
146 | // Return seconds since the current frame started | ||
147 | F32 LLFrameTimer::getCurrentFrameTime() | ||
148 | { | ||
149 | U64 frame_time = totalTime() - sTotalTime; | ||
150 | return (F32)(U64_to_F64(frame_time) * USEC_TO_SEC_F64); | ||
151 | } | ||
152 | |||
153 | // Glue code to avoid full class .h file #includes | ||
154 | F32 getCurrentFrameTime() | ||
155 | { | ||
156 | return (F32)(LLFrameTimer::getCurrentFrameTime()); | ||
157 | } | ||
diff --git a/linden/indra/llcommon/llframetimer.h b/linden/indra/llcommon/llframetimer.h index bc0d79d..11c4cfc 100644 --- a/linden/indra/llcommon/llframetimer.h +++ b/linden/indra/llcommon/llframetimer.h | |||
@@ -74,6 +74,9 @@ public: | |||
74 | 74 | ||
75 | static F32 getFrameDeltaTimeF32(); | 75 | static F32 getFrameDeltaTimeF32(); |
76 | 76 | ||
77 | // Return seconds since the current frame started | ||
78 | static F32 getCurrentFrameTime(); | ||
79 | |||
77 | // MANIPULATORS | 80 | // MANIPULATORS |
78 | void start(); | 81 | void start(); |
79 | void stop(); | 82 | void stop(); |
@@ -144,4 +147,7 @@ protected: | |||
144 | BOOL mStarted; | 147 | BOOL mStarted; |
145 | }; | 148 | }; |
146 | 149 | ||
150 | // Glue code for Havok (or anything else that doesn't want the full .h files) | ||
151 | extern F32 getCurrentFrameTime(); | ||
152 | |||
147 | #endif // LL_LLFRAMETIMER_H | 153 | #endif // LL_LLFRAMETIMER_H |
diff --git a/linden/indra/llcommon/lllslconstants.h b/linden/indra/llcommon/lllslconstants.h index ba39098..508fb42 100644 --- a/linden/indra/llcommon/lllslconstants.h +++ b/linden/indra/llcommon/lllslconstants.h | |||
@@ -70,6 +70,7 @@ const S32 LSL_PRIM_FLEXIBLE = 21; | |||
70 | const S32 LSL_PRIM_TEXGEN = 22; | 70 | const S32 LSL_PRIM_TEXGEN = 22; |
71 | const S32 LSL_PRIM_POINT_LIGHT = 23; | 71 | const S32 LSL_PRIM_POINT_LIGHT = 23; |
72 | const S32 LSL_PRIM_CAST_SHADOWS = 24; | 72 | const S32 LSL_PRIM_CAST_SHADOWS = 24; |
73 | const S32 LSL_PRIM_GLOW = 25; | ||
73 | 74 | ||
74 | const S32 LSL_PRIM_TYPE_BOX = 0; | 75 | const S32 LSL_PRIM_TYPE_BOX = 0; |
75 | const S32 LSL_PRIM_TYPE_CYLINDER= 1; | 76 | const S32 LSL_PRIM_TYPE_CYLINDER= 1; |
diff --git a/linden/indra/llcommon/llmemory.h b/linden/indra/llcommon/llmemory.h index e1af7ba..c10661a 100644 --- a/linden/indra/llcommon/llmemory.h +++ b/linden/indra/llcommon/llmemory.h | |||
@@ -419,6 +419,31 @@ protected: | |||
419 | // Foo* instance = FooSingleton::getInstance(); | 419 | // Foo* instance = FooSingleton::getInstance(); |
420 | // | 420 | // |
421 | // As currently written, it is not thread-safe. | 421 | // As currently written, it is not thread-safe. |
422 | #if LL_WINDOWS && _MSC_VER < 1400 // this is Visual C++ 2003 or earlier | ||
423 | // workaround for VC7 compiler bug | ||
424 | // adapted from http://www.codeproject.com/KB/tips/VC2003MeyersSingletonBug.aspx | ||
425 | // our version doesn't introduce a nested struct so that you can still declare LLSingleton<MyClass> | ||
426 | // a friend and hide your constructor | ||
427 | |||
428 | template <typename T> | ||
429 | class LLSingleton | ||
430 | { | ||
431 | public: | ||
432 | static T* getInstance() | ||
433 | { | ||
434 | LLSingleton<T> singleton; | ||
435 | return singleton.get(); | ||
436 | } | ||
437 | private: | ||
438 | T* get() | ||
439 | { | ||
440 | static T instance; | ||
441 | return &instance; | ||
442 | } | ||
443 | |||
444 | }; | ||
445 | #else | ||
446 | |||
422 | template <typename T> | 447 | template <typename T> |
423 | class LLSingleton | 448 | class LLSingleton |
424 | { | 449 | { |
@@ -430,6 +455,8 @@ public: | |||
430 | } | 455 | } |
431 | }; | 456 | }; |
432 | 457 | ||
458 | #endif | ||
459 | |||
433 | //---------------------------------------------------------------------------- | 460 | //---------------------------------------------------------------------------- |
434 | 461 | ||
435 | // Return the resident set size of the current process, in bytes. | 462 | // Return the resident set size of the current process, in bytes. |
diff --git a/linden/indra/llcommon/llpreprocessor.h b/linden/indra/llcommon/llpreprocessor.h index 8d38904..e99b103 100644 --- a/linden/indra/llcommon/llpreprocessor.h +++ b/linden/indra/llcommon/llpreprocessor.h | |||
@@ -79,9 +79,16 @@ | |||
79 | 79 | ||
80 | #endif | 80 | #endif |
81 | 81 | ||
82 | |||
82 | // Deal with the differeneces on Windows | 83 | // Deal with the differeneces on Windows |
83 | #if LL_MSVC | 84 | #if LL_MSVC |
84 | #define snprintf safe_snprintf /* Flawfinder: ignore */ | 85 | namespace snprintf_hack |
86 | { | ||
87 | int snprintf(char *str, size_t size, const char *format, ...); | ||
88 | } | ||
89 | |||
90 | // #define snprintf safe_snprintf /* Flawfinder: ignore */ | ||
91 | using snprintf_hack::snprintf; | ||
85 | #endif // LL_MSVC | 92 | #endif // LL_MSVC |
86 | 93 | ||
87 | // Static linking with apr on windows needs to be declared. | 94 | // Static linking with apr on windows needs to be declared. |
diff --git a/linden/indra/llcommon/llptrskiplist.h b/linden/indra/llcommon/llptrskiplist.h index df35d30..f1df27a 100644 --- a/linden/indra/llcommon/llptrskiplist.h +++ b/linden/indra/llcommon/llptrskiplist.h | |||
@@ -34,6 +34,7 @@ | |||
34 | 34 | ||
35 | #include "llerror.h" | 35 | #include "llerror.h" |
36 | //#include "vmath.h" | 36 | //#include "vmath.h" |
37 | #include "llrand.h" | ||
37 | 38 | ||
38 | ///////////////////////////////////////////// | 39 | ///////////////////////////////////////////// |
39 | // | 40 | // |
diff --git a/linden/indra/llcommon/llskiplist.h b/linden/indra/llcommon/llskiplist.h index 78e6f0a..c88b310 100644 --- a/linden/indra/llcommon/llskiplist.h +++ b/linden/indra/llcommon/llskiplist.h | |||
@@ -32,6 +32,7 @@ | |||
32 | #define LL_LLSKIPLIST_H | 32 | #define LL_LLSKIPLIST_H |
33 | 33 | ||
34 | #include "llrand.h" | 34 | #include "llrand.h" |
35 | #include "llrand.h" | ||
35 | 36 | ||
36 | // NOTA BENE: Insert first needs to be < NOT <= | 37 | // NOTA BENE: Insert first needs to be < NOT <= |
37 | // Binary depth must be >= 2 | 38 | // Binary depth must be >= 2 |
diff --git a/linden/indra/newview/llsphere.h b/linden/indra/llcommon/llsmoothstep.h index 3a827c9..c2b3447 100644 --- a/linden/indra/newview/llsphere.h +++ b/linden/indra/llcommon/llsmoothstep.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /** | 1 | /** |
2 | * @file llsphere.h | 2 | * @file llsmoothstep.h |
3 | * @brief interface for the LLSphere class. | 3 | * @brief Smoothstep - transition from 0 to 1 - function, first and second derivatives all continuous (smooth) |
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
6 | * | 6 | * |
@@ -29,30 +29,22 @@ | |||
29 | * $/LicenseInfo$ | 29 | * $/LicenseInfo$ |
30 | */ | 30 | */ |
31 | 31 | ||
32 | #ifndef LL_LLSPHERE_H | 32 | #ifndef LL_LLSMOOTHSTEP_H |
33 | #define LL_LLSPHERE_H | 33 | #define LL_LLSMOOTHSTEP_H |
34 | 34 | ||
35 | //#include "vmath.h" | 35 | template <class LLDATATYPE> |
36 | #include "llmath.h" | 36 | inline LLDATATYPE llsmoothstep(const LLDATATYPE& edge0, const LLDATATYPE& edge1, const LLDATATYPE& value) |
37 | #include "v3math.h" | 37 | { |
38 | #include "v4math.h" | 38 | if (value < edge0) |
39 | #include "m3math.h" | 39 | return (LLDATATYPE)0; |
40 | #include "m4math.h" | ||
41 | #include "v4color.h" | ||
42 | #include "llgl.h" | ||
43 | 40 | ||
44 | void lat2xyz(LLVector3 * result, F32 lat, F32 lon); // utility routine | 41 | if (value >= edge1) |
42 | return (LLDATATYPE)1; | ||
45 | 43 | ||
46 | class LLSphere | 44 | // Scale/bias into [0..1] range |
47 | { | 45 | LLDATATYPE scaled_value = (value - edge0) / (edge1 - edge0); |
48 | public: | ||
49 | LLGLuint mDList[5]; | ||
50 | 46 | ||
51 | void prerender(); | 47 | return scaled_value * scaled_value * (3 - 2 * scaled_value); |
52 | void cleanupGL(); | 48 | } |
53 | void render(F32 pixel_area); // of a box of size 1.0 at that position | ||
54 | void render(); // render at highest LOD | ||
55 | }; | ||
56 | 49 | ||
57 | extern LLSphere gSphere; | 50 | #endif // LL_LLSMOOTHSTEP_H |
58 | #endif | ||
diff --git a/linden/indra/llcommon/llstatenums.h b/linden/indra/llcommon/llstatenums.h index 6fa61e1..bde6ade 100644 --- a/linden/indra/llcommon/llstatenums.h +++ b/linden/indra/llcommon/llstatenums.h | |||
@@ -57,7 +57,13 @@ enum | |||
57 | LL_SIM_STAT_VIRTUAL_SIZE_KB, | 57 | LL_SIM_STAT_VIRTUAL_SIZE_KB, |
58 | LL_SIM_STAT_RESIDENT_SIZE_KB, | 58 | LL_SIM_STAT_RESIDENT_SIZE_KB, |
59 | LL_SIM_STAT_PENDING_LOCAL_UPLOADS, | 59 | LL_SIM_STAT_PENDING_LOCAL_UPLOADS, |
60 | LL_SIM_STAT_TOTAL_UNACKED_BYTES | 60 | LL_SIM_STAT_TOTAL_UNACKED_BYTES, |
61 | LL_SIM_STAT_PHYSICS_PINNED_TASKS, | ||
62 | LL_SIM_STAT_PHYSICS_LOD_TASKS, | ||
63 | LL_SIM_STAT_SIMPHYSICSSTEPMS, | ||
64 | LL_SIM_STAT_SIMPHYSICSSHAPEMS, | ||
65 | LL_SIM_STAT_SIMPHYSICSOTHERMS, | ||
66 | LL_SIM_STAT_SIMPHYSICSMEMORY | ||
61 | }; | 67 | }; |
62 | 68 | ||
63 | #endif | 69 | #endif |
diff --git a/linden/indra/llcommon/llstl.h b/linden/indra/llcommon/llstl.h index 2719888..9a24185 100644 --- a/linden/indra/llcommon/llstl.h +++ b/linden/indra/llcommon/llstl.h | |||
@@ -33,6 +33,9 @@ | |||
33 | #define LL_LLSTL_H | 33 | #define LL_LLSTL_H |
34 | 34 | ||
35 | #include <functional> | 35 | #include <functional> |
36 | #include <algorithm> | ||
37 | #include <map> | ||
38 | #include <vector> | ||
36 | #include <set> | 39 | #include <set> |
37 | #include <deque> | 40 | #include <deque> |
38 | 41 | ||
diff --git a/linden/indra/llcommon/llstreamtools.cpp b/linden/indra/llcommon/llstreamtools.cpp index 669bdd0..b95ee60 100644 --- a/linden/indra/llcommon/llstreamtools.cpp +++ b/linden/indra/llcommon/llstreamtools.cpp | |||
@@ -263,20 +263,14 @@ bool get_word(std::string& output_string, std::istream& input_stream, int n) | |||
263 | // get everything up to and including the next newline | 263 | // get everything up to and including the next newline |
264 | bool get_line(std::string& output_string, std::istream& input_stream) | 264 | bool get_line(std::string& output_string, std::istream& input_stream) |
265 | { | 265 | { |
266 | output_string.clear(); | ||
266 | char c = input_stream.get(); | 267 | char c = input_stream.get(); |
267 | while (input_stream.good()) | 268 | while (input_stream.good()) |
268 | { | 269 | { |
269 | if ('\r' == c) | 270 | output_string += c; |
270 | { | 271 | if ('\n' == c) |
271 | // skip carriage returns | ||
272 | } | ||
273 | else | ||
274 | { | 272 | { |
275 | output_string += c; | 273 | break; |
276 | if ('\n' == c) | ||
277 | { | ||
278 | break; | ||
279 | } | ||
280 | } | 274 | } |
281 | c = input_stream.get(); | 275 | c = input_stream.get(); |
282 | } | 276 | } |
@@ -288,27 +282,21 @@ bool get_line(std::string& output_string, std::istream& input_stream) | |||
288 | // add a newline on the end if bail before actual line ending | 282 | // add a newline on the end if bail before actual line ending |
289 | bool get_line(std::string& output_string, std::istream& input_stream, int n) | 283 | bool get_line(std::string& output_string, std::istream& input_stream, int n) |
290 | { | 284 | { |
285 | output_string.clear(); | ||
291 | int char_count = 0; | 286 | int char_count = 0; |
292 | char c = input_stream.get(); | 287 | char c = input_stream.get(); |
293 | while (input_stream.good() && char_count < n) | 288 | while (input_stream.good() && char_count < n) |
294 | { | 289 | { |
295 | char_count++; | 290 | char_count++; |
296 | output_string += c; | 291 | output_string += c; |
297 | if ('\r' == c) | 292 | if ('\n' == c) |
298 | { | 293 | { |
299 | // skip carriage returns | 294 | break; |
300 | } | 295 | } |
301 | else | 296 | if (char_count >= n) |
302 | { | 297 | { |
303 | if ('\n' == c) | 298 | output_string.append("\n"); |
304 | { | 299 | break; |
305 | break; | ||
306 | } | ||
307 | if (char_count >= n) | ||
308 | { | ||
309 | output_string.append("\n"); | ||
310 | break; | ||
311 | } | ||
312 | } | 300 | } |
313 | c = input_stream.get(); | 301 | c = input_stream.get(); |
314 | } | 302 | } |
@@ -408,49 +396,6 @@ void replace_newlines_with_whitespace(std::string& line) | |||
408 | } | 396 | } |
409 | } | 397 | } |
410 | 398 | ||
411 | // returns 1 for solitary "{" | ||
412 | // returns -1 for solitary "}" | ||
413 | // otherwise returns 0 | ||
414 | int get_brace_count(const std::string& line) | ||
415 | { | ||
416 | int index = 0; | ||
417 | int line_size = line.size(); | ||
418 | char c = 0; | ||
419 | while (index < line_size) | ||
420 | { | ||
421 | c = line[index]; | ||
422 | index++; | ||
423 | if (!isspace(c)) | ||
424 | { | ||
425 | break; | ||
426 | } | ||
427 | } | ||
428 | char brace = c; | ||
429 | // make sure the rest of the line is whitespace | ||
430 | while (index < line_size) | ||
431 | { | ||
432 | c = line[index]; | ||
433 | if (!isspace(c)) | ||
434 | { | ||
435 | break; | ||
436 | } | ||
437 | index++; | ||
438 | } | ||
439 | if ('\n' != c) | ||
440 | { | ||
441 | return 0; | ||
442 | } | ||
443 | if ('{' == brace) | ||
444 | { | ||
445 | return 1; | ||
446 | } | ||
447 | else if ('}' == brace) | ||
448 | { | ||
449 | return -1; | ||
450 | } | ||
451 | return 0; | ||
452 | } | ||
453 | |||
454 | // erases any double-quote characters in 'line' | 399 | // erases any double-quote characters in 'line' |
455 | void remove_double_quotes(std::string& line) | 400 | void remove_double_quotes(std::string& line) |
456 | { | 401 | { |
@@ -498,7 +443,7 @@ void get_keyword_and_value(std::string& keyword, | |||
498 | } | 443 | } |
499 | 444 | ||
500 | // get the keyword | 445 | // get the keyword |
501 | keyword.assign(""); | 446 | keyword.clear(); |
502 | while (line_index < line_size) | 447 | while (line_index < line_size) |
503 | { | 448 | { |
504 | c = line[line_index]; | 449 | c = line[line_index]; |
@@ -510,6 +455,8 @@ void get_keyword_and_value(std::string& keyword, | |||
510 | line_index++; | 455 | line_index++; |
511 | } | 456 | } |
512 | 457 | ||
458 | // get the value | ||
459 | value.clear(); | ||
513 | if (keyword.size() > 0 | 460 | if (keyword.size() > 0 |
514 | && '\r' != line[line_index] | 461 | && '\r' != line[line_index] |
515 | && '\n' != line[line_index]) | 462 | && '\n' != line[line_index]) |
@@ -523,8 +470,6 @@ void get_keyword_and_value(std::string& keyword, | |||
523 | line_index++; | 470 | line_index++; |
524 | } | 471 | } |
525 | 472 | ||
526 | // get the value | ||
527 | value.assign(""); | ||
528 | while (line_index < line_size) | 473 | while (line_index < line_size) |
529 | { | 474 | { |
530 | c = line[line_index]; | 475 | c = line[line_index]; |
diff --git a/linden/indra/llcommon/llstreamtools.h b/linden/indra/llcommon/llstreamtools.h index 9db90c8..d84e53b 100644 --- a/linden/indra/llcommon/llstreamtools.h +++ b/linden/indra/llcommon/llstreamtools.h | |||
@@ -96,11 +96,6 @@ void escape_string(std::string& line); | |||
96 | // replaces each '\n' character with ' ' | 96 | // replaces each '\n' character with ' ' |
97 | void replace_newlines_with_whitespace(std::string& line); | 97 | void replace_newlines_with_whitespace(std::string& line); |
98 | 98 | ||
99 | // returns 1 for solitary "{" | ||
100 | // returns -1 for solitary "}" | ||
101 | // otherwise returns 0 | ||
102 | int get_brace_count(const std::string& line); | ||
103 | |||
104 | // erases any double-quote characters in line | 99 | // erases any double-quote characters in line |
105 | void remove_double_quotes(std::string& line); | 100 | void remove_double_quotes(std::string& line); |
106 | 101 | ||
diff --git a/linden/indra/llcommon/llstring.cpp b/linden/indra/llcommon/llstring.cpp index 73c80e7..a1f19ad 100644 --- a/linden/indra/llcommon/llstring.cpp +++ b/linden/indra/llcommon/llstring.cpp | |||
@@ -804,16 +804,19 @@ std::string utf8str_removeCRLF(const std::string& utf8str) | |||
804 | 804 | ||
805 | #if LL_WINDOWS | 805 | #if LL_WINDOWS |
806 | // documentation moved to header. Phoenix 2007-11-27 | 806 | // documentation moved to header. Phoenix 2007-11-27 |
807 | int safe_snprintf(char *str, size_t size, const char *format, ...) | 807 | namespace snprintf_hack |
808 | { | 808 | { |
809 | va_list args; | 809 | int snprintf(char *str, size_t size, const char *format, ...) |
810 | va_start(args, format); | 810 | { |
811 | 811 | va_list args; | |
812 | int num_written = _vsnprintf(str, size, format, args); /* Flawfinder: ignore */ | 812 | va_start(args, format); |
813 | va_end(args); | 813 | |
814 | 814 | int num_written = _vsnprintf(str, size, format, args); /* Flawfinder: ignore */ | |
815 | str[size-1] = '\0'; // always null terminate | 815 | va_end(args); |
816 | return num_written; | 816 | |
817 | str[size-1] = '\0'; // always null terminate | ||
818 | return num_written; | ||
819 | } | ||
817 | } | 820 | } |
818 | 821 | ||
819 | std::string ll_convert_wide_to_string(const wchar_t* in) | 822 | std::string ll_convert_wide_to_string(const wchar_t* in) |
diff --git a/linden/indra/llcommon/llversionserver.h b/linden/indra/llcommon/llversionserver.h index 05ac9b3..e865b6a 100644 --- a/linden/indra/llcommon/llversionserver.h +++ b/linden/indra/llcommon/llversionserver.h | |||
@@ -33,9 +33,9 @@ | |||
33 | #define LL_LLVERSIONSERVER_H | 33 | #define LL_LLVERSIONSERVER_H |
34 | 34 | ||
35 | const S32 LL_VERSION_MAJOR = 1; | 35 | const S32 LL_VERSION_MAJOR = 1; |
36 | const S32 LL_VERSION_MINOR = 19; | 36 | const S32 LL_VERSION_MINOR = 20; |
37 | const S32 LL_VERSION_PATCH = 1; | 37 | const S32 LL_VERSION_PATCH = 0; |
38 | const S32 LL_VERSION_BUILD = 3; | 38 | const S32 LL_VERSION_BUILD = 83892; |
39 | 39 | ||
40 | const char * const LL_CHANNEL = "Second Life Server"; | 40 | const char * const LL_CHANNEL = "Second Life Server"; |
41 | 41 | ||
diff --git a/linden/indra/llcommon/llversionviewer.h b/linden/indra/llcommon/llversionviewer.h index f00657a..06f6a82 100644 --- a/linden/indra/llcommon/llversionviewer.h +++ b/linden/indra/llcommon/llversionviewer.h | |||
@@ -33,9 +33,9 @@ | |||
33 | #define LL_LLVERSIONVIEWER_H | 33 | #define LL_LLVERSIONVIEWER_H |
34 | 34 | ||
35 | const S32 LL_VERSION_MAJOR = 1; | 35 | const S32 LL_VERSION_MAJOR = 1; |
36 | const S32 LL_VERSION_MINOR = 19; | 36 | const S32 LL_VERSION_MINOR = 20; |
37 | const S32 LL_VERSION_PATCH = 1; | 37 | const S32 LL_VERSION_PATCH = 2; |
38 | const S32 LL_VERSION_BUILD = 4; | 38 | const S32 LL_VERSION_BUILD = 0; |
39 | 39 | ||
40 | const char * const LL_CHANNEL = "Second Life Release"; | 40 | const char * const LL_CHANNEL = "Second Life Release"; |
41 | 41 | ||