1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implement test case class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <avkon.rsg> |
|
20 #include <bctestdomm3g.rsg> |
|
21 #include <eikenv.h> |
|
22 #include <eikappui.h> |
|
23 #include <cm3gloader.h> |
|
24 #include <rm3gobject.h> |
|
25 #include <rm3gkeyframesequence.h> |
|
26 #include <rm3glight.h> |
|
27 #include <rm3gimage.h> |
|
28 #include <rm3gbackground.h> |
|
29 #include <rm3gappearance.h> |
|
30 #include <rm3gcompositingmode.h> |
|
31 #include <rm3gfog.h> |
|
32 #include <rm3gmaterial.h> |
|
33 #include <rm3gpolygonmode.h> |
|
34 #include <rm3gtexture.h> |
|
35 #include <cm3grenderingcontext.h> |
|
36 #include <m3genv.h> |
|
37 #include <rm3gvertexbuffer.h> |
|
38 #include <rm3gvertexarray.h> |
|
39 #include <rm3gtrianglestriparray.h> |
|
40 #include <rm3gindexbuffer.h> |
|
41 #include <rm3ganimationcontroller.h> |
|
42 #include <rm3ganimationtrack.h> |
|
43 #include <rm3gworld.h> |
|
44 #include <gdi.h> |
|
45 #include <rm3gcamera.h> |
|
46 |
|
47 #include "bctestdomm3gcase.h" |
|
48 #include "bctestdomm3gcontainer.h" |
|
49 #include "bctestdomm3g.hrh" |
|
50 |
|
51 // ======== MEMBER FUNCTIONS ======== |
|
52 |
|
53 // --------------------------------------------------------------------------- |
|
54 // Symbian 2nd static Constructor |
|
55 // --------------------------------------------------------------------------- |
|
56 // |
|
57 CBCTestDomM3gCase* CBCTestDomM3gCase::NewL( |
|
58 CBCTestDomM3gContainer* aContainer ) |
|
59 { |
|
60 CBCTestDomM3gCase* self = new( ELeave ) CBCTestDomM3gCase( aContainer ); |
|
61 CleanupStack::PushL( self ); |
|
62 self->ConstructL(); |
|
63 CleanupStack::Pop( self ); |
|
64 return self; |
|
65 } |
|
66 |
|
67 // --------------------------------------------------------------------------- |
|
68 // C++ default constructor |
|
69 // --------------------------------------------------------------------------- |
|
70 // |
|
71 CBCTestDomM3gCase::CBCTestDomM3gCase( |
|
72 CBCTestDomM3gContainer* aContainer ) |
|
73 : iContainer( aContainer ) |
|
74 { |
|
75 } |
|
76 |
|
77 // --------------------------------------------------------------------------- |
|
78 // Destructor |
|
79 // --------------------------------------------------------------------------- |
|
80 // |
|
81 CBCTestDomM3gCase::~CBCTestDomM3gCase() |
|
82 { |
|
83 M3GEnv::Release(); //Release env object. Only release one time, or panic. |
|
84 } |
|
85 |
|
86 // --------------------------------------------------------------------------- |
|
87 // Symbian 2nd Constructor |
|
88 // --------------------------------------------------------------------------- |
|
89 // |
|
90 void CBCTestDomM3gCase::ConstructL() |
|
91 { |
|
92 BuildScriptL(); |
|
93 } |
|
94 |
|
95 // --------------------------------------------------------------------------- |
|
96 // CBCTestDomM3gCase::BuildScriptL |
|
97 // --------------------------------------------------------------------------- |
|
98 // |
|
99 void CBCTestDomM3gCase::BuildScriptL() |
|
100 { |
|
101 const TInt scripts[] = |
|
102 { |
|
103 //outline1 |
|
104 DELAY( 1 ),// delay between commands is 1*0.1 seconds = 0.1 seconds |
|
105 REP( LeftCBA, 3 ), |
|
106 |
|
107 //outline2 |
|
108 REP( LeftCBA, 2 ), |
|
109 REP( Down, 1 ), |
|
110 LeftCBA, |
|
111 |
|
112 //outline3 |
|
113 REP( LeftCBA, 2 ), |
|
114 REP( Down, 2 ), |
|
115 LeftCBA, |
|
116 |
|
117 //outline4 |
|
118 REP( LeftCBA, 2 ), |
|
119 REP( Down, 3 ), |
|
120 LeftCBA, |
|
121 |
|
122 //outline5 |
|
123 REP( LeftCBA, 2 ), |
|
124 REP( Down, 4 ), |
|
125 LeftCBA, |
|
126 |
|
127 //outline6 |
|
128 REP( LeftCBA, 2 ), |
|
129 REP( Down, 5 ), |
|
130 LeftCBA, |
|
131 |
|
132 //outline7 |
|
133 REP( LeftCBA, 2 ), |
|
134 REP( Down, 6 ), |
|
135 LeftCBA, |
|
136 |
|
137 //outline8 |
|
138 REP( LeftCBA, 2 ), |
|
139 REP( Down, 7 ), |
|
140 LeftCBA, |
|
141 |
|
142 //outline9 |
|
143 REP( LeftCBA, 2 ), |
|
144 REP( Down, 8 ), |
|
145 LeftCBA, |
|
146 |
|
147 //outline10 |
|
148 REP( LeftCBA, 2 ), |
|
149 REP( Down, 9 ), |
|
150 LeftCBA, |
|
151 |
|
152 //outline11 |
|
153 REP( LeftCBA, 2 ), |
|
154 REP( Down, 10 ), |
|
155 LeftCBA, |
|
156 |
|
157 //outline12 |
|
158 REP( LeftCBA, 2 ), |
|
159 REP( Down, 11 ), |
|
160 LeftCBA |
|
161 |
|
162 }; |
|
163 AddTestScriptL( scripts, sizeof( scripts ) / sizeof( TInt ) ); |
|
164 } |
|
165 |
|
166 // --------------------------------------------------------------------------- |
|
167 // CBCTestDomM3gCase::RunL |
|
168 // --------------------------------------------------------------------------- |
|
169 // |
|
170 void CBCTestDomM3gCase::RunL( TInt aCmd ) |
|
171 { |
|
172 if ( ( aCmd < EBCTestCmdOutline01 ) || ( aCmd > EBCTestCmdOutline12 ) ) |
|
173 { |
|
174 return; |
|
175 } |
|
176 switch ( aCmd ) |
|
177 { |
|
178 case EBCTestCmdOutline01: |
|
179 TestCM3gLoaderL(); |
|
180 TestCM3GRenderingContextL(); |
|
181 break; |
|
182 case EBCTestCmdOutline02: |
|
183 TestRM3gObjectL(); |
|
184 break; |
|
185 case EBCTestCmdOutline03: |
|
186 TestRM3GBackgroundL(); |
|
187 break; |
|
188 case EBCTestCmdOutline04: |
|
189 TestRM3GAppearanceL(); |
|
190 break; |
|
191 case EBCTestCmdOutline05: |
|
192 TestRM3GCompositingModeL(); |
|
193 break; |
|
194 case EBCTestCmdOutline06: |
|
195 TestRM3GFogL(); |
|
196 break; |
|
197 case EBCTestCmdOutline07: |
|
198 TestRM3GMaterialL(); |
|
199 break; |
|
200 case EBCTestCmdOutline08: |
|
201 TestRM3GPolygonModeL(); |
|
202 break; |
|
203 case EBCTestCmdOutline09: |
|
204 TestRM3GTextureL(); |
|
205 TestRM3GIndexBufferL(); |
|
206 break; |
|
207 case EBCTestCmdOutline10: |
|
208 TestRM3GKeyframeSequenceL(); |
|
209 TestRM3GTriangleStripArrayL(); |
|
210 break; |
|
211 case EBCTestCmdOutline11: |
|
212 TestRM3GVertexBufferL(); |
|
213 TestRM3GVertexArrayL(); |
|
214 break; |
|
215 case EBCTestCmdOutline12: |
|
216 TestRM3GAnimationControllerL(); |
|
217 TestRM3GImageL(); |
|
218 break; |
|
219 default: |
|
220 break; |
|
221 } |
|
222 } |
|
223 |
|
224 // --------------------------------------------------------------------------- |
|
225 // CBCTestDomM3gCase::TestCM3gLoaderL |
|
226 // --------------------------------------------------------------------------- |
|
227 // |
|
228 void CBCTestDomM3gCase::TestCM3gLoaderL() |
|
229 { |
|
230 CM3GLoader* m3gLoader = CM3GLoader::NewLC(); |
|
231 _LIT( KCM3gLoaderNewLC, "CM3GLoader::NewLC()" ); |
|
232 AssertTrueL( ETrue, KCM3gLoaderNewLC ); |
|
233 |
|
234 _LIT( KFileName, "\\BCTestLog\\bctestdomimage.bmp" ); |
|
235 RM3GImage imageReturn = m3gLoader->LoadImageL( KFileName ); |
|
236 CleanupClosePushL( imageReturn ); |
|
237 _LIT( KCM3gLoadLoadImageL, "CM3GLoader::LoadImageL()" ); |
|
238 AssertTrueL( ETrue, KCM3gLoadLoadImageL ); |
|
239 |
|
240 RArray<RM3GObject> objects; |
|
241 CleanupClosePushL( objects ); |
|
242 m3gLoader->DecodeL( KFileName, objects ); |
|
243 _LIT( KCM3gLoadDecodeL, "CM3GLoader::DecodeL()" ); |
|
244 AssertTrueL( ETrue, KCM3gLoadDecodeL ); |
|
245 |
|
246 CleanupStack::PopAndDestroy( 3 );//m3gLoader, imageReturn, objects |
|
247 } |
|
248 |
|
249 // --------------------------------------------------------------------------- |
|
250 // CBCTestDomM3gCase::TestCM3GRenderingContextL |
|
251 // --------------------------------------------------------------------------- |
|
252 // |
|
253 void CBCTestDomM3gCase::TestCM3GRenderingContextL() |
|
254 { |
|
255 CM3GRenderingContext* m3gContext = CM3GRenderingContext::NewL(); |
|
256 CleanupStack::PushL( m3gContext ); |
|
257 _LIT( KCM3GRenderingContext, "CM3GRenderingContext::NewL()" ); |
|
258 AssertTrueL( ETrue, KCM3GRenderingContext ); |
|
259 |
|
260 TM3GMatrix m3gNodeMatrix; |
|
261 RM3GLight m3gLight; |
|
262 CleanupClosePushL( m3gLight ); |
|
263 m3gLight.OpenL(); |
|
264 |
|
265 RM3GWorld m3gWorld; |
|
266 CleanupClosePushL( m3gWorld ); |
|
267 m3gWorld.OpenL(); |
|
268 |
|
269 m3gContext->RenderNode( m3gWorld, m3gNodeMatrix ); |
|
270 _LIT( KCM3GRCRenderNode, "CM3GRenderingContext::RenderNode()" ); |
|
271 AssertTrueL( ETrue, KCM3GRCRenderNode ); |
|
272 |
|
273 m3gContext->RenderWorld( m3gWorld ); |
|
274 _LIT( KCM3GRCRenderWorld, "CM3GRenderingContext::RenderWorld()" ); |
|
275 AssertTrueL( ETrue, KCM3GRCRenderWorld ); |
|
276 |
|
277 TInt index = 0; |
|
278 m3gContext->SetLight( index, m3gLight, m3gNodeMatrix ); |
|
279 _LIT( KCM3GRCSetLight, "CM3GRenderingContext::SetLight()" ); |
|
280 AssertTrueL( ETrue, KCM3GRCSetLight ); |
|
281 |
|
282 RM3GCamera m3gCamera; |
|
283 CleanupClosePushL( m3gCamera ); |
|
284 m3gCamera.OpenL(); |
|
285 |
|
286 m3gContext->SetCamera( m3gCamera, m3gNodeMatrix ); |
|
287 _LIT( KCM3GRCSetCamera, "CM3GRenderingContext::SetCamera()" ); |
|
288 AssertTrueL( ETrue, KCM3GRCSetCamera ); |
|
289 |
|
290 TInt mask = 0; |
|
291 m3gContext->SetRenderHints( mask ); |
|
292 _LIT( KCM3GRCSetRenderHints, "CM3GRenderingContext::SetRenderHints()" ); |
|
293 AssertTrueL( ETrue, KCM3GRCSetRenderHints ); |
|
294 |
|
295 RM3GImage m3gImage; |
|
296 CleanupClosePushL( m3gImage ); |
|
297 TInt imageWidth = 16; |
|
298 TInt imageHeight = 16; |
|
299 TInt flag = 0; |
|
300 m3gImage.OpenL( RM3GImage::EAlpha, |
|
301 imageWidth, |
|
302 imageHeight, |
|
303 flag ); |
|
304 |
|
305 m3gContext->BindImageTarget( m3gImage ); |
|
306 _LIT( KCM3GRCBindImageTarget, "CM3GRenderingContext::BindImageTarget()" ); |
|
307 AssertTrueL( ETrue, KCM3GRCBindImageTarget ); |
|
308 |
|
309 CFbsBitmap* bitmap = new ( ELeave ) CFbsBitmap; |
|
310 CleanupStack::PushL( bitmap ); |
|
311 User::LeaveIfError( bitmap->Create( TSize( imageWidth, |
|
312 imageHeight ), |
|
313 EColor64K ) ); |
|
314 |
|
315 m3gContext->BindBitmapTarget( bitmap ); |
|
316 _LIT( KCM3GRCBindBitmapTarget, |
|
317 "CM3GRenderingContext::BindBitmapTarget()" ); |
|
318 AssertTrueL( ETrue, KCM3GRCBindBitmapTarget ); |
|
319 |
|
320 RM3GLight m3gLightAdd; |
|
321 TM3GMatrix lightMatrix; |
|
322 lightMatrix.Unity(); |
|
323 CleanupClosePushL( m3gLightAdd ); |
|
324 m3gLightAdd.OpenL(); |
|
325 |
|
326 lightMatrix.Unity(); |
|
327 lightMatrix.iClassified = 1; |
|
328 lightMatrix.iComplete = 1; |
|
329 |
|
330 m3gContext->AddLight( m3gLightAdd, lightMatrix ); |
|
331 _LIT( KCM3GRCAddLight, |
|
332 "CM3GRenderingContext::AddLight()" ); |
|
333 AssertTrueL( ETrue, KCM3GRCAddLight ); |
|
334 |
|
335 TUint param = 4029; |
|
336 TUint stride = 10; |
|
337 TUint userContext = 10; |
|
338 m3gContext->BindMemoryTarget( ¶m, |
|
339 imageWidth, |
|
340 imageHeight, |
|
341 CM3GRenderingContext::EL8, |
|
342 stride, |
|
343 userContext ); |
|
344 _LIT( KCM3GRCBindMemoryTarget, |
|
345 "CM3GRenderingContext::BindMemoryTarget()" ); |
|
346 AssertTrueL( ETrue, KCM3GRCBindMemoryTarget ); |
|
347 |
|
348 RWindow* window = static_cast<RWindow*> ( iContainer->DrawableWindow() ); |
|
349 CleanupClosePushL( *window ); |
|
350 m3gContext->BindWindowTarget( *window ); |
|
351 _LIT( KCM3GRCBindWindowTarget, |
|
352 "CM3GRenderingContext::BindWindowTarget()" ); |
|
353 AssertTrueL( ETrue, KCM3GRCBindWindowTarget ); |
|
354 CleanupStack::Pop( window ); |
|
355 |
|
356 RM3GVertexBuffer m3gVertexBuffer; |
|
357 CleanupClosePushL( m3gVertexBuffer ); |
|
358 m3gVertexBuffer.OpenL(); |
|
359 |
|
360 RM3GIndexBuffer m3gIndexBuffer; |
|
361 CleanupClosePushL( m3gIndexBuffer ); |
|
362 TInt stripLengths[] = { 4, 5, 6, 7 }; |
|
363 TInt stripLengthCount = 4; |
|
364 TInt firstIndex = 0; |
|
365 m3gIndexBuffer.OpenL( firstIndex, stripLengths, stripLengthCount ); |
|
366 |
|
367 RM3GAppearance m3gAppearance; |
|
368 CleanupClosePushL( m3gAppearance ); |
|
369 m3gAppearance.OpenL(); |
|
370 TM3GMatrix m3gMatrix; |
|
371 TReal32 alphaFactor = 1.0; |
|
372 TInt scope = 2; |
|
373 m3gContext->Render( m3gVertexBuffer, |
|
374 m3gIndexBuffer, |
|
375 m3gAppearance, |
|
376 m3gMatrix, |
|
377 alphaFactor, |
|
378 scope ); |
|
379 _LIT( KCM3GRCRender, "CM3GRenderingContext::Render()" ); |
|
380 AssertTrueL( ETrue, KCM3GRCRender ); |
|
381 |
|
382 //m3gVertexBuffer, m3gIndexBuffer, m3gAppearance; |
|
383 CleanupStack::PopAndDestroy( 3 ); |
|
384 |
|
385 RM3GBackground m3gBackgroud; |
|
386 CleanupClosePushL( m3gBackgroud ); |
|
387 m3gBackgroud.OpenL(); |
|
388 m3gContext->Clear( m3gBackgroud ); |
|
389 _LIT( KCM3GRCClear, "CM3GRenderingContext::Clear()" ); |
|
390 AssertTrueL( ETrue, KCM3GRCClear ); |
|
391 |
|
392 m3gContext->ReleaseTarget(); |
|
393 _LIT( KCM3GRCReleaseTarget, "CM3GRenderingContext::ReleaseTarget()" ); |
|
394 AssertTrueL( ETrue, KCM3GRCReleaseTarget ); |
|
395 |
|
396 m3gContext->ResetLights(); |
|
397 _LIT( KCM3GRCResetLights, "CM3GRenderingContext::ResetLights()" ); |
|
398 AssertTrueL( ETrue, KCM3GRCResetLights ); |
|
399 |
|
400 TReal32 near = 1.0; |
|
401 TReal32 far = 10.0; |
|
402 m3gContext->SetDepthRange( near, far ); |
|
403 _LIT( KCM3GRCSetDepthRange, "CM3GRenderingContext::SetDepthRange()" ); |
|
404 AssertTrueL( ETrue, KCM3GRCSetDepthRange ); |
|
405 |
|
406 TInt x = 0; |
|
407 TInt y = 0; |
|
408 TInt width = 10; |
|
409 TInt height = 10; |
|
410 m3gContext->SetClipRect( x, y, width, height ); |
|
411 _LIT( KCM3GRCSetClipRect, "CM3GRenderingContext::SetClipRect()" ); |
|
412 AssertTrueL( ETrue, KCM3GRCSetClipRect ); |
|
413 |
|
414 m3gContext->SetViewport( x, y ,width, height ); |
|
415 _LIT( KCM3GRCSetViewport, "CM3GRenderingContext::SetViewport()" ); |
|
416 AssertTrueL( ETrue, KCM3GRCSetViewport ); |
|
417 |
|
418 //m3gContext, m3gBackgroud, m3gWorld; |
|
419 //m3gLight, m3gCamera, m3gImage, bitmap |
|
420 //m3gLightAdd |
|
421 CleanupStack::PopAndDestroy( 8 ); |
|
422 |
|
423 } |
|
424 |
|
425 // --------------------------------------------------------------------------- |
|
426 // CBCTestDomM3gCase::TestRM3gObjectL |
|
427 // --------------------------------------------------------------------------- |
|
428 // |
|
429 void CBCTestDomM3gCase::TestRM3gObjectL() |
|
430 { |
|
431 RM3GObject rM3gObject; |
|
432 CleanupClosePushL( rM3gObject ); |
|
433 _LIT( KRM3GObject, "RM3GObject::RM3GObject()" ); |
|
434 AssertTrueL( ETrue, KRM3GObject ); |
|
435 |
|
436 CleanupStack::PopAndDestroy();// rM3gObject |
|
437 |
|
438 //RM3GLight derived from RM3GObject |
|
439 RM3GLight m3gLight; |
|
440 CleanupClosePushL( m3gLight ); |
|
441 m3gLight.OpenL(); |
|
442 |
|
443 m3gLight.Class(); |
|
444 _LIT( KRM3GObjectClass, "RM3GObject::Class()" ); |
|
445 AssertTrueL( ETrue, KRM3GObjectClass ); |
|
446 |
|
447 RArray<RM3GObject> objects; |
|
448 objects.Append( m3gLight ); |
|
449 CleanupClosePushL( objects ); |
|
450 m3gLight.DuplicateL( objects ); |
|
451 _LIT( KRM3GObjectDuplicateL, "RM3GObject::DuplicateL()" ); |
|
452 AssertTrueL( ETrue, KRM3GObjectDuplicateL ); |
|
453 |
|
454 m3gLight.GetReferencesL( objects ); |
|
455 _LIT( KRM3GObjectGetReferencesL, "RM3GObject::GetReferencesL()" ); |
|
456 AssertTrueL( ETrue, KRM3GObjectGetReferencesL ); |
|
457 |
|
458 TInt currentId = m3gLight.UserId(); |
|
459 _LIT( KRM3GObjectUserId, "RM3GObject::UserId()" ); |
|
460 AssertTrueL( ETrue, KRM3GObjectUserId ); |
|
461 |
|
462 m3gLight.SetUserId( currentId ); |
|
463 _LIT( KRM3GObjectSetUserId, "RM3GObject::SetUserId()" ); |
|
464 AssertTrueL( ETrue, KRM3GObjectSetUserId ); |
|
465 |
|
466 RM3GObject returnObject = m3gLight.Find( currentId ); |
|
467 CleanupClosePushL( returnObject ); |
|
468 _LIT( KRM3GObjectFind, "RM3GObject::Find()" ); |
|
469 AssertTrueL( ETrue, KRM3GObjectFind ); |
|
470 |
|
471 RM3GAnimationTrack m3gAnimationT; |
|
472 CleanupClosePushL( m3gAnimationT ); |
|
473 RM3GKeyframeSequence m3gKeyframeSequence; |
|
474 CleanupClosePushL( m3gKeyframeSequence ); |
|
475 const TInt keyframeCount = 1; |
|
476 const TInt componentCount = 1; |
|
477 m3gKeyframeSequence.OpenL( keyframeCount, |
|
478 componentCount, |
|
479 RM3GKeyframeSequence::ELinear ); |
|
480 m3gAnimationT.OpenL( m3gKeyframeSequence, RM3GAnimationTrack::EDensity ); |
|
481 m3gLight.AddAnimationTrack( m3gAnimationT ); |
|
482 _LIT( KRM3GObjectAddAnimationTrack, |
|
483 "RM3GObject::AddAnimationTrack()" ); |
|
484 AssertTrueL( ETrue, KRM3GObjectAddAnimationTrack ); |
|
485 |
|
486 TInt animateTime = 20; |
|
487 m3gLight.Animate( animateTime ); |
|
488 _LIT( KRM3GObjectAnimate, "RM3GObject::Animate()" ); |
|
489 AssertTrueL( ETrue, KRM3GObjectAnimate ); |
|
490 |
|
491 m3gLight.AnimationTrack( 1 ); |
|
492 _LIT( KRM3GObjectAnimationTrack, |
|
493 "RM3GObject::AnimationTrack()" ); |
|
494 AssertTrueL( ETrue, KRM3GObjectAnimationTrack ); |
|
495 |
|
496 m3gLight.AnimationTrackCount(); |
|
497 _LIT( KRM3GObjectAnimationTrackCount, |
|
498 "RM3GObject::AnimationTrackCount()" ); |
|
499 AssertTrueL( ETrue, KRM3GObjectAnimationTrackCount ); |
|
500 |
|
501 m3gLight.RemoveAnimationTrack( m3gAnimationT ); |
|
502 _LIT( KRM3GObjectRemoveAnimationTrack, |
|
503 "RM3GObject::RemoveAnimationTrack()" ); |
|
504 AssertTrueL( ETrue, KRM3GObjectRemoveAnimationTrack ); |
|
505 |
|
506 //m3gLight, objects, returnObject, m3gAnimationT, m3gKeyframeSequence |
|
507 CleanupStack::PopAndDestroy( 5 ); |
|
508 |
|
509 } |
|
510 |
|
511 // --------------------------------------------------------------------------- |
|
512 // CBCTestDomM3gCase::TestRM3GBackgroundL |
|
513 // --------------------------------------------------------------------------- |
|
514 // |
|
515 void CBCTestDomM3gCase::TestRM3GBackgroundL() |
|
516 { |
|
517 TBool isTure = ETrue; |
|
518 RM3GBackground m3gBackGround; |
|
519 CleanupClosePushL( m3gBackGround ); |
|
520 _LIT( KRM3GBg, "RM3GBackground::RM3GBackground()" ); |
|
521 AssertTrueL( ETrue, KRM3GBg ); |
|
522 |
|
523 m3gBackGround.OpenL(); |
|
524 _LIT( KRM3GBgOpenL, "RM3GBackground::OpenL()" ); |
|
525 AssertTrueL( ETrue, KRM3GBgOpenL ); |
|
526 |
|
527 TInt bColor = m3gBackGround.Color(); |
|
528 _LIT( KRM3GBgColor, "RM3GBackground::Color()" ); |
|
529 AssertTrueL( ETrue, KRM3GBgColor ); |
|
530 |
|
531 TInt cropHeight = m3gBackGround.CropHeight(); |
|
532 _LIT( KRM3GBgCropHeight, "RM3GBackground::CropHeight()" ); |
|
533 AssertTrueL( ETrue, KRM3GBgCropHeight ); |
|
534 |
|
535 TInt cropWidth = m3gBackGround.CropWidth(); |
|
536 _LIT( KRM3GBgCropWidth, "RM3GBackground::CropWidth()" ); |
|
537 AssertTrueL( ETrue, KRM3GBgCropWidth ); |
|
538 |
|
539 TInt cropX = m3gBackGround.CropX(); |
|
540 _LIT( KRM3GBgCropX, "RM3GBackground::CropX()" ); |
|
541 AssertTrueL( ETrue, KRM3GBgCropX ); |
|
542 |
|
543 TInt cropY = m3gBackGround.CropY(); |
|
544 _LIT( KRM3GBgCropY, "RM3GBackground::CropY()" ); |
|
545 AssertTrueL( ETrue, KRM3GBgCropY ); |
|
546 |
|
547 RM3GImage m3gImage = m3gBackGround.Image(); |
|
548 CleanupClosePushL( m3gImage ); |
|
549 _LIT( KRM3GBgImage, "RM3GBackground::Image()" ); |
|
550 AssertTrueL( ETrue, KRM3GBgImage ); |
|
551 |
|
552 RM3GBackground::TImageMode imageModeX = m3gBackGround.ImageModeX(); |
|
553 _LIT( KRM3GBgImageModeX, "RM3GBackground::ImageModeX()" ); |
|
554 AssertTrueL( ETrue, KRM3GBgImageModeX ); |
|
555 |
|
556 RM3GBackground::TImageMode imageModeY = m3gBackGround.ImageModeY(); |
|
557 _LIT( KRM3GBgImageModeY, "RM3GBackground::ImageModeY()" ); |
|
558 AssertTrueL( ETrue, KRM3GBgImageModeY ); |
|
559 |
|
560 m3gBackGround.IsColorClearEnabled(); |
|
561 _LIT( KRM3GBgIsColorClearEnabled, |
|
562 "RM3GBackground::IsColorClearEnabled()" ); |
|
563 AssertTrueL( ETrue, KRM3GBgIsColorClearEnabled ); |
|
564 |
|
565 m3gBackGround.IsDepthClearEnabled(); |
|
566 _LIT( KRM3GBgIsDepthClearEnabled, |
|
567 "RM3GBackground::IsDepthClearEnabled()" ); |
|
568 AssertTrueL( ETrue, KRM3GBgIsDepthClearEnabled ); |
|
569 |
|
570 m3gBackGround.SetColor( bColor ); |
|
571 _LIT( KRM3GBgSetColor, "RM3GBackground::SetColor()" ); |
|
572 AssertTrueL( ETrue, KRM3GBgSetColor ); |
|
573 |
|
574 m3gBackGround.SetColorClearEnable( isTure ); |
|
575 _LIT( KRM3GBgSetColorClearEnable, |
|
576 "RM3GBackground::SetColorClearEnable()" ); |
|
577 AssertTrueL( ETrue, KRM3GBgSetColorClearEnable ); |
|
578 |
|
579 m3gBackGround.SetCrop(cropX, cropY, cropWidth, cropHeight); |
|
580 _LIT( KRM3GBgSetCrop, "RM3GBackground::SetCrop()" ); |
|
581 AssertTrueL( ETrue, KRM3GBgSetCrop ); |
|
582 |
|
583 m3gBackGround.SetDepthClearEnable( isTure ); |
|
584 _LIT( KRM3GBgSetDepthClearEnable, "RM3GBackground::SetDepthClearEnable()" ); |
|
585 AssertTrueL( ETrue, KRM3GBgSetDepthClearEnable ); |
|
586 |
|
587 m3gBackGround.SetImage( m3gImage ); |
|
588 _LIT( KRM3GBgSetImage, "RM3GBackground::SetImage()" ); |
|
589 AssertTrueL( ETrue, KRM3GBgSetImage ); |
|
590 |
|
591 m3gBackGround.SetImageMode( imageModeX, imageModeY ); |
|
592 _LIT( KRM3GBgSetImageMode, "RM3GBackground::SetImageMode()" ); |
|
593 AssertTrueL( ETrue, KRM3GBgSetImageMode ); |
|
594 |
|
595 m3gBackGround.Cast( m3gBackGround ); |
|
596 _LIT( KRM3GBgCast, "RM3GBackground::Cast()" ); |
|
597 AssertTrueL( ETrue, KRM3GBgCast ); |
|
598 |
|
599 CleanupStack::PopAndDestroy( 2 );//m3gBackGround, m3gImage |
|
600 } |
|
601 |
|
602 // --------------------------------------------------------------------------- |
|
603 // CBCTestDomM3gCase::TestRM3GAppearanceL |
|
604 // --------------------------------------------------------------------------- |
|
605 // |
|
606 void CBCTestDomM3gCase::TestRM3GAppearanceL() |
|
607 { |
|
608 RM3GAppearance m3gAppearance; |
|
609 CleanupClosePushL( m3gAppearance ); |
|
610 _LIT( KRM3GAppearance, "RM3GAppearance::RM3GAppearance()" ); |
|
611 AssertTrueL( ETrue, KRM3GAppearance ); |
|
612 |
|
613 m3gAppearance.OpenL(); |
|
614 _LIT( KRM3GApOpenL, "RM3GAppearance::OpenL()" ); |
|
615 AssertTrueL( ETrue, KRM3GApOpenL ); |
|
616 |
|
617 RM3GCompositingMode m3gCompositingMode = m3gAppearance.CompositingMode(); |
|
618 _LIT( KRM3GApCompositingMode, "RM3GAppearance::CompositingMode()" ); |
|
619 AssertTrueL( ETrue, KRM3GApCompositingMode ); |
|
620 |
|
621 m3gAppearance.SetCompositingMode( m3gCompositingMode ); |
|
622 _LIT( KRM3GApSetCompositingMode, "RM3GAppearance::SetCompositingMode()" ); |
|
623 AssertTrueL( ETrue, KRM3GApSetCompositingMode ); |
|
624 |
|
625 RM3GFog m3gFog = m3gAppearance.Fog(); |
|
626 _LIT( KRM3GApFog, "RM3GAppearance::Fog()" ); |
|
627 AssertTrueL( ETrue, KRM3GApFog ); |
|
628 |
|
629 m3gAppearance.SetFog( m3gFog ); |
|
630 _LIT( KRM3GApSetFog, "RM3GAppearance::SetFog()" ); |
|
631 AssertTrueL( ETrue, KRM3GApSetFog ); |
|
632 |
|
633 TInt layer = m3gAppearance.Layer(); |
|
634 _LIT( KRM3GApLayer, "RM3GAppearance::Layer()" ); |
|
635 AssertTrueL( ETrue, KRM3GApLayer ); |
|
636 |
|
637 m3gAppearance.SetLayer( layer ); |
|
638 _LIT( KRM3GApSetLayer, "RM3GAppearance::SetLayer()" ); |
|
639 AssertTrueL( ETrue, KRM3GApSetLayer ); |
|
640 |
|
641 RM3GMaterial m3gMaterial = m3gAppearance.Material(); |
|
642 _LIT( KRM3GApMaterial, "RM3GAppearance::Material()" ); |
|
643 AssertTrueL( ETrue, KRM3GApMaterial ); |
|
644 |
|
645 m3gAppearance.SetMaterial( m3gMaterial ); |
|
646 _LIT( KRM3GApSetMaterial, "RM3GAppearance::SetMaterial()" ); |
|
647 AssertTrueL( ETrue, KRM3GApSetMaterial ); |
|
648 |
|
649 RM3GPolygonMode m3gPolygonMode = m3gAppearance.PolygonMode(); |
|
650 _LIT( KRM3GApPolygonMode, "RM3GAppearance::PolygonMode()" ); |
|
651 AssertTrueL( ETrue, KRM3GApPolygonMode ); |
|
652 |
|
653 m3gAppearance.SetPolygonMode( m3gPolygonMode ); |
|
654 _LIT( KRM3GApSetPolygonMode, "RM3GAppearance::SetPolygonMode()" ); |
|
655 AssertTrueL( ETrue, KRM3GApSetPolygonMode ); |
|
656 |
|
657 TInt textNum = 1; |
|
658 RM3GTexture m3gTexture = m3gAppearance.Texture( textNum ); |
|
659 _LIT( KRM3GApTexture, "RM3GAppearance::Texture()" ); |
|
660 AssertTrueL( ETrue, KRM3GApTexture ); |
|
661 |
|
662 m3gAppearance.SetTexture( textNum, m3gTexture ); |
|
663 _LIT( KRM3GApSetTexture, "RM3GAppearance::SetTexture()" ); |
|
664 AssertTrueL( ETrue, KRM3GApSetTexture ); |
|
665 |
|
666 m3gAppearance.Cast( m3gAppearance ); |
|
667 _LIT( KRM3GApCast, "RM3GAppearance::Cast()" ); |
|
668 AssertTrueL( ETrue, KRM3GApCast ); |
|
669 |
|
670 CleanupStack::PopAndDestroy(); //m3gAppearance |
|
671 } |
|
672 |
|
673 // --------------------------------------------------------------------------- |
|
674 // CBCTestDomM3gCase::TestRM3GCompositingModeL |
|
675 // --------------------------------------------------------------------------- |
|
676 // |
|
677 void CBCTestDomM3gCase::TestRM3GCompositingModeL() |
|
678 { |
|
679 RM3GCompositingMode m3gCompositingMode; |
|
680 CleanupClosePushL( m3gCompositingMode ); |
|
681 _LIT( KRM3GCompositingMode, |
|
682 "RM3GCompositingMode::RM3GCompositingMode()" ); |
|
683 AssertTrueL( ETrue, KRM3GCompositingMode ); |
|
684 |
|
685 m3gCompositingMode.OpenL(); |
|
686 _LIT( KRM3GCMOpenL, "RM3GCompositingMode::OpenL()" ); |
|
687 AssertTrueL( ETrue, KRM3GCMOpenL ); |
|
688 |
|
689 TReal thresShold = m3gCompositingMode.AlphaThreshold(); |
|
690 _LIT( KRM3GCMAlphaThreshold, "RM3GCompositingMode::AlphaThreshold()" ); |
|
691 AssertTrueL( ETrue, KRM3GCMAlphaThreshold ); |
|
692 |
|
693 RM3GCompositingMode::TBlending blend = m3gCompositingMode.Blending(); |
|
694 _LIT( KRM3GCMBlending, "RM3GCompositingMode::Blending()" ); |
|
695 AssertTrueL( ETrue, KRM3GCMBlending ); |
|
696 |
|
697 TReal offsetFactor = m3gCompositingMode.DepthOffsetFactor(); |
|
698 _LIT( KRM3GCMDepthOffsetFactor, |
|
699 "RM3GCompositingMode::DepthOffsetFactor()" ); |
|
700 AssertTrueL( ETrue, KRM3GCMDepthOffsetFactor ); |
|
701 |
|
702 TReal offsetUnits = m3gCompositingMode.DepthOffsetUnits(); |
|
703 _LIT( KRM3GCMDepthOffsetUnits, |
|
704 "RM3GCompositingMode::DepthOffsetUnits()" ); |
|
705 AssertTrueL( ETrue, KRM3GCMDepthOffsetUnits ); |
|
706 |
|
707 TBool alphaWriteEnabled = m3gCompositingMode.IsAlphaWriteEnabled(); |
|
708 _LIT( KRM3GCMIsAlphaWriteEnabled, |
|
709 "RM3GCompositingMode::IsAlphaWriteEnabled()" ); |
|
710 AssertTrueL( ETrue, KRM3GCMIsAlphaWriteEnabled ); |
|
711 |
|
712 TBool colorWriteEnabled = m3gCompositingMode.IsColorWriteEnabled(); |
|
713 _LIT( KRM3GCMIsColorWriteEnabled, |
|
714 "RM3GCompositingMode::IsColorWriteEnabled()" ); |
|
715 AssertTrueL( ETrue, KRM3GCMIsColorWriteEnabled ); |
|
716 |
|
717 TBool depthTestEnabled = m3gCompositingMode.IsDepthTestEnabled(); |
|
718 _LIT( KRM3GCMIsDepthTestEnabled, |
|
719 "RM3GCompositingMode::IsDepthTestEnabled()" ); |
|
720 AssertTrueL( ETrue, KRM3GCMIsDepthTestEnabled ); |
|
721 |
|
722 TBool depthWriteEnabled = m3gCompositingMode.IsDepthWriteEnabled(); |
|
723 _LIT( KRM3GCMIsDepthWriteEnabled, |
|
724 "RM3GCompositingMode::IsDepthWriteEnabled()" ); |
|
725 AssertTrueL( ETrue, KRM3GCMIsDepthWriteEnabled ); |
|
726 |
|
727 m3gCompositingMode.SetAlphaThreshold( thresShold ); |
|
728 _LIT( KRM3GCMSetAlphaThreshold, |
|
729 "RM3GCompositingMode::SetAlphaThreshold()" ); |
|
730 AssertTrueL( ETrue, KRM3GCMSetAlphaThreshold ); |
|
731 |
|
732 m3gCompositingMode.SetAlphaWriteEnable( alphaWriteEnabled ); |
|
733 _LIT( KRM3GCMSetAlphaWriteEnable, |
|
734 "RM3GCompositingMode::SetAlphaWriteEnable()" ); |
|
735 AssertTrueL( ETrue, KRM3GCMSetAlphaWriteEnable ); |
|
736 |
|
737 m3gCompositingMode.SetBlending( blend ); |
|
738 _LIT( KRM3GCMSetBlending, "RM3GCompositingMode::SetBlending()" ); |
|
739 AssertTrueL( ETrue, KRM3GCMSetBlending ); |
|
740 |
|
741 m3gCompositingMode.SetColorWriteEnable( colorWriteEnabled ); |
|
742 _LIT( KRM3GCMSetColorWriteEnable, |
|
743 "RM3GCompositingMode::SetColorWriteEnable()" ); |
|
744 AssertTrueL( ETrue, KRM3GCMSetColorWriteEnable ); |
|
745 |
|
746 m3gCompositingMode.SetDepthOffset( offsetFactor, offsetUnits ); |
|
747 _LIT( KRM3GCMSetDepthOffset, "RM3GCompositingMode::SetDepthOffset()" ); |
|
748 AssertTrueL( ETrue, KRM3GCMSetDepthOffset ); |
|
749 |
|
750 m3gCompositingMode.SetDepthTestEnable( depthTestEnabled ); |
|
751 _LIT( KRM3GCMSetDepthTestEnable, |
|
752 "RM3GCompositingMode::SetDepthTestEnable()" ); |
|
753 AssertTrueL( ETrue, KRM3GCMSetDepthTestEnable ); |
|
754 |
|
755 m3gCompositingMode.SetDepthWriteEnable( depthWriteEnabled ); |
|
756 _LIT( KRM3GCMSetDepthWriteEnable, |
|
757 "RM3GCompositingMode::SetDepthWriteEnable()" ); |
|
758 AssertTrueL( ETrue, KRM3GCMSetDepthWriteEnable ); |
|
759 |
|
760 m3gCompositingMode.Cast( m3gCompositingMode ); |
|
761 _LIT( KRM3GCMCast, "RM3GCompositingMode::Cast()" ); |
|
762 AssertTrueL( ETrue, KRM3GCMCast ); |
|
763 |
|
764 CleanupStack::PopAndDestroy(); //m3gCompositingMode |
|
765 } |
|
766 |
|
767 // --------------------------------------------------------------------------- |
|
768 // CBCTestDomM3gCase::TestRM3GFogL |
|
769 // --------------------------------------------------------------------------- |
|
770 // |
|
771 void CBCTestDomM3gCase::TestRM3GFogL() |
|
772 { |
|
773 RM3GFog m3gFog; |
|
774 CleanupClosePushL( m3gFog ); |
|
775 _LIT( KRM3GFog, "RM3GFog::RM3GFog()" ); |
|
776 AssertTrueL( ETrue, KRM3GFog ); |
|
777 |
|
778 m3gFog.OpenL(); |
|
779 _LIT( KRM3GFogOpenL, "RM3GFog::OpenL()" ); |
|
780 AssertTrueL( ETrue, KRM3GFogOpenL ); |
|
781 |
|
782 TInt fogColog = m3gFog.Color(); |
|
783 _LIT( KRM3GFogColor, "RM3GFog::Color()" ); |
|
784 AssertTrueL( ETrue, KRM3GFogColor ); |
|
785 |
|
786 TReal density = m3gFog.Density(); |
|
787 _LIT( KRM3GFogDensity, "RM3GFog::Density()" ); |
|
788 AssertTrueL( ETrue, KRM3GFogDensity ); |
|
789 |
|
790 TReal farDistance = m3gFog.FarDistance(); |
|
791 _LIT( KRM3GFogFarDistance, "RM3GFog::FarDistance()" ); |
|
792 AssertTrueL( ETrue, KRM3GFogFarDistance ); |
|
793 |
|
794 RM3GFog::TMode mode = m3gFog.Mode(); |
|
795 _LIT( KRM3GFogMode, "RM3GFog::Mode()" ); |
|
796 AssertTrueL( ETrue, KRM3GFogMode ); |
|
797 |
|
798 TReal nearDistance = m3gFog.NearDistance(); |
|
799 _LIT( KRM3GFogNearDistance, "RM3GFog::NearDistance()" ); |
|
800 AssertTrueL( ETrue, KRM3GFogNearDistance ); |
|
801 |
|
802 m3gFog.SetColor( fogColog ); |
|
803 _LIT( KRM3GFogSetColor, "RM3GFog::SetColor()" ); |
|
804 AssertTrueL( ETrue, KRM3GFogSetColor ); |
|
805 |
|
806 m3gFog.SetDensity( density ); |
|
807 _LIT( KRM3GFogSetDensity, "RM3GFog::SetDensity()" ); |
|
808 AssertTrueL( ETrue, KRM3GFogSetDensity ); |
|
809 |
|
810 m3gFog.SetLinear( nearDistance, farDistance ); |
|
811 _LIT( KRM3GFogSetLinear, "RM3GFog::SetLinear()" ); |
|
812 AssertTrueL( ETrue, KRM3GFogSetLinear ); |
|
813 |
|
814 m3gFog.SetMode( mode ); |
|
815 _LIT( KRM3GFogSetMode, "RM3GFog::SetMode()" ); |
|
816 AssertTrueL( ETrue, KRM3GFogSetMode ); |
|
817 |
|
818 m3gFog.Cast( m3gFog ); |
|
819 _LIT( KRM3GFogCast, "RM3GFog::Cast()" ); |
|
820 AssertTrueL( ETrue, KRM3GFogCast ); |
|
821 |
|
822 CleanupStack::PopAndDestroy(); //m3gFog |
|
823 } |
|
824 |
|
825 // --------------------------------------------------------------------------- |
|
826 // CBCTestDomM3gCase::TestRM3GMaterialL |
|
827 // --------------------------------------------------------------------------- |
|
828 // |
|
829 void CBCTestDomM3gCase::TestRM3GMaterialL() |
|
830 { |
|
831 RM3GMaterial m3gMaterial; |
|
832 CleanupClosePushL( m3gMaterial ); |
|
833 _LIT( KRM3GMaterial, "RM3GMaterial::RM3GMaterial()" ); |
|
834 AssertTrueL( ETrue, KRM3GMaterial ); |
|
835 m3gMaterial.OpenL(); |
|
836 _LIT( KRM3GMaterialOpenL, "RM3GMaterial::OpenL()" ); |
|
837 AssertTrueL( ETrue, KRM3GMaterialOpenL ); |
|
838 |
|
839 TInt colorNum = m3gMaterial.Color( RM3GMaterial::ESpecular ); |
|
840 _LIT( KRM3GMaterialColor, "RM3GMaterial::Color()" ); |
|
841 AssertTrueL( ETrue, KRM3GMaterialColor ); |
|
842 |
|
843 m3gMaterial.SetColor( RM3GMaterial::ESpecular, colorNum ); |
|
844 _LIT( KRM3GMaterialSetColor, "RM3GMaterial::SetColor()" ); |
|
845 AssertTrueL( ETrue, KRM3GMaterialSetColor ); |
|
846 |
|
847 TReal shininess = m3gMaterial.Shininess(); |
|
848 _LIT( KRM3GMaterialShininess, "RM3GMaterial::Shininess()" ); |
|
849 AssertTrueL( ETrue, KRM3GMaterialShininess ); |
|
850 |
|
851 TBool isVertex = m3gMaterial.IsVertexColorTrackingEnabled(); |
|
852 _LIT( KRM3GMaterialIsVertexColorTrackingEnabled, |
|
853 "RM3GMaterial::IsVertexColorTrackingEnabled()" ); |
|
854 AssertTrueL( ETrue, KRM3GMaterialIsVertexColorTrackingEnabled ); |
|
855 |
|
856 m3gMaterial.SetShininess( shininess ); |
|
857 _LIT( KRM3GMaterialSetShininess, "RM3GMaterial::SetShininess()" ); |
|
858 AssertTrueL( ETrue, KRM3GMaterialSetShininess ); |
|
859 |
|
860 m3gMaterial.SetVertexColorTrackingEnable( isVertex ); |
|
861 _LIT( KRM3GMaterialSetVertexColorTrackingEnable, |
|
862 "RM3GMaterial::SetVertexColorTrackingEnable()" ); |
|
863 AssertTrueL( ETrue, KRM3GMaterialSetVertexColorTrackingEnable ); |
|
864 |
|
865 m3gMaterial.Cast( m3gMaterial ); |
|
866 _LIT( KRM3GMaterialCast, "RM3GMaterial::Cast()" ); |
|
867 AssertTrueL( ETrue, KRM3GMaterialCast ); |
|
868 |
|
869 CleanupStack::PopAndDestroy(); //m3gMaterial |
|
870 } |
|
871 |
|
872 // --------------------------------------------------------------------------- |
|
873 // CBCTestDomM3gCase::TestRM3GPolygonModeL |
|
874 // --------------------------------------------------------------------------- |
|
875 // |
|
876 void CBCTestDomM3gCase::TestRM3GPolygonModeL() |
|
877 { |
|
878 RM3GPolygonMode m3gPolygonMode; |
|
879 CleanupClosePushL( m3gPolygonMode ); |
|
880 _LIT( KRM3GPolygonMode, "RM3GPolygonMode::RM3GPolygonMode()" ); |
|
881 AssertTrueL( ETrue, KRM3GPolygonMode ); |
|
882 |
|
883 m3gPolygonMode.OpenL(); |
|
884 _LIT( KRM3GPolygonModeOpenL, "RM3GPolygonMode::OpenL()" ); |
|
885 AssertTrueL( ETrue, KRM3GPolygonModeOpenL ); |
|
886 |
|
887 RM3GPolygonMode::TCulling culling = m3gPolygonMode.Culling(); |
|
888 _LIT( KRM3GPolygonModeCulling, "RM3GPolygonMode::Culling()" ); |
|
889 AssertTrueL( ETrue, KRM3GPolygonModeCulling ); |
|
890 |
|
891 RM3GPolygonMode::TShading shading = m3gPolygonMode.Shading(); |
|
892 _LIT( KRM3GPolygonModeShading, "RM3GPolygonMode::Shading()" ); |
|
893 AssertTrueL( ETrue, KRM3GPolygonModeShading ); |
|
894 |
|
895 RM3GPolygonMode::TWinding winding = m3gPolygonMode.Winding(); |
|
896 _LIT( KRM3GPolygonModeWinding, "RM3GPolygonMode::Winding()" ); |
|
897 AssertTrueL( ETrue, KRM3GPolygonModeWinding ); |
|
898 |
|
899 TBool isTSLEnabled = m3gPolygonMode.IsTwoSidedLightingEnabled(); |
|
900 _LIT( KRM3GPolygonModeIsTwoSidedLightingEnabled, |
|
901 "RM3GPolygonMode::IsTwoSidedLightingEnabled()" ); |
|
902 AssertTrueL( ETrue, KRM3GPolygonModeIsTwoSidedLightingEnabled ); |
|
903 |
|
904 m3gPolygonMode.SetCulling( culling ); |
|
905 _LIT( KRM3GPolygonModeSetCulling, "RM3GPolygonMode::SetCulling()" ); |
|
906 AssertTrueL( ETrue, KRM3GPolygonModeSetCulling ); |
|
907 |
|
908 m3gPolygonMode.SetLocalCameraLightingEnable( isTSLEnabled ); |
|
909 _LIT( KRM3GPolygonModeSetLocalCameraLightingEnable, |
|
910 "RM3GPolygonMode::SetLocalCameraLightingEnable()" ); |
|
911 AssertTrueL( ETrue, KRM3GPolygonModeSetLocalCameraLightingEnable ); |
|
912 |
|
913 m3gPolygonMode.SetPerspectiveCorrectionEnable( isTSLEnabled ); |
|
914 _LIT( KRM3GPolygonModeSetPerspectiveCorrectionEnable, |
|
915 "RM3GPolygonMode::SetPerspectiveCorrectionEnable()" ); |
|
916 AssertTrueL( ETrue, KRM3GPolygonModeSetPerspectiveCorrectionEnable ); |
|
917 |
|
918 m3gPolygonMode.SetShading( shading ); |
|
919 _LIT( KRM3GPolygonModeSetShading, "RM3GPolygonMode::SetShading()" ); |
|
920 AssertTrueL( ETrue, KRM3GPolygonModeSetShading ); |
|
921 |
|
922 m3gPolygonMode.SetTwoSidedLightingEnable( isTSLEnabled ); |
|
923 _LIT( KRM3GPolygonModeSetTwoSidedLightingEnable, |
|
924 "RM3GPolygonMode::SetTwoSidedLightingEnable()" ); |
|
925 AssertTrueL( ETrue, KRM3GPolygonModeSetTwoSidedLightingEnable ); |
|
926 |
|
927 m3gPolygonMode.SetWinding( winding ); |
|
928 _LIT( KRM3GPolygonModeSetWinding, "RM3GPolygonMode::SetWinding()" ); |
|
929 AssertTrueL( ETrue, KRM3GPolygonModeSetWinding ); |
|
930 |
|
931 m3gPolygonMode.Cast( m3gPolygonMode ); |
|
932 _LIT( KRM3GPolygonModeCast, "RM3GPolygonMode::Cast()" ); |
|
933 AssertTrueL( ETrue, KRM3GPolygonModeCast ); |
|
934 |
|
935 CleanupStack::PopAndDestroy(); //m3gPolygonMode |
|
936 } |
|
937 |
|
938 // --------------------------------------------------------------------------- |
|
939 // CBCTestDomM3gCase::TestRM3GTextureL |
|
940 // --------------------------------------------------------------------------- |
|
941 // |
|
942 void CBCTestDomM3gCase::TestRM3GTextureL() |
|
943 { |
|
944 RM3GTexture m3gTexture; |
|
945 CleanupClosePushL( m3gTexture ); |
|
946 _LIT( KRM3GTexture, "RM3GTexture::RM3GTexture()" ); |
|
947 AssertTrueL( ETrue, KRM3GTexture ); |
|
948 |
|
949 //Construct RM3GImage object; |
|
950 RM3GImage m3gImage; |
|
951 CleanupClosePushL( m3gImage ); |
|
952 TUint imageWidth = 16; |
|
953 TUint imageHeight = 16; |
|
954 TInt flag = 0; |
|
955 m3gImage.OpenL( RM3GImage::ERGB, |
|
956 imageWidth, |
|
957 imageHeight, |
|
958 flag ); |
|
959 |
|
960 m3gTexture.OpenL( m3gImage ); |
|
961 _LIT( KRM3GTextureOpenL, "RM3GTexture::OpenL()" ); |
|
962 AssertTrueL( ETrue, KRM3GTextureOpenL ); |
|
963 |
|
964 TInt bColor = m3gTexture.BlendColor(); |
|
965 _LIT( KRM3GTextureBlendColor, "RM3GTexture::BlendColor()" ); |
|
966 AssertTrueL( ETrue, KRM3GTextureBlendColor ); |
|
967 |
|
968 RM3GTexture::TBlending blending = m3gTexture.Blending(); |
|
969 _LIT( KRM3GTextureBlending, "RM3GTexture::Blending()" ); |
|
970 AssertTrueL( ETrue, KRM3GTextureBlending ); |
|
971 |
|
972 RM3GImage m3gImageCopy = m3gTexture.Image(); |
|
973 CleanupClosePushL( m3gImageCopy ); |
|
974 _LIT( KRM3GTextureImage, "RM3GTexture::Image()" ); |
|
975 AssertTrueL( ETrue, KRM3GTextureImage ); |
|
976 |
|
977 RM3GTexture::TWrapping wrappingS = m3gTexture.WrappingS(); |
|
978 _LIT( KRM3GTextureWrappingS, "RM3GTexture::WrappingS()" ); |
|
979 AssertTrueL( ETrue, KRM3GTextureWrappingS ); |
|
980 |
|
981 RM3GTexture::TWrapping wrappingT = m3gTexture.WrappingT(); |
|
982 _LIT( KRM3GTextureWrappingT, "RM3GTexture::WrappingT()" ); |
|
983 AssertTrueL( ETrue, KRM3GTextureWrappingT ); |
|
984 |
|
985 m3gTexture.SetBlendColor( bColor ); |
|
986 _LIT( KRM3GTextureSetBlendColor, "RM3GTexture::SetBlendColor()" ); |
|
987 AssertTrueL( ETrue, KRM3GTextureSetBlendColor); |
|
988 |
|
989 m3gTexture.SetBlending( blending ); |
|
990 _LIT( KRM3GTextureSetBlending, "RM3GTexture::SetBlending()" ); |
|
991 AssertTrueL( ETrue, KRM3GTextureSetBlending ); |
|
992 |
|
993 m3gTexture.SetFiltering( RM3GTexture::EBaseLevel, RM3GTexture::ELinear ); |
|
994 _LIT( KRM3GTextureSetFiltering, "RM3GTexture::SetFiltering()" ); |
|
995 AssertTrueL( ETrue, KRM3GTextureSetFiltering ); |
|
996 |
|
997 m3gTexture.SetImage( m3gImage ); |
|
998 _LIT( KRM3GTextureSetImage, "RM3GTexture::SetImage()" ); |
|
999 AssertTrueL( ETrue, KRM3GTextureSetImage); |
|
1000 |
|
1001 m3gTexture.SetWrapping( wrappingS, wrappingT ); |
|
1002 _LIT( KRM3GTextureSetWrapping, "RM3GTexture::SetWrapping()" ); |
|
1003 AssertTrueL( ETrue, KRM3GTextureSetWrapping ); |
|
1004 |
|
1005 m3gTexture.Cast( m3gTexture ); |
|
1006 _LIT( KRM3GTextureCast, "RM3GTexture::Cast()" ); |
|
1007 AssertTrueL( ETrue, KRM3GTextureCast ); |
|
1008 |
|
1009 CleanupStack::PopAndDestroy( 3 ); //m3gTexture, m3gImage, m3gImageCopy |
|
1010 } |
|
1011 |
|
1012 // --------------------------------------------------------------------------- |
|
1013 // CBCTestDomM3gCase::TestRM3GKeyframeSequenceL |
|
1014 // --------------------------------------------------------------------------- |
|
1015 // |
|
1016 void CBCTestDomM3gCase::TestRM3GKeyframeSequenceL() |
|
1017 { |
|
1018 RM3GKeyframeSequence keyFrameSeq; |
|
1019 CleanupClosePushL( keyFrameSeq ); |
|
1020 _LIT( KRM3GKfSequence, "RM3GKeyframeSequence::RM3GKeyframeSequence()" ); |
|
1021 AssertTrueL( ETrue, KRM3GKfSequence ); |
|
1022 |
|
1023 const TInt keyframeCount = 1; |
|
1024 const TInt componentCount = 1; |
|
1025 keyFrameSeq.OpenL( keyframeCount, |
|
1026 componentCount, |
|
1027 RM3GKeyframeSequence::ELinear ); |
|
1028 _LIT( KRM3GKfSequenceOpenL, "RM3GKeyframeSequence::OpenL()" ); |
|
1029 AssertTrueL( ETrue, KRM3GKfSequenceOpenL ); |
|
1030 |
|
1031 TInt duration = keyFrameSeq.Duration(); |
|
1032 _LIT( KRM3GKfSequenceDuration, "RM3GKeyframeSequence::Duration()" ); |
|
1033 AssertTrueL( ETrue, KRM3GKfSequenceDuration ); |
|
1034 |
|
1035 RM3GKeyframeSequence::TRepeatMode rpMode = keyFrameSeq.RepeatMode(); |
|
1036 _LIT( KRM3GKfSequenceRepeatMode, "RM3GKeyframeSequence::RepeatMode()" ); |
|
1037 AssertTrueL( ETrue, KRM3GKfSequenceRepeatMode ); |
|
1038 |
|
1039 keyFrameSeq.SetDuration( duration ); |
|
1040 _LIT( KRM3GKfSequenceSetDuration, "RM3GKeyframeSequence::SetDuration()" ); |
|
1041 AssertTrueL( ETrue, KRM3GKfSequenceSetDuration ); |
|
1042 |
|
1043 RArray<TReal> values; |
|
1044 CleanupClosePushL( values ); |
|
1045 const TInt index = 0; |
|
1046 const TInt time = 0; |
|
1047 keyFrameSeq.SetKeyframe( index, time, values ); |
|
1048 _LIT( KRM3GKfSequenceSetKeyframe, "RM3GKeyframeSequence::SetKeyframe()" ); |
|
1049 AssertTrueL( ETrue, KRM3GKfSequenceSetKeyframe ); |
|
1050 |
|
1051 keyFrameSeq.SetRepeatMode( rpMode ); |
|
1052 _LIT( KRM3GKfSequenceSetRepeatMode, |
|
1053 "RM3GKeyframeSequence::SetRepeatMode()" ); |
|
1054 AssertTrueL( ETrue, KRM3GKfSequenceSetRepeatMode ); |
|
1055 |
|
1056 const TInt firstNum = 0; |
|
1057 const TInt SecondNum = 10; |
|
1058 keyFrameSeq.SetValidRange( firstNum, SecondNum); |
|
1059 _LIT( KRM3GKfSequenceSetValidRange, |
|
1060 "RM3GKeyframeSequence::SetValidRange()" ); |
|
1061 AssertTrueL( ETrue, KRM3GKfSequenceSetValidRange ); |
|
1062 |
|
1063 keyFrameSeq.Cast( keyFrameSeq ); |
|
1064 _LIT( KRM3GKfSequenceCast, "RM3GKeyframeSequence::Cast()" ); |
|
1065 AssertTrueL( ETrue, KRM3GKfSequenceCast ); |
|
1066 |
|
1067 CleanupStack::PopAndDestroy( 2 );// keyFrameSeq, values |
|
1068 |
|
1069 //Test TM3GMatrix::Unity() |
|
1070 TM3GMatrix m3gMatrix; |
|
1071 m3gMatrix.Unity(); |
|
1072 _LIT( KTM3GMatrix, "TM3GMatrix::Unity()" ); |
|
1073 AssertTrueL( ETrue, KTM3GMatrix ); |
|
1074 } |
|
1075 |
|
1076 // --------------------------------------------------------------------------- |
|
1077 // CBCTestDomM3gCase::TestRM3GVertexBufferL |
|
1078 // --------------------------------------------------------------------------- |
|
1079 // |
|
1080 void CBCTestDomM3gCase::TestRM3GVertexBufferL() |
|
1081 { |
|
1082 RM3GVertexBuffer m3gVertexBuffer; |
|
1083 CleanupClosePushL( m3gVertexBuffer ); |
|
1084 _LIT( KRM3GVertexBuffer, "RM3GVertexBuffer::RM3GVertexBuffer()" ); |
|
1085 AssertTrueL( ETrue, KRM3GVertexBuffer ); |
|
1086 |
|
1087 m3gVertexBuffer.OpenL(); |
|
1088 _LIT( KRM3GVBOpenL, "RM3GVertexBuffer::OpenL()" ); |
|
1089 AssertTrueL( ETrue, KRM3GVBOpenL ); |
|
1090 |
|
1091 RM3GVertexArray m3gArray = m3gVertexBuffer.Colors(); |
|
1092 CleanupClosePushL( m3gArray ); |
|
1093 _LIT( KRM3GVBColors, "RM3GVertexBuffer::Colors()" ); |
|
1094 AssertTrueL( ETrue, KRM3GVBColors ); |
|
1095 |
|
1096 TUint defaultColor = m3gVertexBuffer.DefaultColor(); |
|
1097 _LIT( KRM3GVBDefaultColor, "RM3GVertexBuffer::DefaultColor()" ); |
|
1098 AssertTrueL( ETrue, KRM3GVBDefaultColor ); |
|
1099 |
|
1100 RM3GVertexArray normalArray = m3gVertexBuffer.Normals(); |
|
1101 CleanupClosePushL( normalArray ); |
|
1102 _LIT( KRM3GVBNormals, "RM3GVertexBuffer::Normals()" ); |
|
1103 AssertTrueL( ETrue, KRM3GVBNormals ); |
|
1104 |
|
1105 RArray<TReal32> scaleBias; |
|
1106 CleanupClosePushL( scaleBias ); |
|
1107 RM3GVertexArray positionArray = m3gVertexBuffer.Positions( scaleBias ); |
|
1108 CleanupClosePushL( positionArray ); |
|
1109 _LIT( KRM3GVBPositions, "RM3GVertexBuffer::Positions()" ); |
|
1110 AssertTrueL( ETrue, KRM3GVBPositions ); |
|
1111 |
|
1112 TInt index = 0; |
|
1113 RM3GVertexArray textCoords = |
|
1114 m3gVertexBuffer.TexCoords( index, scaleBias ); |
|
1115 CleanupClosePushL( textCoords ); |
|
1116 _LIT( KRM3GVBTexCoords, "RM3GVertexBuffer::TexCoords()" ); |
|
1117 AssertTrueL( ETrue, KRM3GVBTexCoords ); |
|
1118 |
|
1119 m3gVertexBuffer.VertexCount(); |
|
1120 _LIT( KRM3GVBVertexCount, "RM3GVertexBuffer::VertexCount()" ); |
|
1121 AssertTrueL( ETrue, KRM3GVBVertexCount ); |
|
1122 |
|
1123 m3gVertexBuffer.SetColors( m3gArray ); |
|
1124 _LIT( KRM3GVBSetColors, "RM3GVertexBuffer::SetColors()" ); |
|
1125 AssertTrueL( ETrue, KRM3GVBSetColors ); |
|
1126 |
|
1127 m3gVertexBuffer.SetDefaultColor( defaultColor ); |
|
1128 _LIT( KRM3GVBSetDefaultColor, "RM3GVertexBuffer::SetDefaultColor()" ); |
|
1129 AssertTrueL( ETrue, KRM3GVBSetDefaultColor ); |
|
1130 |
|
1131 m3gVertexBuffer.SetNormals( normalArray ); |
|
1132 _LIT( KRM3GVBSetNormals, "RM3GVertexBuffer::SetNormals()" ); |
|
1133 AssertTrueL( ETrue, KRM3GVBSetNormals ); |
|
1134 |
|
1135 TM3GVector3 m3gVector3; |
|
1136 TReal scale = 1.0; |
|
1137 m3gVertexBuffer.SetPositions( positionArray, scale, m3gVector3 ); |
|
1138 _LIT( KRM3GVBSetPositions, "RM3GVertexBuffer::SetPositions()" ); |
|
1139 AssertTrueL( ETrue, KRM3GVBSetPositions ); |
|
1140 |
|
1141 TInt textUint = 1; |
|
1142 m3gVertexBuffer.SetTexCoords( textUint, textCoords, scale, m3gVector3 ); |
|
1143 _LIT( KRM3GVBSetTexCoordsV3, "RM3GVertexBuffer::SetTexCoords()" ); |
|
1144 AssertTrueL( ETrue, KRM3GVBSetTexCoordsV3 ); |
|
1145 |
|
1146 TM3GVector2 m3gVector2; |
|
1147 m3gVertexBuffer.SetTexCoords( textUint, textCoords, scale, m3gVector2 ); |
|
1148 _LIT( KRM3GVBSetTexCoordsV2, "RM3GVertexBuffer::SetTexCoords()" ); |
|
1149 AssertTrueL( ETrue, KRM3GVBSetTexCoordsV2 ); |
|
1150 |
|
1151 m3gVertexBuffer.Cast( m3gVertexBuffer ); |
|
1152 _LIT( KRM3GVBCast, "RM3GVertexBuffer::Cast()" ); |
|
1153 AssertTrueL( ETrue, KRM3GVBCast ); |
|
1154 |
|
1155 // m3gVertexBuffer, m3gArray, normalArray, |
|
1156 // scaleBias, positionArray, textCoords |
|
1157 CleanupStack::PopAndDestroy( 6, &m3gVertexBuffer ); |
|
1158 } |
|
1159 |
|
1160 // --------------------------------------------------------------------------- |
|
1161 // CBCTestDomM3gCase::TestRM3GVertexArrayL |
|
1162 // --------------------------------------------------------------------------- |
|
1163 // |
|
1164 void CBCTestDomM3gCase::TestRM3GVertexArrayL() |
|
1165 { |
|
1166 //Test APIS of class RM3GVertexArray as follow. |
|
1167 RM3GVertexArray m3gVertextArray; |
|
1168 CleanupClosePushL( m3gVertextArray ); |
|
1169 _LIT( KRM3GVertexArray, "RM3GVertexArray::RM3GVertexArray()" ); |
|
1170 AssertTrueL( ETrue, KRM3GVertexArray ); |
|
1171 |
|
1172 TUint vertexCount = 12; |
|
1173 TUint componentCount = 3; |
|
1174 m3gVertextArray.OpenL( vertexCount, componentCount, EM3GShort ); |
|
1175 _LIT( KRM3GVertexArrayOpenL, "RM3GVertexArray::OpenL()" ); |
|
1176 AssertTrueL( ETrue, KRM3GVertexArrayOpenL ); |
|
1177 |
|
1178 TUint firstVertex = 1; |
|
1179 TUint aSourceBufferLength = 3; |
|
1180 TInt8 vertics8 = 2; |
|
1181 TInt16 vertics16 = 2; |
|
1182 m3gVertextArray.Set( firstVertex, |
|
1183 vertexCount, |
|
1184 aSourceBufferLength, |
|
1185 &vertics8 ); |
|
1186 _LIT( KRM3GVertexArraySet8, "RM3GVertexArray::Set()" ); |
|
1187 AssertTrueL( ETrue, KRM3GVertexArraySet8 ); |
|
1188 |
|
1189 m3gVertextArray.Set( firstVertex, |
|
1190 vertexCount, |
|
1191 aSourceBufferLength, |
|
1192 &vertics16 ); |
|
1193 _LIT( KRM3GVertexArraySet16, "RM3GVertexArray::Set()" ); |
|
1194 AssertTrueL( ETrue, KRM3GVertexArraySet16 ); |
|
1195 |
|
1196 m3gVertextArray.Cast( m3gVertextArray ); |
|
1197 _LIT( KRM3GVertexArrayCast, "RM3GVertexArray::Cast()" ); |
|
1198 AssertTrueL( ETrue, KRM3GVertexArrayCast ); |
|
1199 |
|
1200 CleanupStack::PopAndDestroy(); //m3gVertextArray |
|
1201 } |
|
1202 |
|
1203 // --------------------------------------------------------------------------- |
|
1204 // CBCTestDomM3gCase::TestRM3GTriangleStripArrayL |
|
1205 // --------------------------------------------------------------------------- |
|
1206 // |
|
1207 void CBCTestDomM3gCase::TestRM3GTriangleStripArrayL() |
|
1208 { |
|
1209 //Test APIS of class RM3GTriangleStripArray as follow. |
|
1210 RM3GTriangleStripArray m3gStripArray; |
|
1211 CleanupClosePushL( m3gStripArray ); |
|
1212 _LIT( KRM3GTSA, "RM3GTriangleStripArray::RM3GTriangleStripArray()" ); |
|
1213 AssertTrueL( ETrue, KRM3GTSA ); |
|
1214 |
|
1215 TInt indices[] = { 4, 1, 0, 3 }; |
|
1216 TInt indexCount = 4; |
|
1217 TInt stripLengths[] = { 3, 3 }; |
|
1218 TInt stripLengthCount = 2; |
|
1219 TInt firstIndex = 1; |
|
1220 m3gStripArray.OpenL( firstIndex, |
|
1221 stripLengths, |
|
1222 stripLengthCount ); |
|
1223 _LIT( KRM3GTSAOpenLOver, "RM3GTriangleStripArray::OpenL()" ); |
|
1224 AssertTrueL( ETrue, KRM3GTSAOpenLOver ); |
|
1225 |
|
1226 |
|
1227 RM3GTriangleStripArray m3gStripArray2; |
|
1228 CleanupClosePushL( m3gStripArray2 ); |
|
1229 TInt err; |
|
1230 TRAP( err, m3gStripArray2.OpenL( indices, |
|
1231 indexCount, |
|
1232 stripLengths, |
|
1233 stripLengthCount ) ); |
|
1234 _LIT( KRM3GTSAOpenL, "RM3GTriangleStripArray::OpenL()" ); |
|
1235 AssertTrueL( ETrue, KRM3GTSAOpenL ); |
|
1236 |
|
1237 CleanupStack::PopAndDestroy( 2 ); //m3gStripArray, m3gStripArray2 |
|
1238 } |
|
1239 |
|
1240 // --------------------------------------------------------------------------- |
|
1241 // CBCTestDomM3gCase::TestRM3GIndexBufferL |
|
1242 // --------------------------------------------------------------------------- |
|
1243 // |
|
1244 void CBCTestDomM3gCase::TestRM3GIndexBufferL() |
|
1245 { |
|
1246 //Test APIS of class RM3GIndexBuffer as follow. |
|
1247 RM3GIndexBuffer m3gIndexBuffer; |
|
1248 CleanupClosePushL( m3gIndexBuffer ); |
|
1249 _LIT( KRM3GIB, "RM3GIndexBuffer::RM3GIndexBuffer()" ); |
|
1250 AssertTrueL( ETrue, KRM3GIB ); |
|
1251 |
|
1252 TInt indices[] = { 4, 1, 0, 3 }; |
|
1253 TInt indexCount = 4; |
|
1254 TInt stripLengths[] = { 3, 3 }; |
|
1255 TInt stripLengthCount = 2; |
|
1256 TInt firstIndex = 1; |
|
1257 m3gIndexBuffer.OpenL( firstIndex, stripLengths, stripLengthCount ); |
|
1258 _LIT( KRM3GIndexBufferOpenL, "RM3GIndexBuffer::OpenL()" ); |
|
1259 AssertTrueL( ETrue, KRM3GIndexBufferOpenL ); |
|
1260 |
|
1261 RM3GIndexBuffer m3gIndexBuffer2; |
|
1262 CleanupClosePushL( m3gIndexBuffer2 ); |
|
1263 TInt err; |
|
1264 TRAP( err, m3gIndexBuffer2.OpenL( indices, |
|
1265 indexCount, |
|
1266 stripLengths, |
|
1267 stripLengthCount ) ); |
|
1268 _LIT( KRM3GIBOpenL, "RM3GIndexBuffer::OpenL()" ); |
|
1269 AssertTrueL( ETrue, KRM3GIBOpenL ); |
|
1270 |
|
1271 |
|
1272 CleanupStack::PopAndDestroy( 2 ); //m3gIndexBuffer, m3gIndexBuffer2 |
|
1273 } |
|
1274 |
|
1275 // --------------------------------------------------------------------------- |
|
1276 // CBCTestDomM3gCase::TestRM3GAnimationControllerL |
|
1277 // --------------------------------------------------------------------------- |
|
1278 // |
|
1279 void CBCTestDomM3gCase::TestRM3GAnimationControllerL() |
|
1280 { |
|
1281 RM3GAnimationController m3gAC; |
|
1282 CleanupClosePushL( m3gAC ); |
|
1283 _LIT( KRM3GAC, "RM3GAnimationController::RM3GAnimationController()" ); |
|
1284 AssertTrueL( ETrue, KRM3GAC ); |
|
1285 |
|
1286 m3gAC.OpenL(); |
|
1287 _LIT( KRM3GACOpenL, "RM3GAnimationController::OpenL()" ); |
|
1288 AssertTrueL( ETrue, KRM3GACOpenL ); |
|
1289 |
|
1290 TInt start = m3gAC.ActiveIntervalStart(); |
|
1291 _LIT( KRM3GACActiveIntervalStart, |
|
1292 "RM3GAnimationController::ActiveIntervalStart()" ); |
|
1293 AssertTrueL( ETrue, KRM3GACActiveIntervalStart ); |
|
1294 |
|
1295 TInt end = m3gAC.ActiveIntervalEnd(); |
|
1296 _LIT( KRM3GACActiveIntervalEnd, |
|
1297 "RM3GAnimationController::ActiveIntervalEnd()" ); |
|
1298 AssertTrueL( ETrue, KRM3GACActiveIntervalEnd ); |
|
1299 |
|
1300 TInt minT = 1; |
|
1301 TInt maxT = 10; |
|
1302 m3gAC.SetActiveInterval( minT, maxT ); |
|
1303 _LIT( KRM3GACSetActiveInterval, |
|
1304 "RM3GAnimationController::SetActiveInterval()" ); |
|
1305 AssertTrueL( ETrue, KRM3GACSetActiveInterval ); |
|
1306 |
|
1307 TReal speed = m3gAC.Speed(); |
|
1308 _LIT( KRM3GACSpeed, "RM3GAnimationController::Speed()" ); |
|
1309 AssertTrueL( ETrue, KRM3GACSpeed ); |
|
1310 |
|
1311 TInt worldTime = 10; |
|
1312 m3gAC.SetSpeed( speed, worldTime ); |
|
1313 _LIT( KRM3GACSetSpeed, "RM3GAnimationController::SetSpeed()" ); |
|
1314 AssertTrueL( ETrue, KRM3GACSetSpeed ); |
|
1315 |
|
1316 m3gAC.Position( worldTime ); |
|
1317 _LIT( KRM3GACPosition, "RM3GAnimationController::Position()" ); |
|
1318 AssertTrueL( ETrue, KRM3GACPosition ); |
|
1319 |
|
1320 TReal32 sTime = 5.00; |
|
1321 m3gAC.SetPosition( sTime, worldTime ); |
|
1322 _LIT( KRM3GACSetPosition, "RM3GAnimationController::SetPosition()" ); |
|
1323 AssertTrueL( ETrue, KRM3GACSetPosition ); |
|
1324 |
|
1325 TReal weight = m3gAC.Weight(); |
|
1326 _LIT( KRM3GACWeight, "RM3GAnimationController::Weight()" ); |
|
1327 AssertTrueL( ETrue, KRM3GACWeight ); |
|
1328 |
|
1329 m3gAC.SetWeight( weight ); |
|
1330 _LIT( KRM3GACSetWeight, "RM3GAnimationController::SetWeight()" ); |
|
1331 AssertTrueL( ETrue, KRM3GACSetWeight ); |
|
1332 |
|
1333 m3gAC.Cast( m3gAC ); |
|
1334 _LIT( KRM3GACCast, "RM3GAnimationController::Cast()" ); |
|
1335 AssertTrueL( ETrue, KRM3GACCast ); |
|
1336 |
|
1337 CleanupStack::PopAndDestroy(); //m3gAC |
|
1338 |
|
1339 //Test APIS of class RM3GAnimationTrack as follow. |
|
1340 RM3GAnimationTrack m3gAnimationT; |
|
1341 CleanupClosePushL( m3gAnimationT ); |
|
1342 _LIT( KRM3GAT, "RM3GAnimationTrack::RM3GAnimationTrack()" ); |
|
1343 AssertTrueL( ETrue, KRM3GAT ); |
|
1344 |
|
1345 RM3GKeyframeSequence m3gKeyframeSequence; |
|
1346 CleanupClosePushL( m3gKeyframeSequence ); |
|
1347 const TInt keyframeCount = 1; |
|
1348 const TInt componentCount = 1; |
|
1349 m3gKeyframeSequence.OpenL( keyframeCount, |
|
1350 componentCount, |
|
1351 RM3GKeyframeSequence::ELinear ); |
|
1352 m3gAnimationT.OpenL( m3gKeyframeSequence, RM3GAnimationTrack::EDensity ); |
|
1353 _LIT( KRM3GATOpenL, "RM3GAnimationTrack::OpenL()" ); |
|
1354 AssertTrueL( ETrue, KRM3GATOpenL ); |
|
1355 |
|
1356 RM3GAnimationController copyAController = m3gAnimationT.Controller(); |
|
1357 CleanupClosePushL( copyAController ); |
|
1358 _LIT( KRM3GATController, "RM3GAnimationTrack::Controller()" ); |
|
1359 AssertTrueL( ETrue, KRM3GATController ); |
|
1360 |
|
1361 m3gAnimationT.SetController( copyAController ); |
|
1362 _LIT( KRM3GATSetController, "RM3GAnimationTrack::SetController()" ); |
|
1363 AssertTrueL( ETrue, KRM3GATSetController ); |
|
1364 |
|
1365 m3gAnimationT.KeyframeSequence(); |
|
1366 _LIT( KRM3GATKeyframeSequence, "RM3GAnimationTrack::KeyframeSequence()" ); |
|
1367 AssertTrueL( ETrue, KRM3GATKeyframeSequence ); |
|
1368 |
|
1369 m3gAnimationT.TargetProperty(); |
|
1370 _LIT( KRM3GATTargetProperty, "RM3GAnimationTrack::TargetProperty()" ); |
|
1371 AssertTrueL( ETrue, KRM3GATTargetProperty ); |
|
1372 |
|
1373 m3gAnimationT.Cast( m3gAnimationT ); |
|
1374 _LIT( KRM3GATCast, "RM3GAnimationTrack::Cast()" ); |
|
1375 AssertTrueL( ETrue, KRM3GATCast ); |
|
1376 |
|
1377 //m3gAnimationT, copyAController, m3gKeyframeSequence. |
|
1378 CleanupStack::PopAndDestroy( 3 ); |
|
1379 } |
|
1380 |
|
1381 // --------------------------------------------------------------------------- |
|
1382 // CBCTestDomM3gCase::TestRM3GImageL |
|
1383 // --------------------------------------------------------------------------- |
|
1384 // |
|
1385 void CBCTestDomM3gCase::TestRM3GImageL() |
|
1386 { |
|
1387 RM3GImage m3gImage; |
|
1388 CleanupClosePushL( m3gImage ); |
|
1389 _LIT( KRM3GImage, "RM3GImage::RM3GImage()" ); |
|
1390 AssertTrueL( ETrue, KRM3GImage ); |
|
1391 |
|
1392 TInt imageWidth = 20; |
|
1393 TInt imageHeight = 20; |
|
1394 TInt flag = 8; |
|
1395 m3gImage.OpenL( RM3GImage::ELuminance, |
|
1396 imageWidth, |
|
1397 imageHeight, |
|
1398 flag ); |
|
1399 _LIT( KRM3GImageOpenL, "RM3GImage::OpenL()" ); |
|
1400 AssertTrueL( ETrue, KRM3GImageOpenL ); |
|
1401 |
|
1402 TUint param = 4029; |
|
1403 m3gImage.SetImage( ¶m ); |
|
1404 _LIT( KRM3GImageSetImage, "RM3GImage::SetImage()" ); |
|
1405 AssertTrueL( ETrue, KRM3GImageSetImage ); |
|
1406 |
|
1407 |
|
1408 const TUint32 color16array[16] = { |
|
1409 0x00000000,0x00555555,0x00000080,0x00008080, |
|
1410 0x00008000,0x000000ff,0x0000ffff,0x0000ff00, |
|
1411 0x00ff00ff,0x00ff0000,0x00ffff00,0x00800080, |
|
1412 0x00800000,0x00808000,0x00aaaaaa,0x00ffffff}; |
|
1413 |
|
1414 TInt paletteLength = 16; |
|
1415 m3gImage.SetImagePalette( paletteLength, color16array ); |
|
1416 _LIT( KRM3GImageSetImagePalette, "RM3GImage::SetImagePalette()" ); |
|
1417 AssertTrueL( ETrue, KRM3GImageSetImagePalette ); |
|
1418 |
|
1419 TInt line = 1; |
|
1420 TBool trueAlpha = EFalse; |
|
1421 m3gImage.SetImageScanLine( line, trueAlpha, ¶m ); |
|
1422 _LIT( KRM3GImageSetImageScanLine, "RM3GImage::SetImageScanLine()" ); |
|
1423 AssertTrueL( ETrue, KRM3GImageSetImageScanLine ); |
|
1424 |
|
1425 TInt x = 0; |
|
1426 TInt y = 0; |
|
1427 m3gImage.SetSubImage( x, y, imageWidth, |
|
1428 imageHeight, paletteLength, ¶m ); |
|
1429 _LIT( KRM3GImageSetSubImage, "RM3GImage::SetSubImage()" ); |
|
1430 AssertTrueL( ETrue, KRM3GImageSetSubImage ); |
|
1431 |
|
1432 m3gImage.Format(); |
|
1433 _LIT( KRM3GImageFormat, "RM3GImage::Format()" ); |
|
1434 AssertTrueL( ETrue, KRM3GImageFormat ); |
|
1435 |
|
1436 m3gImage.Height(); |
|
1437 _LIT( KRM3GImageHeight, "RM3GImage::Height()" ); |
|
1438 AssertTrueL( ETrue, KRM3GImageHeight ); |
|
1439 |
|
1440 m3gImage.Width(); |
|
1441 _LIT( KRM3GImageWidth, "RM3GImage::Width()" ); |
|
1442 AssertTrueL( ETrue, KRM3GImageWidth ); |
|
1443 |
|
1444 m3gImage.IsMutable(); |
|
1445 _LIT( KRM3GImageIsMutable, "RM3GImage::IsMutable()" ); |
|
1446 AssertTrueL( ETrue, KRM3GImageIsMutable ); |
|
1447 |
|
1448 m3gImage.Cast( m3gImage ); |
|
1449 _LIT( KRM3GImageCast, "RM3GImage::Cast()" ); |
|
1450 AssertTrueL( ETrue, KRM3GImageCast); |
|
1451 |
|
1452 CleanupStack::PopAndDestroy();//m3gImage |
|
1453 } |
|
1454 |
|