diff options
author | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
commit | cd17687f01420952712a500107e0f93e7ab8d5f8 (patch) | |
tree | ce48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/newview/llpreviewanim.cpp | |
parent | Second Life viewer sources 1.19.0.5 (diff) | |
download | meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2 meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz |
Second Life viewer sources 1.19.1.0
Diffstat (limited to 'linden/indra/newview/llpreviewanim.cpp')
-rw-r--r-- | linden/indra/newview/llpreviewanim.cpp | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/linden/indra/newview/llpreviewanim.cpp b/linden/indra/newview/llpreviewanim.cpp index 58478c8..ff8b3b5 100644 --- a/linden/indra/newview/llpreviewanim.cpp +++ b/linden/indra/newview/llpreviewanim.cpp | |||
@@ -96,8 +96,8 @@ LLPreviewAnim::LLPreviewAnim(const std::string& name, const LLRect& rect, const | |||
96 | // static | 96 | // static |
97 | void LLPreviewAnim::endAnimCallback( void *userdata ) | 97 | void LLPreviewAnim::endAnimCallback( void *userdata ) |
98 | { | 98 | { |
99 | LLViewHandle* handlep = ((LLViewHandle*)userdata); | 99 | LLHandle<LLFloater>* handlep = ((LLHandle<LLFloater>*)userdata); |
100 | LLFloater* self = getFloaterByHandle(*handlep); | 100 | LLFloater* self = handlep->get(); |
101 | delete handlep; // done with the handle | 101 | delete handlep; // done with the handle |
102 | if (self) | 102 | if (self) |
103 | { | 103 | { |
@@ -132,7 +132,7 @@ void LLPreviewAnim::playAnim( void *userdata ) | |||
132 | 132 | ||
133 | if (motion) | 133 | if (motion) |
134 | { | 134 | { |
135 | motion->setDeactivateCallback(&endAnimCallback, (void *)(new LLViewHandle(self->getHandle()))); | 135 | motion->setDeactivateCallback(&endAnimCallback, (void *)(new LLHandle<LLFloater>(self->getHandle()))); |
136 | } | 136 | } |
137 | } | 137 | } |
138 | else | 138 | else |
@@ -169,7 +169,7 @@ void LLPreviewAnim::auditionAnim( void *userdata ) | |||
169 | 169 | ||
170 | if (motion) | 170 | if (motion) |
171 | { | 171 | { |
172 | motion->setDeactivateCallback(&endAnimCallback, (void *)(new LLViewHandle(self->getHandle()))); | 172 | motion->setDeactivateCallback(&endAnimCallback, (void *)(new LLHandle<LLFloater>(self->getHandle()))); |
173 | } | 173 | } |
174 | } | 174 | } |
175 | else | 175 | else |
@@ -180,33 +180,6 @@ void LLPreviewAnim::auditionAnim( void *userdata ) | |||
180 | } | 180 | } |
181 | } | 181 | } |
182 | 182 | ||
183 | void LLPreviewAnim::saveAnim( void *userdata ) | ||
184 | { | ||
185 | LLPreviewAnim* self = (LLPreviewAnim*) userdata; | ||
186 | const LLInventoryItem *item = self->getItem(); | ||
187 | |||
188 | if(item) | ||
189 | { | ||
190 | LLKeyframeMotion* motionp = (LLKeyframeMotion*)gAgent.getAvatarObject()->createMotion( item->getAssetUUID() ); | ||
191 | if (motionp && motionp->isLoaded()) | ||
192 | { | ||
193 | LLFilePicker& picker = LLFilePicker::instance(); | ||
194 | LLString proposed_name = item->getName() + LLString(".xaf"); | ||
195 | if (picker.getSaveFile(LLFilePicker::FFSAVE_ANIM, proposed_name.c_str())) | ||
196 | { | ||
197 | apr_file_t* fp = ll_apr_file_open(picker.getFirstFile(), LL_APR_W); | ||
198 | if (!fp) | ||
199 | { | ||
200 | llwarns << "Unable to open file " << picker.getFirstFile() << llendl; | ||
201 | return; | ||
202 | } | ||
203 | motionp->writeCAL3D(fp); | ||
204 | apr_file_close(fp); | ||
205 | } | ||
206 | } | ||
207 | } | ||
208 | } | ||
209 | |||
210 | void LLPreviewAnim::onClose(bool app_quitting) | 183 | void LLPreviewAnim::onClose(bool app_quitting) |
211 | { | 184 | { |
212 | const LLInventoryItem *item = getItem(); | 185 | const LLInventoryItem *item = getItem(); |