LIBOMV-505 Merge in jradford-texturepipeline branch
This changes the way texture requests are handled, the AssetManager RequestImage method signatures have been changed and are now expecting the callback with the request. Progressive requests for textures are supported for rendering viewers Tuning parameters have been moved to Settings git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2699 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
@@ -24,7 +24,6 @@ namespace groupmanager
|
||||
GroupManager.GroupMembersCallback GroupMembersCallback;
|
||||
GroupManager.GroupTitlesCallback GroupTitlesCallback;
|
||||
AvatarManager.AvatarNamesCallback AvatarNamesCallback;
|
||||
AssetManager.ImageReceivedCallback ImageReceivedCallback;
|
||||
|
||||
public frmGroupInfo(Group group, GridClient client)
|
||||
{
|
||||
@@ -40,13 +39,11 @@ namespace groupmanager
|
||||
GroupMembersCallback = new GroupManager.GroupMembersCallback(GroupMembersHandler);
|
||||
GroupTitlesCallback = new GroupManager.GroupTitlesCallback(GroupTitlesHandler);
|
||||
AvatarNamesCallback = new AvatarManager.AvatarNamesCallback(AvatarNamesHandler);
|
||||
ImageReceivedCallback = new AssetManager.ImageReceivedCallback(Assets_OnImageReceived);
|
||||
|
||||
Group = group;
|
||||
Client = client;
|
||||
|
||||
// Register the callbacks for this form
|
||||
Client.Assets.OnImageReceived += ImageReceivedCallback;
|
||||
Client.Groups.OnGroupProfile += GroupProfileCallback;
|
||||
Client.Groups.OnGroupMembers += GroupMembersCallback;
|
||||
Client.Groups.OnGroupTitles += GroupTitlesCallback;
|
||||
@@ -61,7 +58,6 @@ namespace groupmanager
|
||||
~frmGroupInfo()
|
||||
{
|
||||
// Unregister the callbacks for this form
|
||||
Client.Assets.OnImageReceived -= ImageReceivedCallback;
|
||||
Client.Groups.OnGroupProfile -= GroupProfileCallback;
|
||||
Client.Groups.OnGroupMembers -= GroupMembersCallback;
|
||||
Client.Groups.OnGroupTitles -= GroupTitlesCallback;
|
||||
@@ -73,24 +69,23 @@ namespace groupmanager
|
||||
Profile = profile;
|
||||
|
||||
if (Group.InsigniaID != UUID.Zero)
|
||||
Client.Assets.RequestImage(Group.InsigniaID, ImageType.Normal, 113000.0f, 0, 0);
|
||||
Client.Assets.RequestImage(Group.InsigniaID, ImageType.Normal,
|
||||
delegate(TextureRequestState state, AssetTexture assetTexture)
|
||||
{
|
||||
ManagedImage imgData;
|
||||
Image bitmap;
|
||||
|
||||
if (state == TextureRequestState.Finished)
|
||||
{
|
||||
OpenJPEG.DecodeToImage(assetTexture.AssetData, out imgData, out bitmap);
|
||||
picInsignia.Image = bitmap;
|
||||
}
|
||||
});
|
||||
|
||||
if (this.InvokeRequired)
|
||||
this.BeginInvoke(new MethodInvoker(UpdateProfile));
|
||||
}
|
||||
|
||||
void Assets_OnImageReceived(ImageDownload image, AssetTexture assetTexture)
|
||||
{
|
||||
ManagedImage imgData;
|
||||
Image bitmap;
|
||||
|
||||
if (image.Success)
|
||||
{
|
||||
OpenJPEG.DecodeToImage(image.AssetData, out imgData, out bitmap);
|
||||
picInsignia.Image = bitmap;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateProfile()
|
||||
{
|
||||
lblGroupName.Text = Profile.Name;
|
||||
|
||||
Reference in New Issue
Block a user