From 5bf7281525b94cf4d24bcbb29655461325bbf5bd Mon Sep 17 00:00:00 2001 From: Drake Arconis Date: Sun, 25 Aug 2013 02:16:35 -0400 Subject: [PATCH 1/6] Fixes to build against windows 8 sdk --- indra/cmake/DirectX.cmake | 80 ++++++++++++++-------- indra/plugins/winmmshim/forwarding_api.cpp | 6 +- indra/plugins/winmmshim/forwarding_api.h | 4 +- indra/win_crash_logger/CMakeLists.txt | 1 + 4 files changed, 58 insertions(+), 33 deletions(-) diff --git a/indra/cmake/DirectX.cmake b/indra/cmake/DirectX.cmake index c10e7e344..a0dac0fd0 100644 --- a/indra/cmake/DirectX.cmake +++ b/indra/cmake/DirectX.cmake @@ -1,44 +1,68 @@ # -*- cmake -*- +include(Variables) + if (WINDOWS) - find_path(DIRECTX_INCLUDE_DIR dxdiag.h - "$ENV{DXSDK_DIR}/Include" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2010)/Include" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2009)/Include" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2008)/Include" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2008)/Include" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2008)/Include" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (November 2007)/Include" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2007)/Include" - "C:/DX90SDK/Include" - "$ENV{PROGRAMFILES}/DX90SDK/Include" + if (WORD_SIZE EQUAL 32) + set (DIRECTX_ARCHITECTURE x86) + elseif (WORD_SIZE EQUAL 64) + set (DIRECTX_ARCHITECTURE x64) + else (WORD_SIZE EQUAL 32) + set (DIRECTX_ARCHITECTURE x86) + endif (WORD_SIZE EQUAL 32) + + find_path(DIRECTX_ROOT_DIR Include/dxdiag.h + PATHS + "$ENV{DXSDK_DIR}" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (June 2010)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (June 2010)" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (February 2010)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (February 2010)" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (March 2009)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (March 2009)" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (August 2008)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (August 2008)" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (June 2008)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (June 2008)" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (March 2008)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (March 2008)" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (November 2007)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (November 2007)" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (August 2007)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (August 2007)" ) + + if (DIRECTX_ROOT_DIR) + set (DIRECTX_INCLUDE_DIR "${DIRECTX_ROOT_DIR}/Include") + set (DIRECTX_LIBRARY_DIR "${DIRECTX_ROOT_DIR}/Lib/${DIRECTX_ARCHITECTURE}") + else (DIRECTX_ROOT_DIR) + find_path (WIN_KIT_ROOT_DIR Include/um/windows.h + PATHS + "$ENV{ProgramFiles}/Windows Kits/8.1" + "$ENV{ProgramFiles(x86)}/Windows Kits/8.1" + "$ENV{ProgramFiles}/Windows Kits/8.0" + "$ENV{ProgramFiles(x86)}/Windows Kits/8.0" + ) + + if (WIN_KIT_ROOT_DIR) + set (DIRECTX_INCLUDE_DIR "${WIN_KIT_ROOT_DIR}/Include/um" "${WIN_KIT_ROOT_DIR}/Include/shared") + set (DIRECTX_LIBRARY_DIR "${WIN_KIT_ROOT_DIR}/Lib/Win8/um/${DIRECTX_ARCHITECTURE}") + endif (WIN_KIT_ROOT_DIR) + endif (DIRECTX_ROOT_DIR) + if (DIRECTX_INCLUDE_DIR) include_directories(${DIRECTX_INCLUDE_DIR}) - if (DIRECTX_FIND_QUIETLY) + #if (DIRECTX_FIND_QUIETLY) message(STATUS "Found DirectX include: ${DIRECTX_INCLUDE_DIR}") - endif (DIRECTX_FIND_QUIETLY) + #endif (DIRECTX_FIND_QUIETLY) else (DIRECTX_INCLUDE_DIR) message(FATAL_ERROR "Could not find DirectX SDK Include") endif (DIRECTX_INCLUDE_DIR) - - find_path(DIRECTX_LIBRARY_DIR dxguid.lib - "$ENV{DXSDK_DIR}/Lib/x86" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2010)/Lib/x86" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2009)/Lib/x86" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2008)/Lib/x86" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2008)/Lib/x86" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2008)/Lib/x86" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (November 2007)/Lib/x86" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2007)/Lib/x86" - "C:/DX90SDK/Lib" - "$ENV{PROGRAMFILES}/DX90SDK/Lib" - ) if (DIRECTX_LIBRARY_DIR) - if (DIRECTX_FIND_QUIETLY) + #if (DIRECTX_FIND_QUIETLY) message(STATUS "Found DirectX include: ${DIRECTX_LIBRARY_DIR}") - endif (DIRECTX_FIND_QUIETLY) + #endif (DIRECTX_FIND_QUIETLY) else (DIRECTX_LIBRARY_DIR) message(FATAL_ERROR "Could not find DirectX SDK Libraries") endif (DIRECTX_LIBRARY_DIR) diff --git a/indra/plugins/winmmshim/forwarding_api.cpp b/indra/plugins/winmmshim/forwarding_api.cpp index 495e08942..745c97309 100644 --- a/indra/plugins/winmmshim/forwarding_api.cpp +++ b/indra/plugins/winmmshim/forwarding_api.cpp @@ -1338,7 +1338,7 @@ extern "C" { return joySetThreshold_orig( uJoyID, uThreshold); } - BOOL WINAPI mciDriverNotify(HWND hwndCallback, UINT uDeviceID, UINT uStatus) + BOOL WINAPI mciDriverNotify(HANDLE hwndCallback, UINT uDeviceID, UINT uStatus) { ll_winmm_shim_initialize(); //OutputDebugString(L"mciDriverNotify\n"); @@ -1610,11 +1610,11 @@ extern "C" { return mciGetYieldProc_orig( mciId, pdwYieldData); } - UINT WINAPI mciLoadCommandResource(HINSTANCE hInstance, LPCWSTR lpResName, UINT uType) + UINT WINAPI mciLoadCommandResource(HANDLE hInstance, LPCWSTR lpResName, UINT wType) { ll_winmm_shim_initialize(); //OutputDebugString(L"mciLoadCommandResource"); - return mciLoadCommandResource_orig(hInstance, lpResName, uType); + return mciLoadCommandResource_orig(hInstance, lpResName, wType); } diff --git a/indra/plugins/winmmshim/forwarding_api.h b/indra/plugins/winmmshim/forwarding_api.h index 076a08f76..80fd164ad 100644 --- a/indra/plugins/winmmshim/forwarding_api.h +++ b/indra/plugins/winmmshim/forwarding_api.h @@ -306,7 +306,7 @@ typedef MMRESULT (WINAPI *joySetCapture_type)( HWND hwnd, UINT uJoyID, UINT uPer extern joySetCapture_type joySetCapture_orig; typedef MMRESULT (WINAPI *joySetThreshold_type)( UINT uJoyID, UINT uThreshold); extern joySetThreshold_type joySetThreshold_orig; -typedef BOOL (WINAPI *mciDriverNotify_type)(HWND hwndCallback, UINT uDeviceID, UINT uStatus); +typedef BOOL (WINAPI *mciDriverNotify_type)(HANDLE hwndCallback, UINT uDeviceID, UINT uStatus); extern mciDriverNotify_type mciDriverNotify_orig; typedef UINT (WINAPI *mciDriverYield_type)(UINT uDeviceID); extern mciDriverYield_type mciDriverYield_orig; @@ -384,7 +384,7 @@ typedef HTASK (WINAPI *mciGetCreatorTask_type)( MCIDEVICEID mciId); extern mciGetCreatorTask_type mciGetCreatorTask_orig; typedef YIELDPROC (WINAPI *mciGetYieldProc_type)( MCIDEVICEID mciId, LPDWORD pdwYieldData); extern mciGetYieldProc_type mciGetYieldProc_orig; -typedef UINT (WINAPI *mciLoadCommandResource_type)(HINSTANCE hInstance, LPCWSTR lpResName, UINT uType); +typedef UINT (WINAPI *mciLoadCommandResource_type)(HANDLE hInstance, LPCWSTR lpResName, UINT wType); extern mciLoadCommandResource_type mciLoadCommandResource_orig; typedef BOOL (WINAPI *mciExecute_type)(LPCSTR pszCommand); extern mciExecute_type mciExecute_orig; diff --git a/indra/win_crash_logger/CMakeLists.txt b/indra/win_crash_logger/CMakeLists.txt index 9d3021ee2..eb2f45633 100644 --- a/indra/win_crash_logger/CMakeLists.txt +++ b/indra/win_crash_logger/CMakeLists.txt @@ -3,6 +3,7 @@ project(win_crash_logger) include(00-Common) +include(DirectX) include(LLCommon) include(LLCrashLogger) include(LLMath) From 59687082078b3ed0e42794897731ea261939955f Mon Sep 17 00:00:00 2001 From: Drake Arconis Date: Sun, 25 Aug 2013 02:45:00 -0400 Subject: [PATCH 2/6] Fixed non-localizable strings in world map --- indra/newview/llworldmapview.cpp | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 66c395bd6..b9a729315 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -513,25 +513,7 @@ void LLWorldMapView::draw() static const LLCachedControl show_avs("LiruMapShowAvCount"); if (show_avs) mesg += llformat(" (%d)", info->getAgentCount()); - U8 access = info->getAccess(); - switch(access) - { - case SIM_ACCESS_MIN: - mesg += " (Min)"; - break; - case SIM_ACCESS_PG: - mesg += " (PG)"; - break; - case SIM_ACCESS_MATURE: - mesg += " (Mature)"; - break; - case SIM_ACCESS_ADULT: - mesg += " (Adult)"; - break; - default: - mesg += llformat(" (Access=%d)",access); - break; - } + mesg += llformat(" (%s)", info->getAccessString().c_str()); } // if (!mesg.empty()) // [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 From 01bba31c8da2e8756c79a36db40578e7bd4f7113 Mon Sep 17 00:00:00 2001 From: Drake Arconis Date: Sun, 25 Aug 2013 03:02:40 -0400 Subject: [PATCH 3/6] Crash fixes to deal with janky FBX to DAE converters --- indra/llprimitive/llmodel.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 5aa1ebdc3..d93c65595 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -630,25 +630,41 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector& fac if (v) { U32 v_idx = idx[j*stride+v_offset]*3; + v_idx = llclamp(v_idx, (U32) 0, (U32) v->getCount()); vert.getPosition().set(v->get(v_idx), v->get(v_idx+1), v->get(v_idx+2)); } - if (n) + //bounds check n and t lookups because some FBX to DAE converters + //use negative indices and empty arrays to indicate data does not exist + //for a particular channel + if (n && n->getCount() > 0) { U32 n_idx = idx[j*stride+n_offset]*3; + n_idx = llclamp(n_idx, (U32) 0, (U32) n->getCount()); vert.getNormal().set(n->get(n_idx), n->get(n_idx+1), n->get(n_idx+2)); } + else + { + vert.getNormal().clear(); + } - if (t) + + if (t && t->getCount() > 0) { U32 t_idx = idx[j*stride+t_offset]*2; + t_idx = llclamp(t_idx, (U32) 0, (U32) t->getCount()); vert.mTexCoord.setVec(t->get(t_idx), t->get(t_idx+1)); } + else + { + vert.mTexCoord.clear(); + } + verts.push_back(vert); } From 4ec56904e72729e57b1c6f387e1d55bdb153f945 Mon Sep 17 00:00:00 2001 From: Drake Arconis Date: Sun, 25 Aug 2013 03:02:59 -0400 Subject: [PATCH 4/6] Make perlin nosie repeatable for consistent ground textures --- indra/newview/noise.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/indra/newview/noise.h b/indra/newview/noise.h index d324c52e4..0cc558a8e 100644 --- a/indra/newview/noise.h +++ b/indra/newview/noise.h @@ -316,6 +316,8 @@ static void normalize3(F32 v[3]) static void init(void) { + // we want repeatable noise (e.g. for stable terrain texturing), so seed with known value + srand(42); int i, j, k; for (i = 0 ; i < B ; i++) { @@ -346,6 +348,9 @@ static void init(void) for (j = 0 ; j < 3 ; j++) g3[B + i][j] = g3[i][j]; } + + // reintroduce entropy + srand(time(NULL)); // Flawfinder: ignore } #undef B From cdeea281cdaec7fe7615ddc80312121cd90a0338 Mon Sep 17 00:00:00 2001 From: Drake Arconis Date: Sun, 25 Aug 2013 03:04:47 -0400 Subject: [PATCH 5/6] Fix debugging info left on from win8 fixes --- indra/cmake/DirectX.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/cmake/DirectX.cmake b/indra/cmake/DirectX.cmake index a0dac0fd0..a0dc4b2b5 100644 --- a/indra/cmake/DirectX.cmake +++ b/indra/cmake/DirectX.cmake @@ -52,17 +52,17 @@ if (WINDOWS) if (DIRECTX_INCLUDE_DIR) include_directories(${DIRECTX_INCLUDE_DIR}) - #if (DIRECTX_FIND_QUIETLY) + if (DIRECTX_FIND_QUIETLY) message(STATUS "Found DirectX include: ${DIRECTX_INCLUDE_DIR}") - #endif (DIRECTX_FIND_QUIETLY) + endif (DIRECTX_FIND_QUIETLY) else (DIRECTX_INCLUDE_DIR) message(FATAL_ERROR "Could not find DirectX SDK Include") endif (DIRECTX_INCLUDE_DIR) if (DIRECTX_LIBRARY_DIR) - #if (DIRECTX_FIND_QUIETLY) + if (DIRECTX_FIND_QUIETLY) message(STATUS "Found DirectX include: ${DIRECTX_LIBRARY_DIR}") - #endif (DIRECTX_FIND_QUIETLY) + endif (DIRECTX_FIND_QUIETLY) else (DIRECTX_LIBRARY_DIR) message(FATAL_ERROR "Could not find DirectX SDK Libraries") endif (DIRECTX_LIBRARY_DIR) From fdc855cd37cad6bfb6c2ffba344c911db2b44614 Mon Sep 17 00:00:00 2001 From: Drake Arconis Date: Sun, 25 Aug 2013 14:14:51 -0400 Subject: [PATCH 6/6] Trivial changes to better sync with viewer 3 --- indra/newview/llappviewer.cpp | 14 +++++++------- indra/newview/llavataractions.cpp | 2 +- indra/newview/llfloateravatarlist.cpp | 2 +- indra/newview/llfloaterblacklist.cpp | 2 +- indra/newview/llfloaterteleporthistory.cpp | 2 +- indra/newview/llpanelavatar.cpp | 2 +- indra/newview/llpaneldisplay.cpp | 8 ++++---- indra/newview/llpanelgroup.cpp | 2 +- indra/newview/llpanelobject.cpp | 6 +++--- indra/newview/llpanelpermissions.cpp | 2 +- indra/newview/llpreviewanim.cpp | 2 +- indra/newview/llpreviewsound.cpp | 2 +- indra/newview/llstartup.cpp | 2 +- indra/newview/lltoolgun.cpp | 4 ++-- indra/newview/llviewerdisplay.cpp | 2 +- indra/newview/llviewermenu.cpp | 6 +++--- indra/newview/llviewerwindow.cpp | 2 +- indra/newview/llviewerwindow.h | 6 +++--- indra/plugins/filepicker/llfilepicker.cpp | 20 ++++++++++---------- 19 files changed, 44 insertions(+), 44 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index bbaee5358..575be4210 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1196,7 +1196,7 @@ bool LLAppViewer::mainLoop() // Scan keyboard for movement keys. Command keys and typing // are handled by windows callbacks. Don't do this until we're // done initializing. JC - if (gViewerWindow->mWindow->getVisible() + if (gViewerWindow->getWindow()->getVisible() && gViewerWindow->getActive() && !gViewerWindow->getWindow()->getMinimized() && LLStartUp::getStartupState() == STATE_STARTED @@ -1282,7 +1282,7 @@ bool LLAppViewer::mainLoop() // yield cooperatively when not running as foreground window if ( gNoRender - || (gViewerWindow && !gViewerWindow->mWindow->getVisible()) + || (gViewerWindow && !gViewerWindow->getWindow()->getVisible()) || !gFocusMgr.getAppHasFocus()) { // Sleep if we're not rendering, or the window is minimized. @@ -2569,7 +2569,7 @@ bool LLAppViewer::initWindow() if (gSavedSettings.getBOOL("WindowMaximized")) { - gViewerWindow->mWindow->maximize(); + gViewerWindow->getWindow()->maximize(); gViewerWindow->getWindow()->setNativeAspectRatio(gSavedSettings.getF32("FullScreenAspectRatio")); } @@ -2607,7 +2607,7 @@ bool LLAppViewer::initWindow() gViewerWindow->initBase(); // show viewer window - //gViewerWindow->mWindow->show(); + //gViewerWindow->getWindow()->show(); LL_INFOS("AppInit") << "Window initialization done." << LL_ENDL; return true; @@ -2639,13 +2639,13 @@ void LLAppViewer::cleanupSavedSettings() // save window position if not fullscreen // as we don't track it in callbacks - BOOL fullscreen = gViewerWindow->mWindow->getFullscreen(); - BOOL maximized = gViewerWindow->mWindow->getMaximized(); + BOOL fullscreen = gViewerWindow->getWindow()->getFullscreen(); + BOOL maximized = gViewerWindow->getWindow()->getMaximized(); if (!fullscreen && !maximized) { LLCoordScreen window_pos; - if (gViewerWindow->mWindow->getPosition(&window_pos)) + if (gViewerWindow->getWindow()->getPosition(&window_pos)) { gSavedSettings.setS32("WindowX", window_pos.mX); gSavedSettings.setS32("WindowY", window_pos.mY); diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 8baff17bc..42f2e73d8 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -898,5 +898,5 @@ void LLAvatarActions::copyUUIDs(const uuid_vec_t& ids) } if (!ids_string.empty()) - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(ids_string)); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(ids_string)); } diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index 7b4d9f990..1cef54918 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -1296,7 +1296,7 @@ void LLFloaterAvatarList::onClickGetKey() if (NULL == item) return; - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(item->getUUID().asString())); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(item->getUUID().asString())); } void LLFloaterAvatarList::sendKeys() diff --git a/indra/newview/llfloaterblacklist.cpp b/indra/newview/llfloaterblacklist.cpp index bda356078..2b9b9dd05 100644 --- a/indra/newview/llfloaterblacklist.cpp +++ b/indra/newview/llfloaterblacklist.cpp @@ -197,7 +197,7 @@ void LLFloaterBlacklist::onClickCopyUUID(void* user_data) { LLFloaterBlacklist* floaterp = (LLFloaterBlacklist*)user_data; LLScrollListCtrl* list = floaterp->getChild("file_list"); - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(list->getFirstSelected()->getColumn(0)->getValue().asString())); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(list->getFirstSelected()->getColumn(0)->getValue().asString())); } // static void LLFloaterBlacklist::onClickRemove(void* user_data) diff --git a/indra/newview/llfloaterteleporthistory.cpp b/indra/newview/llfloaterteleporthistory.cpp index 27ad58de6..b3a6bad0c 100644 --- a/indra/newview/llfloaterteleporthistory.cpp +++ b/indra/newview/llfloaterteleporthistory.cpp @@ -351,5 +351,5 @@ void LLFloaterTeleportHistory::onCopySLURL(void* data) // get SLURL of the selected entry and copy it to the clipboard std::string SLURL = self->mPlacesList->getFirstSelected()->getColumn(LIST_SLURL)->getValue().asString(); - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(SLURL)); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(SLURL)); } diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index f1351cc57..4cda01c3b 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -1726,7 +1726,7 @@ void LLPanelAvatar::onClickGetKey(void *userdata) llinfos << "Copy agent id: " << agent_id << llendl; - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(agent_id.asString())); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(agent_id.asString())); } // static diff --git a/indra/newview/llpaneldisplay.cpp b/indra/newview/llpaneldisplay.cpp index fe381e59c..0f7184757 100644 --- a/indra/newview/llpaneldisplay.cpp +++ b/indra/newview/llpaneldisplay.cpp @@ -1010,8 +1010,8 @@ void LLPanelDisplay::onCommitAutoDetectAspect(const LLSD& value) S32 denominator = 0; // clear any aspect ratio override - gViewerWindow->mWindow->setNativeAspectRatio(0.f); - fractionFromDecimal(gViewerWindow->mWindow->getNativeAspectRatio(), numerator, denominator); + gViewerWindow->getWindow()->setNativeAspectRatio(0.f); + fractionFromDecimal(gViewerWindow->getWindow()->getNativeAspectRatio(), numerator, denominator); std::string aspect; if (numerator != 0) @@ -1020,12 +1020,12 @@ void LLPanelDisplay::onCommitAutoDetectAspect(const LLSD& value) } else { - aspect = llformat("%.3f", gViewerWindow->mWindow->getNativeAspectRatio()); + aspect = llformat("%.3f", gViewerWindow->getWindow()->getNativeAspectRatio()); } mCtrlAspectRatio->setLabel(aspect); - ratio = gViewerWindow->mWindow->getNativeAspectRatio(); + ratio = gViewerWindow->getWindow()->getNativeAspectRatio(); gSavedSettings.setF32("FullScreenAspectRatio", ratio); } } diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index 76d96fd2e..4975ddcd7 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -131,7 +131,7 @@ void LLPanelGroupTab::handleClickHelp() static void copy_group_profile_uri(const LLUUID& id) { - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring("secondlife:///app/group/"+id.asString()+"/about")); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring("secondlife:///app/group/"+id.asString()+"/about")); } LLPanelGroup::LLPanelGroup(const LLUUID& group_id) diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 925f8ecb0..7cf9872ae 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -2442,7 +2442,7 @@ void LLPanelObject::onCopyPos(void* user_data) stringVec.append(shortfloat(newpos.mV[VZ])); stringVec.append(">"); - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(stringVec)); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(stringVec)); } void LLPanelObject::onCopySize(void* user_data) @@ -2459,7 +2459,7 @@ void LLPanelObject::onCopySize(void* user_data) stringVec.append(shortfloat(newpos.mV[VZ])); stringVec.append(">"); - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(stringVec)); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(stringVec)); } void LLPanelObject::onCopyRot(void* user_data) @@ -2476,7 +2476,7 @@ void LLPanelObject::onCopyRot(void* user_data) stringVec.append(shortfloat(newpos.mV[VZ])); stringVec.append(">"); - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(stringVec)); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(stringVec)); } namespace diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index fa7f0565c..ad33397e3 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -1135,7 +1135,7 @@ void LLPanelPermissions::onClickCopyObjKey() output.append(object->getID().asString()); } } - if (!output.empty()) gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(output)); + if (!output.empty()) gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(output)); } ///---------------------------------------------------------------------------- diff --git a/indra/newview/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp index ba47526d0..09e2c61cf 100644 --- a/indra/newview/llpreviewanim.cpp +++ b/indra/newview/llpreviewanim.cpp @@ -331,7 +331,7 @@ void LLPreviewAnim::copyAnimID(void *userdata) if(item) { - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(item->getAssetUUID().asString())); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(item->getAssetUUID().asString())); } } // diff --git a/indra/newview/llpreviewsound.cpp b/indra/newview/llpreviewsound.cpp index 4a5122eed..bdab29153 100644 --- a/indra/newview/llpreviewsound.cpp +++ b/indra/newview/llpreviewsound.cpp @@ -291,7 +291,7 @@ void LLPreviewSound::copyUUID( void *userdata ) if(item ) { - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(item->getAssetUUID().asString())); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(item->getAssetUUID().asString())); } } // diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 0b0a6650a..53f438645 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1883,7 +1883,7 @@ bool idle_startup() // Make sure agent knows correct aspect ratio // FOV limits depend upon aspect ratio so this needs to happen before initializing the FOV below LLViewerCamera::getInstance()->setViewHeightInPixels(gViewerWindow->getWindowDisplayHeight()); - if (gViewerWindow->mWindow->getFullscreen()) + if (gViewerWindow->getWindow()->getFullscreen()) { LLViewerCamera::getInstance()->setAspect(gViewerWindow->getDisplayAspectRatio()); } diff --git a/indra/newview/lltoolgun.cpp b/indra/newview/lltoolgun.cpp index 055236f43..1eedb7b22 100644 --- a/indra/newview/lltoolgun.cpp +++ b/indra/newview/lltoolgun.cpp @@ -62,7 +62,7 @@ void LLToolGun::handleSelect() { gViewerWindow->hideCursor(); gViewerWindow->moveCursorToCenter(); - gViewerWindow->mWindow->setMouseClipping(TRUE); + gViewerWindow->getWindow()->setMouseClipping(TRUE); mIsSelected = TRUE; } @@ -70,7 +70,7 @@ void LLToolGun::handleDeselect() { gViewerWindow->moveCursorToCenter(); gViewerWindow->showCursor(); - gViewerWindow->mWindow->setMouseClipping(FALSE); + gViewerWindow->getWindow()->setMouseClipping(FALSE); mIsSelected = FALSE; } diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 811db8a36..addf01e9e 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -214,7 +214,7 @@ void display_update_camera(bool tiling=false) // Write some stats to llinfos void display_stats() { - if (gNoRender || !gViewerWindow->mWindow->getVisible() || !gFocusMgr.getAppHasFocus()) + if (gNoRender || !gViewerWindow->getWindow()->getVisible() || !gFocusMgr.getAppHasFocus()) { // Do not keep FPS statistics while yielding cooperatively // (i;e. when not running as foreground window) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index f216de44c..9c685b5cc 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2613,7 +2613,7 @@ class LLObjectCopyUUID : public view_listener_t LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); if(object) { - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(object->getID().asString())); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(object->getID().asString())); } return true; } @@ -3261,7 +3261,7 @@ class LLAvatarCopyUUID : public view_listener_t LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); if(!avatar) return true; - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(avatar->getID().asString())); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(avatar->getID().asString())); return true; } }; @@ -3273,7 +3273,7 @@ class LLAvatarClientUUID : public view_listener_t LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); if(!avatar) return true; const LLUUID clientID = SHClientTagMgr::instance().getClientID(avatar); - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(clientID.asString())); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(clientID.asString())); return true; } }; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index ca054bae3..3e57959b4 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4454,7 +4454,7 @@ void LLViewerWindow::movieSize(S32 new_width, S32 new_height) LLCoordScreen new_size(new_width + BORDERWIDTH, new_height + BORDERHEIGHT); BOOL disable_sync = gSavedSettings.getBOOL("DisableVerticalSync"); - if (gViewerWindow->mWindow->getFullscreen()) + if (gViewerWindow->getWindow()->getFullscreen()) { LLGLState::checkStates(); LLGLState::checkTextureChannels(); diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 3b38f450d..ed80a1253 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -234,7 +234,7 @@ public: S32 getCurrentMouseDX() const { return mCurrentMouseDelta.mX; } S32 getCurrentMouseDY() const { return mCurrentMouseDelta.mY; } LLCoordGL getCurrentMouseDelta() const { return mCurrentMouseDelta; } - LLStat * getMouseVelocityStat() { return &mMouseVelocityStat; } + LLStat* getMouseVelocityStat() { return &mMouseVelocityStat; } BOOL getLeftMouseDown() const { return mLeftMouseDown; } BOOL getMiddleMouseDown() const { return mMiddleMouseDown; } BOOL getRightMouseDown() const { return mRightMouseDown; } @@ -406,12 +406,12 @@ private: LLRect getChatConsoleRect(); // Get optimal cosole rect. public: - LLWindow* mWindow; // graphical window object void unblockToolTips(){mToolTipBlocked = FALSE;} //hack until LLToolTipMgr is ported. protected: - BOOL mActive; + LLWindow* mWindow; // graphical window object + bool mActive; BOOL mWantFullscreen; BOOL mShowFullscreenProgress; LLRect mWindowRectRaw; diff --git a/indra/plugins/filepicker/llfilepicker.cpp b/indra/plugins/filepicker/llfilepicker.cpp index 89fa2189e..8146b298d 100644 --- a/indra/plugins/filepicker/llfilepicker.cpp +++ b/indra/plugins/filepicker/llfilepicker.cpp @@ -911,7 +911,7 @@ OSStatus LLFilePickerBase::doNavChooseDialog(ELoadFilter filter, std::string con // (It is destroyed by NavDialogDispose() below.) error = NavCreateChooseFileDialog(&mNavOptions, NULL, eventProc, NULL, navOpenFilterProc, (void*)this, &navRef); - //gViewerWindow->mWindow->beforeDialog(); + //gViewerWindow->getWindow()->beforeDialog(); if (error == noErr) { @@ -919,7 +919,7 @@ OSStatus LLFilePickerBase::doNavChooseDialog(ELoadFilter filter, std::string con error = NavDialogRun(navRef); } - //gViewerWindow->mWindow->afterDialog(); + //gViewerWindow->getWindow()->afterDialog(); if (error == noErr) error = NavDialogGetReply(navRef, &navReply); @@ -1081,7 +1081,7 @@ OSStatus LLFilePickerBase::doNavSaveDialog(ESaveFilter filter, std::string const } } - //gViewerWindow->mWindow->beforeDialog(); + //gViewerWindow->getWindow()->beforeDialog(); // Run the dialog if (error == noErr) @@ -1090,7 +1090,7 @@ OSStatus LLFilePickerBase::doNavSaveDialog(ESaveFilter filter, std::string const error = NavDialogRun(navRef); } - //gViewerWindow->mWindow->afterDialog(); + //gViewerWindow->getWindow()->afterDialog(); if (error == noErr) error = NavDialogGetReply(navRef, &navReply); @@ -1439,7 +1439,7 @@ bool LLFilePickerBase::getSaveFile(ESaveFilter filter, std::string const& filena { bool rtn = FALSE; - //gViewerWindow->mWindow->beforeDialog(); + //gViewerWindow->getWindow()->beforeDialog(); reset(); @@ -1524,7 +1524,7 @@ bool LLFilePickerBase::getSaveFile(ESaveFilter filter, std::string const& filena rtn = (getFileCount() == 1); } - //gViewerWindow->mWindow->afterDialog(); + //gViewerWindow->getWindow()->afterDialog(); return rtn; } @@ -1533,7 +1533,7 @@ bool LLFilePickerBase::getLoadFile(ELoadFilter filter, std::string const& folder { bool rtn = FALSE; - //gViewerWindow->mWindow->beforeDialog(); + //gViewerWindow->getWindow()->beforeDialog(); reset(); @@ -1581,7 +1581,7 @@ bool LLFilePickerBase::getLoadFile(ELoadFilter filter, std::string const& folder rtn = (getFileCount() == 1); } - //gViewerWindow->mWindow->afterDialog(); + //gViewerWindow->getWindow()->afterDialog(); return rtn; } @@ -1590,7 +1590,7 @@ bool LLFilePickerBase::getMultipleLoadFiles(ELoadFilter filter, std::string cons { bool rtn = FALSE; - //gViewerWindow->mWindow->beforeDialog(); + //gViewerWindow->getWindow()->beforeDialog(); reset(); @@ -1609,7 +1609,7 @@ bool LLFilePickerBase::getMultipleLoadFiles(ELoadFilter filter, std::string cons rtn = !mFiles.empty(); } - //gViewerWindow->mWindow->afterDialog(); + //gViewerWindow->getWindow()->afterDialog(); return rtn; }