Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Archive
Alchemy Viewer
Commits
a4759de1
Commit
a4759de1
authored
9 years ago
by
¡Cinder! ㊝
Browse files
Options
Downloads
Patches
Plain Diff
ALCH-267 - Thanks Liru and Shyotl. :)
parent
2c2ec832
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
indra/newview/llnetmap.cpp
+26
-17
26 additions, 17 deletions
indra/newview/llnetmap.cpp
indra/newview/llviewerregion.cpp
+30
-0
30 additions, 0 deletions
indra/newview/llviewerregion.cpp
indra/newview/llviewerregion.h
+6
-2
6 additions, 2 deletions
indra/newview/llviewerregion.h
with
62 additions
and
19 deletions
indra/newview/llnetmap.cpp
+
26
−
17
View file @
a4759de1
...
@@ -53,7 +53,6 @@
...
@@ -53,7 +53,6 @@
#include
"llsurface.h"
#include
"llsurface.h"
#include
"llviewercamera.h"
#include
"llviewercamera.h"
#include
"llviewercontrol.h"
#include
"llviewercontrol.h"
#include
"llviewernetwork.h"
#include
"llviewertexture.h"
#include
"llviewertexture.h"
#include
"llviewertexturelist.h"
#include
"llviewertexturelist.h"
#include
"llviewermenu.h"
#include
"llviewermenu.h"
...
@@ -259,24 +258,34 @@ void LLNetMap::draw()
...
@@ -259,24 +258,34 @@ void LLNetMap::draw()
// <alchemy>
// <alchemy>
if
(
use_world_map_image
&&
LLGridManager
::
getInstance
()
->
isInSecondlife
()
)
if
(
use_world_map_image
)
{
{
LLViewerTexture
*
img
=
regionp
->
getMapImage
();
const
LLViewerRegion
::
tex_matrix_t
&
tiles
(
regionp
->
getWorldMapTiles
());
if
(
img
&&
img
->
hasGLTexture
())
for
(
S32
i
(
0
),
scaled_width
(
real_width
/
region_width
),
square_width
(
scaled_width
*
scaled_width
);
i
<
square_width
;
++
i
)
{
{
gGL
.
getTexUnit
(
0
)
->
bind
(
img
);
const
F32
y
(
i
/
scaled_width
);
gGL
.
begin
(
LLRender
::
QUADS
);
const
F32
x
(
i
-
y
*
scaled_width
);
gGL
.
texCoord2f
(
0.
f
,
1.
f
);
const
F32
local_left
(
left
+
x
*
mScale
);
gGL
.
vertex2f
(
left
,
top
);
const
F32
local_right
(
local_left
+
mScale
);
gGL
.
texCoord2f
(
0.
f
,
0.
f
);
const
F32
local_bottom
(
bottom
+
y
*
mScale
);
gGL
.
vertex2f
(
left
,
bottom
);
const
F32
local_top
(
local_bottom
+
mScale
);
gGL
.
texCoord2f
(
1.
f
,
0.
f
);
LLViewerTexture
*
img
=
tiles
[
x
*
scaled_width
+
y
];
gGL
.
vertex2f
(
right
,
bottom
);
if
(
img
&&
img
->
hasGLTexture
())
gGL
.
texCoord2f
(
1.
f
,
1.
f
);
{
gGL
.
vertex2f
(
right
,
top
);
gGL
.
getTexUnit
(
0
)
->
bind
(
img
);
gGL
.
end
();
gGL
.
begin
(
LLRender
::
QUADS
);
gGL
.
texCoord2f
(
0.
f
,
1.
f
);
img
->
setBoostLevel
(
LLGLTexture
::
BOOST_MAP_VISIBLE
);
gGL
.
vertex2f
(
local_left
,
local_top
);
gGL
.
texCoord2f
(
0.
f
,
0.
f
);
gGL
.
vertex2f
(
local_left
,
local_bottom
);
gGL
.
texCoord2f
(
1.
f
,
0.
f
);
gGL
.
vertex2f
(
local_right
,
local_bottom
);
gGL
.
texCoord2f
(
1.
f
,
1.
f
);
gGL
.
vertex2f
(
local_right
,
local_top
);
gGL
.
end
();
img
->
setBoostLevel
(
LLViewerTexture
::
BOOST_MAP_VISIBLE
);
}
}
}
}
}
else
else
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llviewerregion.cpp
+
30
−
0
View file @
a4759de1
...
@@ -541,6 +541,9 @@ LLViewerRegion::~LLViewerRegion()
...
@@ -541,6 +541,9 @@ LLViewerRegion::~LLViewerRegion()
delete
mImpl
;
delete
mImpl
;
mImpl
=
NULL
;
mImpl
=
NULL
;
for
(
LLPointer
<
LLViewerTexture
>
tile
:
mWorldMapTiles
)
tile
->
setBoostLevel
(
LLViewerTexture
::
BOOST_NONE
);
}
}
LLEventPump
&
LLViewerRegion
::
getCapAPI
()
const
LLEventPump
&
LLViewerRegion
::
getCapAPI
()
const
...
@@ -3418,6 +3421,33 @@ void LLViewerRegion::setGodnames()
...
@@ -3418,6 +3421,33 @@ void LLViewerRegion::setGodnames()
}
}
}
}
const
LLViewerRegion
::
tex_matrix_t
&
LLViewerRegion
::
getWorldMapTiles
()
const
{
if
(
mWorldMapTiles
.
empty
())
{
U32
gridX
,
gridY
;
grid_from_region_handle
(
mHandle
,
&
gridX
,
&
gridY
);
U32
totalX
(
getWidth
()
/
REGION_WIDTH_U32
);
if
(
!
totalX
)
++
totalX
;
// If this region is too small, still get an image.
// *TODO: Non-square regions?
//U32 totalY(getLength()/REGION_WIDTH_U32);
//if (!totalY) ++totalY; // If this region is too small, still get an image.
const
U32
totalY
(
totalX
);
mWorldMapTiles
.
reserve
(
totalX
*
totalY
);
for
(
U32
x
=
0
;
x
!=
totalX
;
++
x
)
for
(
U32
y
=
0
;
y
!=
totalY
;
++
y
)
{
const
std
::
string
map_url
=
getMapServerURL
().
append
(
llformat
(
"map-1-%d-%d-objects.jpg"
,
gridX
+
x
,
gridY
+
y
));
LL_WARNS
()
<<
"WOO! "
<<
map_url
<<
LL_ENDL
;
LLPointer
<
LLViewerTexture
>
tex
(
LLViewerTextureManager
::
getFetchedTextureFromUrl
(
map_url
,
FTT_MAP_TILE
,
TRUE
,
LLViewerTexture
::
BOOST_NONE
,
LLViewerTexture
::
LOD_TEXTURE
));
mWorldMapTiles
.
push_back
(
tex
);
tex
->
setBoostLevel
(
LLViewerTexture
::
BOOST_MAP
);
}
}
return
mWorldMapTiles
;
}
LLViewerTexture
*
LLViewerRegion
::
getMapImage
()
LLViewerTexture
*
LLViewerRegion
::
getMapImage
()
{
{
if
(
mMapImage
.
isNull
())
if
(
mMapImage
.
isNull
())
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llviewerregion.h
+
6
−
2
View file @
a4759de1
...
@@ -411,7 +411,10 @@ public:
...
@@ -411,7 +411,10 @@ public:
/// "God names" surname and full account names map
/// "God names" surname and full account names map
std
::
set
<
std
::
string
>
getGods
()
const
{
return
mGodNames
;
};
std
::
set
<
std
::
string
>
getGods
()
const
{
return
mGodNames
;
};
//@}
//@}
typedef
std
::
vector
<
LLPointer
<
LLViewerTexture
>
>
tex_matrix_t
;
const
tex_matrix_t
&
getWorldMapTiles
()
const
;
LLViewerTexture
*
getMapImage
();
// <alchemy/>
LLViewerTexture
*
getMapImage
();
// <alchemy/>
private
:
private
:
...
@@ -576,8 +579,9 @@ private:
...
@@ -576,8 +579,9 @@ private:
LLFrameTimer
mMaterialsCapThrottleTimer
;
LLFrameTimer
mMaterialsCapThrottleTimer
;
LLFrameTimer
mRenderInfoRequestTimer
;
LLFrameTimer
mRenderInfoRequestTimer
;
mutable
tex_matrix_t
mWorldMapTiles
;
LLPointer
<
LLViewerTexture
>
mMapImage
;
// <alchemy/>
LLPointer
<
LLViewerTexture
>
mMapImage
;
// <alchemy/>
std
::
set
<
std
::
string
>
mGodNames
;
std
::
set
<
std
::
string
>
mGodNames
;
};
};
inline
BOOL
LLViewerRegion
::
getRegionProtocol
(
U64
protocol
)
const
inline
BOOL
LLViewerRegion
::
getRegionProtocol
(
U64
protocol
)
const
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment