aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/ps__quad_8cpp-source.html
blob: a11d189e342c56afeee9af69b8e93db1249b4b34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
	<TITLE>nevrax.org : docs</TITLE>
	<LINK REL=stylesheet TYPE="text/css" HREF="/inc/css/nevrax.css">
	<link href="doxygen.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY MARGINHEIGHT="0" MARGINWIDTH="0">

<!-- uplinks -->
<TABLE CELLSPACING=0 CELLPADDING=0  BORDER=0>
 <TR>
        <TD WIDTH=16><IMG  SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
        <TD WIDTH=140 BGCOLOR=#dddddd><IMG  SRC="/inc/img/pixel.gif" WIDTH="140" HEIGHT="16" BORDER=0 ALT=""></TD>
        <TD WIDTH=16><IMG  SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
        <TD><IMG width=6 height=14 SRC="/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle>&nbsp;<A CLASS=uplinks HREF=><b>Home</B></FONT></A>&nbsp;&nbsp;&nbsp;</TD>
        <TD><IMG  width=6 height=14  SRC="/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle>&nbsp;<A CLASS=uplinks HREF=http://www.nevrax.com><b>nevrax.com</B></FONT></A>&nbsp;&nbsp;&nbsp;</TD>
 </TR>
</TABLE> 

<!-- banner Nevrax -->
<TABLE CELLSPACING=0 CELLPADDING=0  BORDER=0 WIDTH=100%>
 <TR><TD  BGCOLOR="#000000" BACKGROUND="/inc/img/black_banner.jpg"><A HREF=""><IMG  SRC="/inc/img/nevrax.gif" WIDTH="170" HEIGHT="45" BORDER=0 ALT="Nevrax" ></A></TD></TR>
</TABLE>

<!-- main table -->
<TABLE CELLSPACING=0 CELLPADDING=0  BORDER=0 height=100%>
 <TR>
	<TD WIDTH=16><IMG  SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="10" BORDER=0 ALT=""></TD>
	<TD WIDTH=140   BGCOLOR=#dddddd VALIGN=TOP ALIGN=middle><IMG  SRC="/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT="">

		<!------ Begin Box ------>
		<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=black><TR><TD><TABLE border=0  cellspacing=2 cellpadding=0 width=120><tr><TD ALIGN=middle bgcolor=black>
		<FONT COLOR=white FACE="sans-serif"><B>Nevrax.org</B></FONT></TD></TR><tr><td  colspan=2 bgcolor=#FFFFFF>
		<TABLE cellspacing=0 cellpadding=1 border=0>
			<tr><td ALIGN=middle><a  class='linkbox' href="/news/" TITLE="Rubrique news"><img width=13 height=15  hspace=5 border=0 src=/inc/img/picto-news.gif ALT=#></A></td><td><a  class='linkbox' href="/news/" TITLE="News">News</a></td></tr>
			<tr><td ALIGN=middle><a  class='linkbox' href="/mail/" TITLE="Rubrique mail"><img width=15 height=11  hspace=5 border=0 src=/inc/img/picto-mail.gif ALT=#></A></td><td><a  class='linkbox' href="/mail/" TITLE="Mailing list archive">Mailing-list</a></td></tr>
			<tr><td ALIGN=middle><a  class='linkbox' href="/docs/" TITLE="Rubrique docs"><img width=14 height=16  hspace=5 border=0 src=/inc/img/picto-docs.gif ALT=#></A></td><td><a  class='linkbox' href="/docs/" TITLE="Documentation">Documentation</a></td></tr>
			<tr><td ALIGN=middle><a  class='linkbox' href="/cvs/" TITLE="Rubrique cvs"><img width=13 height=17  hspace=5 border=0 src=/inc/img/picto-cvs.gif ALT=#></A></td><td><a  class='linkbox' href="/cvs/" TITLE="CVS Web">CVS</a></td></tr>
			<tr><td ALIGN=middle><a  class='linkbox' href="/bugs/" TITLE="Rubrique bugs"><img width=20 height=16  hspace=5 border=0 src=/inc/img/picto-bugs.gif ALT=#></A></td><td><a  class='linkbox' href="/bugs/" TITLE="Bugtracking">Bugs</a></td></tr>
			<tr><td ALIGN=middle><a  class='linkbox' href="/GPL.php3" TITLE="Rubrique license"><img  width=18 height=12   hspace=5 border=0 src=/inc/img/picto-gpl.gif ALT=#></A></td><td><a  class='linkbox' href="/GPL.php3" TITLE="License">License</a></td></tr>
		</TABLE>
		</TD></TR></TABLE></TD></TR></TABLE>
		<!------ End Box  ------>

	</TD>
	<TD WIDTH=15><IMG  SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
	<TD ALIGN=left valign=top><IMG  SRC="/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT="">

<!-- title -->
<TABLE  background="/inc/img/redline.gif" CELLSPACING=0 CELLPADDING=0  BORDER=0 width=100%><tr><td>
<A HREF="/docs/"><img src="/inc/img/t_docs.gif" ALT="Docs" HEIGHT=20 BORDER=0></A>
</td><td><IMG  SRC="/inc/img/pixel.gif" WIDTH="1" HEIGHT="1" BORDER=0 ALT="">
</td></tr></table>
&nbsp;

<!-- block -->
<TABLE  bgcolor="#dddddd" CELLSPACING=0 CELLPADDING=0  BORDER=0 width=100%><tr><td width=1% valign=middle><img width=6 height=14 hspace=2 vspace=2 src="/inc/img/reddots.gif"></TD>
	<TD><B>Documentation</B></TD>
	<TD ALIGN=RIGHT>&nbsp;</td>
