diff options
| author | Don Kjer <don@lindenlab.com> | 2007-12-05 23:43:56 +0000 |
|---|---|---|
| committer | Don Kjer <don@lindenlab.com> | 2007-12-05 23:43:56 +0000 |
| commit | facf67ae3226105910c983a8fa8760414bf703e9 (patch) | |
| tree | b5f7cd6b79a79f769080a65b6fe2cb6b97c8b6fb /indra/llui/llui.cpp | |
| parent | 45057e8881c3166c7c0ef545c02bc177922af6fb (diff) | |
EFFECTIVE MERGE: svn merge -r 71520:73420 svn+ssh://svn/svn/linden/branches/maintenance-3 into release
ACTUAL MERGE: svn merge -r 75074:75114 svn+ssh://svn/svn/linden/qa/maintenance-3-merge-75067 into release
Diffstat (limited to 'indra/llui/llui.cpp')
| -rw-r--r-- | indra/llui/llui.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 7af0d726cb..00a230dff3 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1696,6 +1696,34 @@ LLVector2 LLUI::getWindowSize() } //static +void LLUI::screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y) +{ + *gl_x = llround((F32)screen_x * sGLScaleFactor.mV[VX]); + *gl_y = llround((F32)screen_y * sGLScaleFactor.mV[VY]); +} + +//static +void LLUI::glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y) +{ + *screen_x = llround((F32)gl_x / sGLScaleFactor.mV[VX]); + *screen_y = llround((F32)gl_y / sGLScaleFactor.mV[VY]); +} + +//static +void LLUI::screenRectToGL(const LLRect& screen, LLRect *gl) +{ + screenPointToGL(screen.mLeft, screen.mTop, &gl->mLeft, &gl->mTop); + screenPointToGL(screen.mRight, screen.mBottom, &gl->mRight, &gl->mBottom); +} + +//static +void LLUI::glRectToScreen(const LLRect& gl, LLRect *screen) +{ + glPointToScreen(gl.mLeft, gl.mTop, &screen->mLeft, &screen->mTop); + glPointToScreen(gl.mRight, gl.mBottom, &screen->mRight, &screen->mBottom); +} + +//static LLUUID LLUI::findAssetUUIDByName(const LLString &asset_name) { if(asset_name == LLString::null) return LLUUID::null; |
