diff options
Renamed and rearranged AvatarFactoryModule to eliminate redundant lookups of scene presence by client ID.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs index 7b2f14e..931d52f 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/Tests/AvatarFactoryModuleTests.cs | |||
@@ -55,15 +55,13 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
55 | AvatarFactoryModule afm = new AvatarFactoryModule(); | 55 | AvatarFactoryModule afm = new AvatarFactoryModule(); |
56 | TestScene scene = SceneHelpers.SetupScene(); | 56 | TestScene scene = SceneHelpers.SetupScene(); |
57 | SceneHelpers.SetupSceneModules(scene, afm); | 57 | SceneHelpers.SetupSceneModules(scene, afm); |
58 | IClientAPI tc = SceneHelpers.AddScenePresence(scene, userId).ControllingClient; | 58 | ScenePresence sp = SceneHelpers.AddScenePresence(scene, userId); |
59 | 59 | ||
60 | byte[] visualParams = new byte[AvatarAppearance.VISUALPARAM_COUNT]; | 60 | byte[] visualParams = new byte[AvatarAppearance.VISUALPARAM_COUNT]; |
61 | for (byte i = 0; i < visualParams.Length; i++) | 61 | for (byte i = 0; i < visualParams.Length; i++) |
62 | visualParams[i] = i; | 62 | visualParams[i] = i; |
63 | 63 | ||
64 | afm.SetAppearanceFromClient(tc, new Primitive.TextureEntry(TestHelpers.ParseTail(0x10)), visualParams); | 64 | afm.SetAppearance(sp, new Primitive.TextureEntry(TestHelpers.ParseTail(0x10)), visualParams); |
65 | |||
66 | ScenePresence sp = scene.GetScenePresence(userId); | ||
67 | 65 | ||
68 | // TODO: Check baked texture | 66 | // TODO: Check baked texture |
69 | Assert.AreEqual(visualParams, sp.Appearance.VisualParams); | 67 | Assert.AreEqual(visualParams, sp.Appearance.VisualParams); |
@@ -84,8 +82,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
84 | 82 | ||
85 | AvatarFactoryModule afm = new AvatarFactoryModule(); | 83 | AvatarFactoryModule afm = new AvatarFactoryModule(); |
86 | TestScene scene = SceneHelpers.SetupScene(assetCache); | 84 | TestScene scene = SceneHelpers.SetupScene(assetCache); |
87 | SceneHelpers.SetupSceneModules(scene, afm); | 85 | SceneHelpers.SetupSceneModules(scene, afm); |
88 | IClientAPI tc = SceneHelpers.AddScenePresence(scene, userId).ControllingClient; | 86 | ScenePresence sp = SceneHelpers.AddScenePresence(scene, userId); |
89 | 87 | ||
90 | // TODO: Use the actual BunchOfCaps functionality once we slot in the CapabilitiesModules | 88 | // TODO: Use the actual BunchOfCaps functionality once we slot in the CapabilitiesModules |
91 | AssetBase uploadedAsset; | 89 | AssetBase uploadedAsset; |
@@ -104,7 +102,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
104 | Primitive.TextureEntryFace eyesFace = bakedTextureEntry.CreateFace(eyesFaceIndex); | 102 | Primitive.TextureEntryFace eyesFace = bakedTextureEntry.CreateFace(eyesFaceIndex); |
105 | eyesFace.TextureID = eyesTextureId; | 103 | eyesFace.TextureID = eyesTextureId; |
106 | 104 | ||
107 | afm.SetAppearanceFromClient(tc, bakedTextureEntry, visualParams); | 105 | afm.SetAppearance(sp, bakedTextureEntry, visualParams); |
108 | afm.SaveBakedTextures(userId); | 106 | afm.SaveBakedTextures(userId); |
109 | // Dictionary<BakeType, Primitive.TextureEntryFace> bakedTextures = afm.GetBakedTextureFaces(userId); | 107 | // Dictionary<BakeType, Primitive.TextureEntryFace> bakedTextures = afm.GetBakedTextureFaces(userId); |
110 | 108 | ||