</tr></table>
<!-- Generated by Doxygen 1.2.14 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="namespacemembers.html">Namespace Members</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; <a class="qindexRef" doxygen="_cgi:/cgi-bin/nel-search.cgi" href="/cgi-bin/nel-search.cgi">Search</a> &nbsp; </center>
<hr><h1>ps_quad.cpp</h1><a href="ps__quad_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 
00007 <font class="comment">/* Copyright, 2001 Nevrax Ltd.</font>
00008 <font class="comment"> *</font>
00009 <font class="comment"> * This file is part of NEVRAX NEL.</font>
00010 <font class="comment"> * NEVRAX NEL is free software; you can redistribute it and/or modify</font>
00011 <font class="comment"> * it under the terms of the GNU General Public License as published by</font>
00012 <font class="comment"> * the Free Software Foundation; either version 2, or (at your option)</font>
00013 <font class="comment"> * any later version.</font>
00014 <font class="comment"></font>
00015 <font class="comment"> * NEVRAX NEL is distributed in the hope that it will be useful, but</font>
00016 <font class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</font>
00017 <font class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</font>
00018 <font class="comment"> * General Public License for more details.</font>
00019 <font class="comment"></font>
00020 <font class="comment"> * You should have received a copy of the GNU General Public License</font>
00021 <font class="comment"> * along with NEVRAX NEL; see the file COPYING. If not, write to the</font>
00022 <font class="comment"> * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,</font>
00023 <font class="comment"> * MA 02111-1307, USA.</font>
00024 <font class="comment"> */</font>
00025 
00026 <font class="preprocessor">#include "<a class="code" href="std3d_8h.html">std3d.h</a>"</font>
00027 
00028 <font class="preprocessor">#include "<a class="code" href="ps__quad_8h.html">3d/ps_quad.h</a>"</font>
00029 <font class="preprocessor">#include "<a class="code" href="ps__macro_8h.html">3d/ps_macro.h</a>"</font>
00030 <font class="preprocessor">#include "<a class="code" href="driver_8h.html">3d/driver.h</a>"</font>
00031 <font class="preprocessor">#include "<a class="code" href="ps__attrib__maker_8h.html">3d/ps_attrib_maker.h</a>"</font>
00032 <font class="preprocessor">#include "<a class="code" href="texture__grouped_8h.html">3d/texture_grouped.h</a>"</font>
00033 <font class="preprocessor">#include "<a class="code" href="particle__system_8h.html">3d/particle_system.h</a>"</font>
00034 <font class="preprocessor">#include "<a class="code" href="ps__iterator_8h.html">3d/ps_iterator.h</a>"</font>
00035 
00036 <font class="keyword">namespace </font>NL3D 
00037 {
00038 
00039 
00040 
00042 <font class="comment">// constant definition   //</font>
00044 <font class="comment"></font>
00045 
00046 <font class="keyword">static</font> <font class="keyword">const</font> uint <a class="code" href="namespaceNL3D.html#a188">dotBufSize</a> = 1024; <font class="comment">// size used for point particles batching</font>
00047 
00049 <font class="comment">// vertex buffers //</font>
00051 <font class="comment"></font>
<a name="l00053"></a><a class="code" href="classNL3D_1_1CPSQuad.html#q0">00053</a> <font class="comment">CVertexBuffer CPSQuad::_VBPos;</font>
<a name="l00054"></a><a class="code" href="classNL3D_1_1CPSQuad.html#q1">00054</a> CVertexBuffer CPSQuad::_VBPosCol;
<a name="l00055"></a><a class="code" href="classNL3D_1_1CPSQuad.html#q2">00055</a> CVertexBuffer CPSQuad::_VBPosTex1;
<a name="l00056"></a><a class="code" href="classNL3D_1_1CPSQuad.html#q3">00056</a> CVertexBuffer CPSQuad::_VBPosTex1Col;                           
<a name="l00057"></a><a class="code" href="classNL3D_1_1CPSQuad.html#q4">00057</a> CVertexBuffer CPSQuad::_VBPosTex1Anim;
<a name="l00058"></a><a class="code" href="classNL3D_1_1CPSQuad.html#q5">00058</a> CVertexBuffer CPSQuad::_VBPosTex1AnimCol;
00059 <font class="comment">//==========</font>
<a name="l00060"></a><a class="code" href="classNL3D_1_1CPSQuad.html#q6">00060</a> CVertexBuffer CPSQuad::_VBPosTex1Tex2;
<a name="l00061"></a><a class="code" href="classNL3D_1_1CPSQuad.html#q7">00061</a> CVertexBuffer CPSQuad::_VBPosTex1ColTex2;       
<a name="l00062"></a><a class="code" href="classNL3D_1_1CPSQuad.html#q8">00062</a> CVertexBuffer CPSQuad::_VBPosTex1AnimTex2;
<a name="l00063"></a><a class="code" href="classNL3D_1_1CPSQuad.html#q9">00063</a> CVertexBuffer CPSQuad::_VBPosTex1AnimColTex2;
00064 <font class="comment">//==========</font>
<a name="l00065"></a><a class="code" href="classNL3D_1_1CPSQuad.html#q10">00065</a> CVertexBuffer CPSQuad::_VBPosTex1Tex2Anim;
<a name="l00066"></a><a class="code" href="classNL3D_1_1CPSQuad.html#q11">00066</a> CVertexBuffer CPSQuad::_VBPosTex1ColTex2Anim;   
<a name="l00067"></a><a class="code" href="classNL3D_1_1CPSQuad.html#q12">00067</a> CVertexBuffer CPSQuad::_VBPosTex1AnimTex2Anim;
<a name="l00068"></a><a class="code" href="classNL3D_1_1CPSQuad.html#q13">00068</a> CVertexBuffer CPSQuad::_VBPosTex1AnimColTex2Anim;
00069         
00070 CVertexBuffer    * <font class="keyword">const</font> CPSQuad::_VbTab[] = 
00071 { 
00072   <font class="comment">// tex1 only</font>
00073   &amp;_VBPos, &amp;_VBPosCol, &amp;_VBPosTex1,  &amp;_VBPosTex1Col,
00074   NULL,   NULL,          &amp;_VBPosTex1Anim, &amp;_VBPosTex1AnimCol,
00075   <font class="comment">// tex1 &amp; tex2</font>
00076   NULL, NULL, &amp;_VBPosTex1Tex2, &amp;_VBPosTex1ColTex2,
00077   NULL,   NULL,          &amp;_VBPosTex1AnimTex2, &amp;_VBPosTex1AnimColTex2,
00078   <font class="comment">// tex2 &amp; !tex1 (invalid)</font>
00079   NULL, NULL, NULL, NULL,
00080   NULL, NULL, NULL, NULL,
00081   <font class="comment">// tex2 &amp; !tex1 (invalid)</font>
00082   <font class="comment">// tex1 &amp; tex2</font>
00083   NULL, NULL, &amp;_VBPosTex1Tex2Anim, &amp;_VBPosTex1ColTex2Anim,
00084   NULL,   NULL,          &amp;_VBPosTex1AnimTex2Anim, &amp;_VBPosTex1AnimColTex2Anim,
00085 };
00086 
00087 
00088   
00089 
00090 
00092 <font class="comment">// CPSQuad implementation       //</font>
00094 <font class="comment"></font>
00095 
00098 <font class="keyword">static</font> <font class="keywordtype">void</font> <a class="code" href="namespaceNL3D.html#a442">SetupQuadVBTexCoords</a>(CVertexBuffer &amp;vb, uint texCoordSet)
00099 {
00100         <a class="code" href="debug_8h.html#a6">nlassert</a>(texCoordSet &lt; 2);
00101         <font class="comment">// the size used for buffer can't be higher than quad buf size</font>
00102         <font class="comment">// to have too large buffer will broke the cache</font>
00103         <font class="keywordflow">for</font> (uint32 k = 0; k &lt; CPSQuad::quadBufSize; ++k)
00104         {               
00105 
00106                 vb.setTexCoord(k * 4, texCoordSet, CUV(0, 0));
00107                 vb.setTexCoord(k * 4 + 1, texCoordSet, CUV(1, 0));
00108                 vb.setTexCoord(k * 4 + 2, texCoordSet, CUV(1, 1));
00109                 vb.setTexCoord(k * 4 + 3, texCoordSet, CUV(0, 1));      
00110         }               
00111 }
00112 
<a name="l00115"></a><a class="code" href="classNL3D_1_1CPSQuad.html#d0">00115</a> <font class="keywordtype">void</font> CPSQuad::initVertexBuffers()
00116 {
00117         <font class="keywordflow">for</font> (uint k = 0; k &lt; 32; ++k)
00118         {
00119                 CVertexBuffer *vb = _VbTab[k];
00120                 <font class="keywordflow">if</font> (_VbTab[k]) <font class="comment">// valid vb ?</font>
00121                 {
00122                         uint32 vf = CVertexBuffer::PositionFlag;
00124                         <font class="keywordflow">if</font> (k &amp; (uint) <a class="code" href="classNL3D_1_1CPSQuad.html#t5t0">VBCol</a>) vf |= CVertexBuffer::PrimaryColorFlag;
00125                         <font class="keywordflow">if</font> (k &amp; (uint) <a class="code" href="classNL3D_1_1CPSQuad.html#t5t1">VBTex</a>  || k &amp; (uint) <a class="code" href="classNL3D_1_1CPSQuad.html#t5t2">VBTexAnimated</a>) vf |= CVertexBuffer::TexCoord0Flag;
00126                         <font class="keywordflow">if</font> (k &amp; (uint) <a class="code" href="classNL3D_1_1CPSQuad.html#t5t3">VBTex2</a> || k &amp; (uint) <a class="code" href="classNL3D_1_1CPSQuad.html#t5t4">VBTex2Animated</a>) vf |= CVertexBuffer::TexCoord1Flag;
00127                         vb-&gt;setVertexFormat(vf);
00128                         vb-&gt;setNumVertices(<a class="code" href="classNL3D_1_1CPSQuad.html#s1s0">quadBufSize</a> &lt;&lt; 2);
00129 
00130                         <font class="keywordflow">if</font> ((k &amp; (uint) <a class="code" href="classNL3D_1_1CPSQuad.html#t5t1">VBTex</a>) &amp;&amp; !(k &amp; (uint) <a class="code" href="classNL3D_1_1CPSQuad.html#t5t2">VBTexAnimated</a>))
00131                         {
00132                                 <a class="code" href="namespaceNL3D.html#a442">SetupQuadVBTexCoords</a>(*vb, 0);
00133                         }
00134 
00135                         <font class="keywordflow">if</font> ((k &amp; (uint) <a class="code" href="classNL3D_1_1CPSQuad.html#t5t3">VBTex2</a>) &amp;&amp; !(k &amp; (uint) <a class="code" href="classNL3D_1_1CPSQuad.html#t5t4">VBTex2Animated</a>))
00136                         {
00137                                 <a class="code" href="namespaceNL3D.html#a442">SetupQuadVBTexCoords</a>(*vb, 1);
00138                         }
00139                         
00140                 }
00141         }
00142 }
00143 
<a name="l00146"></a><a class="code" href="classNL3D_1_1CPSQuad.html#b14">00146</a> CVertexBuffer &amp;CPSQuad::getNeededVB()
00147 {
00148         uint flags = 0;
00149         <font class="keywordflow">if</font> (_ColorScheme) flags |= (uint) <a class="code" href="classNL3D_1_1CPSQuad.html#t5t0">VBCol</a>;
00150         <font class="keywordflow">if</font> (_TexGroup)
00151         {
00152                 flags |= <a class="code" href="classNL3D_1_1CPSQuad.html#t5t1">VBTex</a> | <a class="code" href="classNL3D_1_1CPSQuad.html#t5t2">VBTexAnimated</a>;
00153         }
00154         <font class="keywordflow">else</font> <font class="keywordflow">if</font> (_Tex)
00155         {
00156 
00157                 flags |= <a class="code" href="classNL3D_1_1CPSQuad.html#t5t1">VBTex</a>;
00158                 
00160                 <font class="keywordflow">if</font> (CPSMultiTexturedParticle::isMultiTextureEnabled())
00161                 {
00162                         <font class="keywordflow">if</font> (!<a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#b1">isAlternateTextureUsed</a>())
00163                         {
00164                                 <font class="keywordflow">if</font> ((flags &amp; <a class="code" href="classNL3D_1_1CPSQuad.html#t5t1">VBTex</a>) &amp;&amp; (<a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n4">_TexScroll</a>[0].<a class="code" href="classNLMISC_1_1CVector2f.html#m0">x</a> != 0 || <a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n4">_TexScroll</a>[0].<a class="code" href="classNLMISC_1_1CVector2f.html#m1">y</a> != 0)) flags |= <a class="code" href="classNL3D_1_1CPSQuad.html#t5t2">VBTexAnimated</a>;
00165                                 <font class="keywordflow">if</font> (_Texture2)
00166                                 {                               
00167                                         <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n0">_MainOp</a> != <a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#s5s2">Decal</a> &amp;&amp; (<a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n4">_TexScroll</a>[1].<a class="code" href="classNLMISC_1_1CVector2f.html#m0">x</a> != 0 || <a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n4">_TexScroll</a>[1].<a class="code" href="classNLMISC_1_1CVector2f.html#m1">y</a> != 0))
00168                                         {
00169                                                 flags |= <a class="code" href="classNL3D_1_1CPSQuad.html#t5t3">VBTex2</a> | <a class="code" href="classNL3D_1_1CPSQuad.html#t5t4">VBTex2Animated</a>;
00170                                         }
00171                                         <font class="keywordflow">else</font>
00172                                         {
00173                                                 flags |= <a class="code" href="classNL3D_1_1CPSQuad.html#t5t3">VBTex2</a>;
00174                                         }
00175                                 }
00176                         }
00177                         <font class="keywordflow">else</font>
00178                         {
00179                                 <font class="keywordflow">if</font> ((flags &amp; <a class="code" href="classNL3D_1_1CPSQuad.html#t5t1">VBTex</a>) &amp;&amp; (<a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n5">_TexScrollAlternate</a>[0].<a class="code" href="classNLMISC_1_1CVector2f.html#m0">x</a> != 0 || <a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n5">_TexScrollAlternate</a>[0].<a class="code" href="classNLMISC_1_1CVector2f.html#m1">y</a>       != 0)) flags |= <a class="code" href="classNL3D_1_1CPSQuad.html#t5t2">VBTexAnimated</a>;
00180                                 <font class="keywordflow">if</font> (_AlternateTexture2)
00181                                 {                               
00182                                         <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n1">_AlternateOp</a> != <a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#s5s2">Decal</a> &amp;&amp; (<a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n5">_TexScrollAlternate</a>[1].<a class="code" href="classNLMISC_1_1CVector2f.html#m0">x</a> != 0 || <a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n5">_TexScrollAlternate</a>[1].<a class="code" href="classNLMISC_1_1CVector2f.html#m1">y</a> != 0)) 
00183                                         {
00184                                                 flags |= <a class="code" href="classNL3D_1_1CPSQuad.html#t5t3">VBTex2</a> | <a class="code" href="classNL3D_1_1CPSQuad.html#t5t4">VBTex2Animated</a>;
00185                                         }
00186                                         <font class="keywordflow">else</font>
00187                                         {
00188                                                 flags |= <a class="code" href="classNL3D_1_1CPSQuad.html#t5t3">VBTex2</a>;
00189                                         }
00190                                 }
00191                         }
00192                 }
00193         }
00194         <a class="code" href="debug_8h.html#a6">nlassert</a>(_VbTab[flags] != NULL);
00195         <font class="keywordflow">return</font> *(_VbTab[flags]); <font class="comment">// get the vb</font>
00196 }
00197 
<a name="l00199"></a><a class="code" href="classNL3D_1_1CPSQuad.html#a0">00199</a> CPSQuad::CPSQuad(CSmartPtr&lt;ITexture&gt; tex)
00200 {
00201         <a class="code" href="classNL3D_1_1CPSTexturedParticle.html#a8">setTexture</a>(tex);
00202         <a class="code" href="classNL3D_1_1CPSQuad.html#b1">init</a>();
00203         <font class="comment">// we don't init the _IndexBuffer for now, as it will be when resize is called</font>
00204         <a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n3">_Name</a> = std::string(<font class="stringliteral">"quad"</font>);
00205 }
00206 
00207 
<a name="l00209"></a><a class="code" href="classNL3D_1_1CPSQuad.html#b0">00209</a> CPSQuad::~CPSQuad()
00210 {
00211 }
00212 
<a name="l00214"></a><a class="code" href="classNL3D_1_1CPSQuad.html#a3">00214</a> uint32 CPSQuad::getMaxNumFaces(<font class="keywordtype">void</font>)<font class="keyword"> const</font>
00215 <font class="keyword"></font>{
00216         <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>);
00217         <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>-&gt;getMaxSize() &lt;&lt; 1;
00218 }
00219 
<a name="l00221"></a><a class="code" href="classNL3D_1_1CPSQuad.html#a1">00221</a> <font class="keywordtype">bool</font> CPSQuad::hasTransparentFaces(<font class="keywordtype">void</font>)
00222 {
00223         <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CPSMaterial.html#a3">getBlendingMode</a>() != CPSMaterial::alphaTest ;
00224 }
00225 
<a name="l00227"></a><a class="code" href="classNL3D_1_1CPSQuad.html#a2">00227</a> <font class="keywordtype">bool</font> CPSQuad::hasOpaqueFaces(<font class="keywordtype">void</font>)
00228 {
00229         <font class="keywordflow">return</font> !<a class="code" href="classNL3D_1_1CPSQuad.html#a1">hasTransparentFaces</a>();
00230 }
00231 
<a name="l00233"></a><a class="code" href="classNL3D_1_1CPSQuad.html#b1">00233</a> <font class="keywordtype">void</font> CPSQuad::init(<font class="keywordtype">void</font>)
00234 {       
00235         <a class="code" href="classNL3D_1_1CPSMaterial.html#n0">_Mat</a>.setLighting(<font class="keyword">false</font>);        
00236         <a class="code" href="classNL3D_1_1CPSMaterial.html#n0">_Mat</a>.setZFunc(CMaterial::less);
00237         <a class="code" href="classNL3D_1_1CPSMaterial.html#n0">_Mat</a>.setDoubleSided(<font class="keyword">true</font>);
00238 
00239 
00240         <a class="code" href="classNL3D_1_1CPSQuad.html#b2">updateMatAndVbForColor</a>();
00241         <a class="code" href="classNL3D_1_1CPSQuad.html#b3">updateMatAndVbForTexture</a>();
00242 }
00243 
<a name="l00245"></a><a class="code" href="classNL3D_1_1CPSQuad.html#b3">00245</a> <font class="keywordtype">void</font> CPSQuad::updateMatAndVbForTexture(<font class="keywordtype">void</font>)
00246 {       
00247         <font class="keywordflow">if</font> (CPSMultiTexturedParticle::isMultiTextureEnabled())
00248         {
00249                 <a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#b3">touch</a>();
00250         }
00251         <font class="keywordflow">else</font>
00252         {
00253                 <a class="code" href="classNL3D_1_1CPSMaterial.html#n0">_Mat</a>.setTexture(0, <a class="code" href="classNL3D_1_1CPSTexturedParticle.html#n1">_TexGroup</a> ? (ITexture *) <a class="code" href="classNL3D_1_1CPSTexturedParticle.html#n1">_TexGroup</a> : (ITexture *) <a class="code" href="classNL3D_1_1CPSTexturedParticle.html#n0">_Tex</a>);
00254         }       
00255 }
00256 
<a name="l00258"></a><a class="code" href="classNL3D_1_1CPSQuad.html#b8">00258</a> <font class="keywordtype">bool</font> CPSQuad::completeBBox(<a class="code" href="classNLMISC_1_1CAABBox.html">NLMISC::CAABBox</a> &amp;box)<font class="keyword"> const  </font>
00259 <font class="keyword"></font>{ 
00260         <font class="keywordflow">if</font> (!<a class="code" href="classNL3D_1_1CPSSizedParticle.html#n1">_SizeScheme</a>)
00261         {
00262                 CPSUtil::addRadiusToAABBox(box, <a class="code" href="classNL3D_1_1CPSSizedParticle.html#n0">_ParticleSize</a>);
00263         }
00264         <font class="keywordflow">else</font>
00265         {
00266                 CPSUtil::addRadiusToAABBox(box, <a class="code" href="classNL3D_1_1CPSSizedParticle.html#n1">_SizeScheme</a>-&gt;getMaxValue());
00267         }
00268         <font class="keywordflow">return</font> <font class="keyword">true</font> ;   
00269 }
00270 
<a name="l00272"></a><a class="code" href="classNL3D_1_1CPSQuad.html#b7">00272</a> <font class="keywordtype">void</font> CPSQuad::resize(uint32 size)
00273 {
00274         <a class="code" href="debug_8h.html#a6">nlassert</a>(size &lt; (1 &lt;&lt; 16));
00275         <a class="code" href="classNL3D_1_1CPSSizedParticle.html#b3">resizeSize</a>(size);
00276         <a class="code" href="classNL3D_1_1CPSColoredParticle.html#b4">resizeColor</a>(size);
00277         <a class="code" href="classNL3D_1_1CPSTexturedParticle.html#b4">resizeTextureIndex</a>(size);       
00278 }
00279 
00280 <font class="comment">//==============================================================</font>
<a name="l00281"></a><a class="code" href="classNL3D_1_1CPSQuad.html#b2">00281</a> <font class="keywordtype">void</font> CPSQuad::updateMatAndVbForColor(<font class="keywordtype">void</font>)
00282 {
00283         <font class="comment">// no vb to setup, now..</font>
00284 <font class="comment">/*      if (!_ColorScheme)</font>
00285 <font class="comment">        {               </font>
00286 <font class="comment">                _Mat.setColor(_Color);</font>
00287 <font class="comment">        }</font>
00288 <font class="comment">        else</font>
00289 <font class="comment">        {       </font>
00290 <font class="comment">                _Mat.setColor(CRGBA::White);</font>
00291 <font class="comment">        }       */</font>
00292 }
00293 
00294 <font class="comment">//==============================================================</font>
<a name="l00295"></a><a class="code" href="classNL3D_1_1CPSQuad.html#b10">00295</a> <font class="keywordtype">void</font> CPSQuad::serial(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &amp;f) <font class="keywordflow">throw</font>(NLMISC::EStream)
00296 {
00297         sint ver = f.serialVersion(2);          
00298         CPSParticle::serial(f); 
00299         CPSSizedParticle::serialSizeScheme(f);
00300         CPSColoredParticle::serialColorScheme(f);
00301         CPSTexturedParticle::serialTextureScheme(f);
00302         serialMaterial(f);
00303         <font class="keywordflow">if</font> (ver &gt; 1)
00304         {
00305                 CPSMultiTexturedParticle::serialMultiTex(f);
00306         }
00307 }
00308 
00309 <font class="comment">//==============================================================</font>
00310 <font class="comment">// static func used to fill texture coordinates of quads, with global time</font>
00311 <font class="keyword">static</font> <font class="keywordtype">void</font> <a class="code" href="namespaceNL3D.html#a443">FillQuadCoords</a>(uint8 *dest, uint <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CVector2f.html">NLMISC::CVector2f</a> &amp;speed, <font class="keywordtype">float</font> time, uint <a class="code" href="driver__opengl__extension__def_8h.html#a410">num</a>)
00312 {
00313         <font class="keywordflow">if</font> (!<a class="code" href="driver__opengl__extension__def_8h.html#a410">num</a>) <font class="keywordflow">return</font>;
00314         <font class="keyword">const</font> <font class="keywordtype">float</font> topV    = speed.<a class="code" href="classNLMISC_1_1CVector2f.html#m1">y</a> * time;
00315         <font class="keyword">const</font> <font class="keywordtype">float</font> bottomV = topV + 1.f;
00316         <font class="keyword">const</font> <font class="keywordtype">float</font> leftU   = speed.<a class="code" href="classNLMISC_1_1CVector2f.html#m0">x</a> * time;
00317         <font class="keyword">const</font> <font class="keywordtype">float</font> rightU  = leftU + 1.f;
00318 
00319 
00320         <font class="keywordflow">do</font>
00321         {
00322                 ((<a class="code" href="classNLMISC_1_1CUV.html">NLMISC::CUV</a> *) dest)-&gt;set(leftU, topV);
00323                 ((<a class="code" href="classNLMISC_1_1CUV.html">NLMISC::CUV</a> *) (dest + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>))-&gt;set(rightU, topV);
00324                 ((<a class="code" href="classNLMISC_1_1CUV.html">NLMISC::CUV</a> *) (dest + (<a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> &lt;&lt; 1)))-&gt;set(rightU, bottomV);
00325                 ((<a class="code" href="classNLMISC_1_1CUV.html">NLMISC::CUV</a> *) (dest + (<a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> * 3)))-&gt;set(leftU, bottomV);
00326 
00327                 
00328                 dest += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> &lt;&lt; 2;
00329         }
00330         <font class="keywordflow">while</font> (--<a class="code" href="driver__opengl__extension__def_8h.html#a410">num</a>);
00331 }
00332 
00333 <font class="comment">//==============================================================</font>
00334 <font class="comment">// static func used to fill texture coordinates of quads, with local time</font>
00335 <font class="keyword">static</font> <font class="keywordtype">void</font> <a class="code" href="namespaceNL3D.html#a444">FillQuadCoordsLocalTime</a>(uint8 *dest, uint <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CVector2f.html">NLMISC::CVector2f</a> &amp;speed, CPSLocated &amp;srcLoc, uint startIndex, uint <a class="code" href="driver__opengl__extension__def_8h.html#a410">num</a>, uint32 srcStep)
00336 {
00337         <font class="keywordflow">if</font> (!<a class="code" href="driver__opengl__extension__def_8h.html#a410">num</a>) <font class="keywordflow">return</font>;       
00338 
00339         <font class="keywordflow">if</font> (srcStep == (1 &lt;&lt; 16)) <font class="comment">// step = 1.0 ?</font>
00340         {
00341                 TPSAttribTime::iterator timePt = srcLoc.getTime().begin() + startIndex;
00342                 <font class="keywordflow">do</font>
00343                 {
00344                         <font class="keyword">const</font> <font class="keywordtype">float</font> topV    = speed.<a class="code" href="classNLMISC_1_1CVector2f.html#m1">y</a> * *timePt;
00345                         <font class="keyword">const</font> <font class="keywordtype">float</font> bottomV = topV + 1.f;
00346                         <font class="keyword">const</font> <font class="keywordtype">float</font> leftU   = speed.<a class="code" href="classNLMISC_1_1CVector2f.html#m0">x</a> * *timePt;
00347                         <font class="keyword">const</font> <font class="keywordtype">float</font> rightU  = leftU + 1.f;
00348 
00349                         ((<a class="code" href="classNLMISC_1_1CUV.html">NLMISC::CUV</a> *) dest)-&gt;set(leftU, topV);
00350                         ((<a class="code" href="classNLMISC_1_1CUV.html">NLMISC::CUV</a> *) (dest + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>))-&gt;set(rightU, topV);
00351                         ((<a class="code" href="classNLMISC_1_1CUV.html">NLMISC::CUV</a> *) (dest + (<a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> &lt;&lt; 1)))-&gt;set(rightU, bottomV);
00352                         ((<a class="code" href="classNLMISC_1_1CUV.html">NLMISC::CUV</a> *) (dest + (<a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> * 3)))-&gt;set(leftU, bottomV);
00353                         
00354                         dest += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> &lt;&lt; 2;
00355                         ++timePt;
00356                 }
00357                 <font class="keywordflow">while</font> (--<a class="code" href="driver__opengl__extension__def_8h.html#a410">num</a>);
00358         }
00359         <font class="keywordflow">else</font>
00360         {
00361                 <a class="code" href="namespaceNL3D.html#a198">TIteratorTimeStep1616</a> timePt(srcLoc.getTime().begin(), startIndex, srcStep);
00362                 <font class="keywordflow">do</font>
00363                 {
00364                         <font class="keyword">const</font> <font class="keywordtype">float</font> topV    = speed.<a class="code" href="classNLMISC_1_1CVector2f.html#m1">y</a> * *timePt;
00365                         <font class="keyword">const</font> <font class="keywordtype">float</font> bottomV = topV + 1.f;
00366                         <font class="keyword">const</font> <font class="keywordtype">float</font> leftU   = speed.<a class="code" href="classNLMISC_1_1CVector2f.html#m0">x</a> * *timePt;
00367                         <font class="keyword">const</font> <font class="keywordtype">float</font> rightU  = leftU + 1.f;
00368 
00369                         ((<a class="code" href="classNLMISC_1_1CUV.html">NLMISC::CUV</a> *) dest)-&gt;set(leftU, topV);
00370                         ((<a class="code" href="classNLMISC_1_1CUV.html">NLMISC::CUV</a> *) (dest + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>))-&gt;set(rightU, topV);
00371                         ((<a class="code" href="classNLMISC_1_1CUV.html">NLMISC::CUV</a> *) (dest + (<a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> &lt;&lt; 1)))-&gt;set(rightU, bottomV);
00372                         ((<a class="code" href="classNLMISC_1_1CUV.html">NLMISC::CUV</a> *) (dest + (<a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> * 3)))-&gt;set(leftU, bottomV);
00373                         
00374                         dest += <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> &lt;&lt; 2;
00375                         ++timePt;
00376                 }
00377                 <font class="keywordflow">while</font> (--<a class="code" href="driver__opengl__extension__def_8h.html#a410">num</a>);
00378         }
00379 }
00380 
00381 <font class="comment">//==============================================================</font>
<a name="l00382"></a><a class="code" href="classNL3D_1_1CPSQuad.html#b9">00382</a> <font class="keywordtype">void</font> CPSQuad::updateVbColNUVForRender(CVertexBuffer &amp;vb, uint32 startIndex, uint32 size, uint32 srcStep)
00383 {
00384         <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>);
00385 
00386         <font class="keywordflow">if</font> (!size) <font class="keywordflow">return</font>;
00387 
00388         <font class="keywordflow">if</font> (_ColorScheme)
00389         {
00390                 <font class="comment">// compute the colors, each color is replicated 4 times</font>
00391                 <a class="code" href="classNL3D_1_1CPSColoredParticle.html#n1">_ColorScheme</a>-&gt;make4(<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>, startIndex, vb.getColorPointer(), vb.getVertexSize(), size, srcStep);
00392         }
00393 
00394 
00395         <font class="keywordflow">if</font> (_TexGroup) <font class="comment">// if it has a constant texture we are sure it has been setupped before...</font>
00396         {       
00397                 sint32 textureIndex[<a class="code" href="classNL3D_1_1CPSQuad.html#s1s0">quadBufSize</a>];
00398                 <font class="keyword">const</font> uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> = vb.getVertexSize(), stride2 = <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> &lt;&lt; 1, stride3 = stride2 + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>, stride4 = stride2 &lt;&lt; 1;
00399                 uint8 *currUV = (uint8 *) vb.getTexCoordPointer();                              
00400                 
00401 
00402                 <font class="keyword">const</font> sint32 *currIndex;                
00403                 uint32 currIndexIncr; 
00404 
00405                 <font class="keywordflow">if</font> (_TextureIndexScheme)
00406                 {
00407                         currIndex = (sint32 *) <a class="code" href="classNL3D_1_1CPSTexturedParticle.html#n2">_TextureIndexScheme</a>-&gt;make(<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>, startIndex, textureIndex, <font class="keyword">sizeof</font>(sint32), size, <font class="keyword">true</font>, srcStep);                        
00408                         currIndexIncr = 1;
00409                 }
00410                 <font class="keywordflow">else</font>
00411                 {
00412                         currIndex = &amp;<a class="code" href="classNL3D_1_1CPSTexturedParticle.html#n3">_TextureIndex</a>;
00413                         currIndexIncr  = 0;
00414                 }
00415 
00416                 <font class="keywordflow">while</font> (size--)
00417                 {
00418                         <font class="comment">// for now, we don't make texture index wrapping</font>
00419                         <font class="keyword">const</font> CTextureGrouped::TFourUV &amp;uvGroup = <a class="code" href="classNL3D_1_1CPSTexturedParticle.html#n1">_TexGroup</a>-&gt;getUVQuad((uint32) *currIndex);
00420 
00421                         <font class="comment">// copy the 4 uv's for this face</font>
00422                         *(CUV *) currUV = uvGroup.uv0;
00423                         *(CUV *) (currUV + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = uvGroup.uv1;
00424                         *(CUV *) (currUV + stride2) = uvGroup.uv2;
00425                         *(CUV *) (currUV + stride3) = uvGroup.uv3;
00426 
00427                         <font class="comment">// point the next face</font>
00428                         currUV += stride4;
00429                         currIndex += currIndexIncr;
00430                 }               
00431         }
00432 
00433         <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a> &amp;&amp; <a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>-&gt;getOwner());
00434         <font class="keyword">const</font> <font class="keywordtype">float</font> date= (float) <a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>-&gt;getOwner()-&gt;getSystemDate();
00435         
00436 
00438 
00439         <font class="keywordflow">if</font> (CPSMultiTexturedParticle::isMultiTextureEnabled())
00440         {
00441                 
00442                 <font class="comment">// perform tex1 animation if needed</font>
00443                 <font class="keywordflow">if</font> (!<a class="code" href="classNL3D_1_1CPSTexturedParticle.html#n1">_TexGroup</a>) <font class="comment">// doesn't work with texGroup enabled</font>
00444                 {
00445                         <font class="keywordflow">if</font> (!<a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#b1">isAlternateTextureUsed</a>())
00446                         {
00447                                 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSTexturedParticle.html#n0">_Tex</a> &amp;&amp; (<a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n4">_TexScroll</a>[0].<a class="code" href="classNLMISC_1_1CVector2f.html#m0">x</a> != 0 || <a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n4">_TexScroll</a>[0].<a class="code" href="classNLMISC_1_1CVector2f.html#m1">y</a> != 0))
00448                                 {
00449                                         <font class="comment">// animation of texture 1 with main speed</font>
00450                                         <font class="keywordflow">if</font> (!<a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#a22">getUseLocalDate</a>())
00451                                         {
00452                                                 <a class="code" href="namespaceNL3D.html#a443">FillQuadCoords</a>((uint8 *) vb.getTexCoordPointer(0, 0), vb.getVertexSize(), <a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n4">_TexScroll</a>[0], date, size);
00453                                         }
00454                                         <font class="keywordflow">else</font>
00455                                         {
00456                                                 <a class="code" href="namespaceNL3D.html#a444">FillQuadCoordsLocalTime</a>((uint8 *) vb.getTexCoordPointer(0, 0), vb.getVertexSize(), <a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n4">_TexScroll</a>[0], *<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>, startIndex, size, srcStep);
00457                                         }
00458                                 }
00459                         }
00460                         <font class="keywordflow">else</font>
00461                         {
00462                                 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSTexturedParticle.html#n0">_Tex</a> &amp;&amp; (<a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n5">_TexScrollAlternate</a>[0].<a class="code" href="classNLMISC_1_1CVector2f.html#m0">x</a> != 0 || <a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n5">_TexScrollAlternate</a>[0].<a class="code" href="classNLMISC_1_1CVector2f.html#m1">y</a> != 0))
00463                                 {
00464                                         <font class="comment">// animation of texture 1 with alternate speed</font>
00465                                         <font class="keywordflow">if</font> (!<a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#a24">getUseLocalDateAlt</a>())
00466                                         {
00467                                                 <a class="code" href="namespaceNL3D.html#a443">FillQuadCoords</a>((uint8 *) vb.getTexCoordPointer(0, 0), vb.getVertexSize(), <a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n5">_TexScrollAlternate</a>[0], date, size);
00468                                         }
00469                                         <font class="keywordflow">else</font>
00470                                         {
00471                                                 <a class="code" href="namespaceNL3D.html#a444">FillQuadCoordsLocalTime</a>((uint8 *) vb.getTexCoordPointer(0, 0), vb.getVertexSize(), <a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n5">_TexScrollAlternate</a>[0], *<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>, startIndex, size, srcStep);
00472                                         }
00473                                 }
00474                         }
00475                 }
00476 
00477                 <font class="comment">// perform tex2 animation if needed</font>
00478                 <font class="keywordflow">if</font> (!<a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#b1">isAlternateTextureUsed</a>())
00479                 {
00480                         <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n2">_Texture2</a> &amp;&amp; (<a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n4">_TexScroll</a>[1].<a class="code" href="classNLMISC_1_1CVector2f.html#m0">x</a> != 0 || <a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n4">_TexScroll</a>[1].<a class="code" href="classNLMISC_1_1CVector2f.html#m1">y</a> != 0))
00481                         {
00482                                 <font class="comment">// animation of texture 2 with main speed</font>
00483                                 <font class="keywordflow">if</font> (!<a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#a22">getUseLocalDate</a>())
00484                                 {
00485                                         <a class="code" href="namespaceNL3D.html#a443">FillQuadCoords</a>((uint8 *) vb.getTexCoordPointer(0, 1), vb.getVertexSize(), <a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n4">_TexScroll</a>[1], date, size);
00486                                 }
00487                                 <font class="keywordflow">else</font>
00488                                 {
00489                                         <a class="code" href="namespaceNL3D.html#a444">FillQuadCoordsLocalTime</a>((uint8 *) vb.getTexCoordPointer(0, 1), vb.getVertexSize(), <a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n4">_TexScroll</a>[1], *<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>, startIndex, size, srcStep);
00490                                 }
00491                         }
00492                 }
00493                 <font class="keywordflow">else</font>
00494                 {
00495                         <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n3">_AlternateTexture2</a> &amp;&amp; (<a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n5">_TexScrollAlternate</a>[1].<a class="code" href="classNLMISC_1_1CVector2f.html#m0">x</a> != 0 || <a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n5">_TexScrollAlternate</a>[1].<a class="code" href="classNLMISC_1_1CVector2f.html#m1">y</a> != 0))
00496                         {
00497                                 <font class="comment">// animation of texture 2 with alternate speed</font>
00498                                 <font class="keywordflow">if</font> (!<a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#a24">getUseLocalDateAlt</a>())
00499                                 {
00500                                         <a class="code" href="namespaceNL3D.html#a443">FillQuadCoords</a>((uint8 *) vb.getTexCoordPointer(0, 1), vb.getVertexSize(), <a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n5">_TexScrollAlternate</a>[1], date, size);
00501                                 }                               
00502                                 <font class="keywordflow">else</font>
00503                                 {
00504                                         <a class="code" href="namespaceNL3D.html#a444">FillQuadCoordsLocalTime</a>((uint8 *) vb.getTexCoordPointer(0, 1), vb.getVertexSize(), <a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#n5">_TexScrollAlternate</a>[1], *<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>, startIndex, size, srcStep);
00505                                 }
00506                         }
00507                 }
00508 
00509         }       
00510 }
00511 
00512 
00513 
<a name="l00515"></a><a class="code" href="classNL3D_1_1CPSQuad.html#b4">00515</a> <font class="keywordtype">void</font> CPSQuad::updateMatBeforeRendering(IDriver *drv)
00516 {
00517         <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a> &amp;&amp; <a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>-&gt;getOwner());
00518         CParticleSystem &amp;ps = *(<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>-&gt;getOwner());
00519         <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#a2">isMultiTextureEnabled</a>())
00520         {                       
00521                         <a class="code" href="classNL3D_1_1CPSMultiTexturedParticle.html#a20">setupMaterial</a>(<a class="code" href="classNL3D_1_1CPSTexturedParticle.html#n0">_Tex</a>, drv, <a class="code" href="classNL3D_1_1CPSMaterial.html#n0">_Mat</a>);
00522                         <a class="code" href="classNL3D_1_1CPSMaterial.html#n0">_Mat</a>.setColor(ps.getGlobalColor());                     
00523         }
00524         <font class="keywordflow">else</font>
00525         {
00527                 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSColoredParticle.html#n1">_ColorScheme</a> != NULL &amp;&amp; ps.getColorAttenuationScheme() != NULL)
00528                 {               
00529                         CPSMaterial::forceModulateConstantColor(<font class="keyword">true</font>, ps.getGlobalColor());             
00530                 }
00531                 <font class="keywordflow">else</font>
00532                 {
00533                         <a class="code" href="classNL3D_1_1CPSMaterial.html#a4">forceModulateConstantColor</a>(<font class="keyword">false</font>);
00534                         <font class="keywordflow">if</font> (!ps.getColorAttenuationScheme())
00535                         {
00536                                 <a class="code" href="classNL3D_1_1CPSMaterial.html#n0">_Mat</a>.setColor(<a class="code" href="classNL3D_1_1CPSColoredParticle.html#n0">_Color</a>);
00537                         }
00538                         <font class="keywordflow">else</font>
00539                         {
00540                                 <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> col;
00541                                 col.<a class="code" href="classNLMISC_1_1CRGBA.html#a9">modulateFromColor</a>(ps.getGlobalColor(), <a class="code" href="classNL3D_1_1CPSColoredParticle.html#n0">_Color</a>);
00542                                 <a class="code" href="classNL3D_1_1CPSMaterial.html#n0">_Mat</a>.setColor(col);
00543                         }
00544                 }
00545         }
00546 }
00547 
00548 
00549 
00550 } <font class="comment">// NL3D</font>
</pre></div>

<!-- footer -->
<BR><FONT Size=+5>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </FONT>
</TD>
<TD WIDTH=15><IMG  SRC=/inc/img/pixel.gif WIDTH=15 HEIGHT=15 BORDER=0 ALT=""></TD>
</TR>
</TABLE>
</BODY>
</HTML>