zenilib: zenilib/jni/external/lib3ds/src/lib3ds_material.c Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lib3ds_material.c
Go to the documentation of this file.
1 /*
2 Copyright (C) 1996-2008 by Jan Eric Kyprianidis <www.kyprianidis.com>
3 All rights reserved.
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published
7 by the Free Software Foundation, either version 2.1 of the License, or
8 (at your option) any later version.
9
10 Thisprogram is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program; If not, see <http://www.gnu.org/licenses/>.
17 */
18 #include "lib3ds_impl.h"
19
20
21 static void
22 initialize_texture_map(Lib3dsTextureMap *map) {
23 map->flags = 0x10;
24 map->percent = 1.0f;
25 map->scale[0] = 1.0f;
26 map->scale[1] = 1.0f;
27 }
28
29
38 Lib3dsMaterial*
39 lib3ds_material_new(const char* name) {
40 Lib3dsMaterial *mat;
41
42 mat = (Lib3dsMaterial*)calloc(sizeof(Lib3dsMaterial), 1);
43 if (!mat) {
44 return(0);
45 }
46
47 if (name) {
48 strcpy(mat->name, name);
49 }
50 mat->ambient[0] = mat->ambient[1] = mat->ambient[2] = 0.588235f;
51 mat->diffuse[0] = mat->diffuse[1] = mat->diffuse[2] = 0.588235f;
52 mat->specular[0] = mat->specular[1] = mat->specular[2] = 0.898039f;
53 mat->shininess = 0.1f;
54 mat->wire_size = 1.0f;
55 mat->shading = 3;
56
57 initialize_texture_map(&mat->texture1_map);
58 initialize_texture_map(&mat->texture1_mask);
59 initialize_texture_map(&mat->texture2_map);
60 initialize_texture_map(&mat->texture2_mask);
61 initialize_texture_map(&mat->opacity_map);
62 initialize_texture_map(&mat->opacity_mask);
63 initialize_texture_map(&mat->bump_map);
64 initialize_texture_map(&mat->bump_mask);
65 initialize_texture_map(&mat->specular_map);
66 initialize_texture_map(&mat->specular_mask);
67 initialize_texture_map(&mat->shininess_map);
68 initialize_texture_map(&mat->shininess_mask);
69 initialize_texture_map(&mat->self_illum_map);
70 initialize_texture_map(&mat->self_illum_mask);
71 initialize_texture_map(&mat->reflection_map);
72 initialize_texture_map(&mat->reflection_mask);
73
74 return(mat);
75 }
76
77
78 void
79 lib3ds_material_free(Lib3dsMaterial *material) {
80 memset(material, 0, sizeof(Lib3dsMaterial));
81 free(material);
82 }
83
84
85 static void
86 color_read(float rgb[3], Lib3dsIo *io) {
87 Lib3dsChunk c;
88 uint16_t chunk;
89 int have_lin = FALSE;
90
91 lib3ds_chunk_read_start(&c, 0, io);
92
93 while ((chunk = lib3ds_chunk_read_next(&c, io)) != 0) {
94 switch (chunk) {
95 case CHK_LIN_COLOR_24: {
96 int i;
97 for (i = 0; i < 3; ++i) {
98 rgb[i] = 1.0f * lib3ds_io_read_byte(io) / 255.0f;
99 }
100 have_lin = TRUE;
101 break;
102 }
103
104 case CHK_COLOR_24: {
105 /* gamma corrected color chunk
106 replaced in 3ds R3 by LIN_COLOR_24 */
107 if (!have_lin) {
108 int i;
109 for (i = 0; i < 3; ++i) {
110 rgb[i] = 1.0f * lib3ds_io_read_byte(io) / 255.0f;
111 }
112 }
113 break;
114 }
115
116 case CHK_LIN_COLOR_F: {
117 int i;
118 for (i = 0; i < 3; ++i) {
119 rgb[i] = lib3ds_io_read_float(io);
120 }
121 have_lin = TRUE;
122 break;
123 }
124
125 case CHK_COLOR_F: {
126 if (!have_lin) {
127 int i;
128 for (i = 0; i < 3; ++i) {
129 rgb[i] = lib3ds_io_read_float(io);
130 }
131 }
132 break;
133 }
134
135 default:
136 lib3ds_chunk_unknown(chunk, io);
137 }
138 }
139
140 lib3ds_chunk_read_end(&c, io);
141 }
142
143
144 static void
145 int_percentage_read(float *p, Lib3dsIo *io) {
146 Lib3dsChunk c;
147 uint16_t chunk;
148
149 lib3ds_chunk_read_start(&c, 0, io);
150
151 while ((chunk = lib3ds_chunk_read_next(&c, io)) != 0) {
152 switch (chunk) {
153 case CHK_INT_PERCENTAGE: {
154 int16_t i = lib3ds_io_read_intw(io);
155 *p = (float)(1.0 * i / 100.0);
156 break;
157 }
158
159 default:
160 lib3ds_chunk_unknown(chunk, io);
161 }
162 }
163
164 lib3ds_chunk_read_end(&c, io);
165 }
166
167
168 static void
169 texture_map_read(Lib3dsTextureMap *map, Lib3dsIo *io) {
170 Lib3dsChunk c;
171 uint16_t chunk;
172
173 lib3ds_chunk_read_start(&c, 0, io);
174
175 while ((chunk = lib3ds_chunk_read_next(&c, io)) != 0) {
176 switch (chunk) {
177 case CHK_INT_PERCENTAGE: {
178 map->percent = 1.0f * lib3ds_io_read_intw(io) / 100.0f;
179 break;
180 }
181
182 case CHK_MAT_MAPNAME: {
183 lib3ds_io_read_string(io, map->name, 64);
184 lib3ds_io_log(io, LIB3DS_LOG_INFO, " NAME=%s", map->name);
185 break;
186 }
187
188 case CHK_MAT_MAP_TILING: {
189 map->flags = lib3ds_io_read_word(io);
190 break;
191 }
192
193 case CHK_MAT_MAP_TEXBLUR:
194 map->blur = lib3ds_io_read_float(io);
195 break;
196
197 case CHK_MAT_MAP_USCALE:
198 map->scale[0] = lib3ds_io_read_float(io);
199 break;
200
201 case CHK_MAT_MAP_VSCALE: {
202 map->scale[1] = lib3ds_io_read_float(io);
203 break;
204 }
205 case CHK_MAT_MAP_UOFFSET: {
206 map->offset[0] = lib3ds_io_read_float(io);
207 break;
208 }
209
210 case CHK_MAT_MAP_VOFFSET: {
211 map->offset[1] = lib3ds_io_read_float(io);
212 break;
213 }
214
215 case CHK_MAT_MAP_ANG: {
216 map->rotation = lib3ds_io_read_float(io);
217 break;
218 }
219
220 case CHK_MAT_MAP_COL1: {
221 map->tint_1[0] = 1.0f * lib3ds_io_read_byte(io) / 255.0f;
222 map->tint_1[1] = 1.0f * lib3ds_io_read_byte(io) / 255.0f;
223 map->tint_1[2] = 1.0f * lib3ds_io_read_byte(io) / 255.0f;
224 break;
225 }
226
227 case CHK_MAT_MAP_COL2: {
228 map->tint_2[0] = 1.0f * lib3ds_io_read_byte(io) / 255.0f;
229 map->tint_2[1] = 1.0f * lib3ds_io_read_byte(io) / 255.0f;
230 map->tint_2[2] = 1.0f * lib3ds_io_read_byte(io) / 255.0f;
231 break;
232 }
233
234 case CHK_MAT_MAP_RCOL: {
235 map->tint_r[0] = 1.0f * lib3ds_io_read_byte(io) / 255.0f;
236 map->tint_r[1] = 1.0f * lib3ds_io_read_byte(io) / 255.0f;
237 map->tint_r[2] = 1.0f * lib3ds_io_read_byte(io) / 255.0f;
238 break;
239 }
240
241 case CHK_MAT_MAP_GCOL: {
242 map->tint_g[0] = 1.0f * lib3ds_io_read_byte(io) / 255.0f;
243 map->tint_g[1] = 1.0f * lib3ds_io_read_byte(io) / 255.0f;
244 map->tint_g[2] = 1.0f * lib3ds_io_read_byte(io) / 255.0f;
245 break;
246 }
247
248 case CHK_MAT_MAP_BCOL: {
249 map->tint_b[0] = 1.0f * lib3ds_io_read_byte(io) / 255.0f;
250 map->tint_b[1] = 1.0f * lib3ds_io_read_byte(io) / 255.0f;
251 map->tint_b[2] = 1.0f * lib3ds_io_read_byte(io) / 255.0f;
252 break;
253 }
254
255 default:
256 lib3ds_chunk_unknown(chunk,io);
257 }
258 }
259
260 lib3ds_chunk_read_end(&c, io);
261 }
262
263
264 void
265 lib3ds_material_read(Lib3dsMaterial *material, Lib3dsIo *io) {
266 Lib3dsChunk c;
267 uint16_t chunk;
268
269 assert(material);
270 lib3ds_chunk_read_start(&c, CHK_MAT_ENTRY, io);
271
272 while ((chunk = lib3ds_chunk_read_next(&c, io)) != 0) {
273 switch (chunk) {
274 case CHK_MAT_NAME: {
275 lib3ds_io_read_string(io, material->name, 64);
276 lib3ds_io_log(io, LIB3DS_LOG_INFO, " NAME=%s", material->name);
277 break;
278 }
279
280 case CHK_MAT_AMBIENT: {
281 lib3ds_chunk_read_reset(&c, io);
282 color_read(material->ambient, io);
283 break;
284 }
285
286 case CHK_MAT_DIFFUSE: {
287 lib3ds_chunk_read_reset(&c, io);
288 color_read(material->diffuse, io);
289 break;
290 }
291
292 case CHK_MAT_SPECULAR: {
293 lib3ds_chunk_read_reset(&c, io);
294 color_read(material->specular, io);
295 break;
296 }
297
298 case CHK_MAT_SHININESS: {
299 lib3ds_chunk_read_reset(&c, io);
300 int_percentage_read(&material->shininess, io);
301 break;
302 }
303
304 case CHK_MAT_SHIN2PCT: {
305 lib3ds_chunk_read_reset(&c, io);
306 int_percentage_read(&material->shin_strength, io);
307 break;
308 }
309
310 case CHK_MAT_TRANSPARENCY: {
311 lib3ds_chunk_read_reset(&c, io);
312 int_percentage_read(&material->transparency, io);
313 break;
314 }
315
316 case CHK_MAT_XPFALL: {
317 lib3ds_chunk_read_reset(&c, io);
318 int_percentage_read(&material->falloff, io);
319 break;
320 }
321
322 case CHK_MAT_SELF_ILPCT: {
323 lib3ds_chunk_read_reset(&c, io);
324 int_percentage_read(&material->self_illum, io);
325 break;
326 }
327
328 case CHK_MAT_USE_XPFALL: {
329 material->use_falloff = TRUE;
330 break;
331 }
332
333 case CHK_MAT_REFBLUR: {
334 lib3ds_chunk_read_reset(&c, io);
335 int_percentage_read(&material->blur, io);
336 break;
337 }
338
339 case CHK_MAT_USE_REFBLUR: {
340 material->use_blur = TRUE;
341 break;
342 }
343
344 case CHK_MAT_SHADING: {
345 material->shading = lib3ds_io_read_intw(io);
346 break;
347 }
348
349 case CHK_MAT_SELF_ILLUM: {
350 material->self_illum_flag = TRUE;
351 break;
352 }
353
354 case CHK_MAT_TWO_SIDE: {
355 material->two_sided = TRUE;
356 break;
357 }
358
359 case CHK_MAT_DECAL: {
360 material->map_decal = TRUE;
361 break;
362 }
363
364 case CHK_MAT_ADDITIVE: {
365 material->is_additive = TRUE;
366 break;
367 }
368
369 case CHK_MAT_FACEMAP: {
370 material->face_map = TRUE;
371 break;
372 }
373
374 case CHK_MAT_PHONGSOFT: {
375 material->soften = TRUE;
376 break;
377 }
378
379 case CHK_MAT_WIRE: {
380 material->use_wire = TRUE;
381 break;
382 }
383
384 case CHK_MAT_WIREABS: {
385 material->use_wire_abs = TRUE;
386 break;
387 }
388 case CHK_MAT_WIRE_SIZE: {
389 material->wire_size = lib3ds_io_read_float(io);
390 break;
391 }
392
393 case CHK_MAT_TEXMAP: {
394 lib3ds_chunk_read_reset(&c, io);
395 texture_map_read(&material->texture1_map, io);
396 break;
397 }
398
399 case CHK_MAT_TEXMASK: {
400 lib3ds_chunk_read_reset(&c, io);
401 texture_map_read(&material->texture1_mask, io);
402 break;
403 }
404
405 case CHK_MAT_TEX2MAP: {
406 lib3ds_chunk_read_reset(&c, io);
407 texture_map_read(&material->texture2_map, io);
408 break;
409 }
410
411 case CHK_MAT_TEX2MASK: {
412 lib3ds_chunk_read_reset(&c, io);
413 texture_map_read(&material->texture2_mask, io);
414 break;
415 }
416
417 case CHK_MAT_OPACMAP: {
418 lib3ds_chunk_read_reset(&c, io);
419 texture_map_read(&material->opacity_map, io);
420 break;
421 }
422
423 case CHK_MAT_OPACMASK: {
424 lib3ds_chunk_read_reset(&c, io);
425 texture_map_read(&material->opacity_mask, io);
426 break;
427 }
428
429 case CHK_MAT_BUMPMAP: {
430 lib3ds_chunk_read_reset(&c, io);
431 texture_map_read(&material->bump_map, io);
432 break;
433 }
434 case CHK_MAT_BUMPMASK: {
435 lib3ds_chunk_read_reset(&c, io);
436 texture_map_read(&material->bump_mask, io);
437 break;
438 }
439 case CHK_MAT_SPECMAP: {
440 lib3ds_chunk_read_reset(&c, io);
441 texture_map_read(&material->specular_map, io);
442 break;
443 }
444
445 case CHK_MAT_SPECMASK: {
446 lib3ds_chunk_read_reset(&c, io);
447 texture_map_read(&material->specular_mask, io);
448 break;
449 }
450
451 case CHK_MAT_SHINMAP: {
452 lib3ds_chunk_read_reset(&c, io);
453 texture_map_read(&material->shininess_map, io);
454 break;
455 }
456
457 case CHK_MAT_SHINMASK: {
458 lib3ds_chunk_read_reset(&c, io);
459 texture_map_read(&material->shininess_mask, io);
460 break;
461 }
462
463 case CHK_MAT_SELFIMAP: {
464 lib3ds_chunk_read_reset(&c, io);
465 texture_map_read(&material->self_illum_map, io);
466 break;
467 }
468
469 case CHK_MAT_SELFIMASK: {
470 lib3ds_chunk_read_reset(&c, io);
471 texture_map_read(&material->self_illum_mask, io);
472 break;
473 }
474
475 case CHK_MAT_REFLMAP: {
476 lib3ds_chunk_read_reset(&c, io);
477 texture_map_read(&material->reflection_map, io);
478 break;
479 }
480
481 case CHK_MAT_REFLMASK: {
482 lib3ds_chunk_read_reset(&c, io);
483 texture_map_read(&material->reflection_mask, io);
484 break;
485 }
486
487 case CHK_MAT_ACUBIC: {
488 lib3ds_io_read_intb(io);
489 material->autorefl_map_anti_alias = lib3ds_io_read_intb(io);
490 material->autorefl_map_flags = lib3ds_io_read_intw(io);
491 material->autorefl_map_size = lib3ds_io_read_intd(io);
492 material->autorefl_map_frame_step = lib3ds_io_read_intd(io);
493 break;
494 }
495
496 default:
497 lib3ds_chunk_unknown(chunk, io);
498 }
499 }
500
501 lib3ds_chunk_read_end(&c, io);
502 }
503
504
505 static void
506 color_write(float rgb[3], Lib3dsIo *io) {
507 Lib3dsChunk c;
508
509 c.chunk = CHK_COLOR_24;
510 c.size = 9;
511 lib3ds_chunk_write(&c, io);
512 lib3ds_io_write_byte(io, (uint8_t)floor(255.0*rgb[0] + 0.5));
513 lib3ds_io_write_byte(io, (uint8_t)floor(255.0*rgb[1] + 0.5));
514 lib3ds_io_write_byte(io, (uint8_t)floor(255.0*rgb[2] + 0.5));
515
516 c.chunk = CHK_LIN_COLOR_24;
517 c.size = 9;
518 lib3ds_chunk_write(&c, io);
519 lib3ds_io_write_byte(io, (uint8_t)floor(255.0*rgb[0] + 0.5));
520 lib3ds_io_write_byte(io, (uint8_t)floor(255.0*rgb[1] + 0.5));
521 lib3ds_io_write_byte(io, (uint8_t)floor(255.0*rgb[2] + 0.5));
522 }
523
524
525 static void
526 int_percentage_write(float p, Lib3dsIo *io) {
527 Lib3dsChunk c;
528
529 c.chunk = CHK_INT_PERCENTAGE;
530 c.size = 8;
531 lib3ds_chunk_write(&c, io);
532 lib3ds_io_write_intw(io, (uint8_t)floor(100.0*p + 0.5));
533 }
534
535
536 static void
537 texture_map_write(uint16_t chunk, Lib3dsTextureMap *map, Lib3dsIo *io) {
538 Lib3dsChunk c;
539
540 if (strlen(map->name) == 0) {
541 return;
542 }
543 c.chunk = chunk;
544 lib3ds_chunk_write_start(&c, io);
545
546 int_percentage_write(map->percent, io);
547
548 { /*---- CHK_MAT_MAPNAME ----*/
549 Lib3dsChunk c;
550 c.chunk = CHK_MAT_MAPNAME;
551 c.size = 6 + (uint32_t)strlen(map->name) + 1;
552 lib3ds_chunk_write(&c, io);
553 lib3ds_io_write_string(io, map->name);
554 }
555
556 { /*---- CHK_MAT_MAP_TILING ----*/
557 Lib3dsChunk c;
558 c.chunk = CHK_MAT_MAP_TILING;
559 c.size = 8;
560 lib3ds_chunk_write(&c, io);
561 lib3ds_io_write_word(io, (uint16_t)map->flags);
562 }
563
564 { /*---- CHK_MAT_MAP_TEXBLUR ----*/
565 Lib3dsChunk c;
566 c.chunk = CHK_MAT_MAP_TEXBLUR;
567 c.size = 10;
568 lib3ds_chunk_write(&c, io);
569 lib3ds_io_write_float(io, map->blur);
570 }
571
572 { /*---- CHK_MAT_MAP_USCALE ----*/
573 Lib3dsChunk c;
574 c.chunk = CHK_MAT_MAP_USCALE;
575 c.size = 10;
576 lib3ds_chunk_write(&c, io);
577 lib3ds_io_write_float(io, map->scale[0]);
578 }
579
580 { /*---- CHK_MAT_MAP_VSCALE ----*/
581 Lib3dsChunk c;
582 c.chunk = CHK_MAT_MAP_VSCALE;
583 c.size = 10;
584 lib3ds_chunk_write(&c, io);
585 lib3ds_io_write_float(io, map->scale[1]);
586 }
587
588 { /*---- CHK_MAT_MAP_UOFFSET ----*/
589 Lib3dsChunk c;
590 c.chunk = CHK_MAT_MAP_UOFFSET;
591 c.size = 10;
592 lib3ds_chunk_write(&c, io);
593 lib3ds_io_write_float(io, map->offset[0]);
594 }
595
596 { /*---- CHK_MAT_MAP_VOFFSET ----*/
597 Lib3dsChunk c;
598 c.chunk = CHK_MAT_MAP_VOFFSET;
599 c.size = 10;
600 lib3ds_chunk_write(&c, io);
601 lib3ds_io_write_float(io, map->offset[1]);
602 }
603
604 { /*---- CHK_MAT_MAP_ANG ----*/
605 Lib3dsChunk c;
606 c.chunk = CHK_MAT_MAP_ANG;
607 c.size = 10;
608 lib3ds_chunk_write(&c, io);
609 lib3ds_io_write_float(io, map->rotation);
610 }
611
612 { /*---- CHK_MAT_MAP_COL1 ----*/
613 Lib3dsChunk c;
614 c.chunk = CHK_MAT_MAP_COL1;
615 c.size = 9;
616 lib3ds_chunk_write(&c, io);
617 lib3ds_io_write_byte(io, (uint8_t)floor(255.0*map->tint_1[0] + 0.5));
618 lib3ds_io_write_byte(io, (uint8_t)floor(255.0*map->tint_1[1] + 0.5));
619 lib3ds_io_write_byte(io, (uint8_t)floor(255.0*map->tint_1[2] + 0.5));
620 }
621
622 { /*---- CHK_MAT_MAP_COL2 ----*/
623 Lib3dsChunk c;
624 c.chunk = CHK_MAT_MAP_COL2;
625 c.size = 9;
626 lib3ds_chunk_write(&c, io);
627 lib3ds_io_write_byte(io, (uint8_t)floor(255.0*map->tint_2[0] + 0.5));
628 lib3ds_io_write_byte(io, (uint8_t)floor(255.0*map->tint_2[1] + 0.5));
629 lib3ds_io_write_byte(io, (uint8_t)floor(255.0*map->tint_2[2] + 0.5));
630 }
631
632 { /*---- CHK_MAT_MAP_RCOL ----*/
633 Lib3dsChunk c;
634 c.chunk = CHK_MAT_MAP_RCOL;
635 c.size = 9;
636 lib3ds_chunk_write(&c, io);
637 lib3ds_io_write_byte(io, (uint8_t)floor(255.0*map->tint_r[0] + 0.5));
638 lib3ds_io_write_byte(io, (uint8_t)floor(255.0*map->tint_r[1] + 0.5));
639 lib3ds_io_write_byte(io, (uint8_t)floor(255.0*map->tint_r[2] + 0.5));
640 }
641
642 { /*---- CHK_MAT_MAP_GCOL ----*/
643 Lib3dsChunk c;
644 c.chunk = CHK_MAT_MAP_GCOL;
645 c.size = 9;
646 lib3ds_chunk_write(&c, io);
647 lib3ds_io_write_byte(io, (uint8_t)floor(255.0*map->tint_g[0] + 0.5));
648 lib3ds_io_write_byte(io, (uint8_t)floor(255.0*map->tint_g[1] + 0.5));
649 lib3ds_io_write_byte(io, (uint8_t)floor(255.0*map->tint_g[2] + 0.5));
650 }
651
652 { /*---- CHK_MAT_MAP_BCOL ----*/
653 Lib3dsChunk c;
654 c.chunk = CHK_MAT_MAP_BCOL;
655 c.size = 9;
656 lib3ds_chunk_write(&c, io);
657 lib3ds_io_write_byte(io, (uint8_t)floor(255.0*map->tint_b[0] + 0.5));
658 lib3ds_io_write_byte(io, (uint8_t)floor(255.0*map->tint_b[1] + 0.5));
659 lib3ds_io_write_byte(io, (uint8_t)floor(255.0*map->tint_b[2] + 0.5));
660 }
661
662 lib3ds_chunk_write_end(&c, io);
663 }
664
665
666 void
667 lib3ds_material_write(Lib3dsMaterial *material, Lib3dsIo *io) {
668 Lib3dsChunk c;
669
670 c.chunk = CHK_MAT_ENTRY;
671 lib3ds_chunk_write_start(&c, io);
672
673 { /*---- CHK_MAT_NAME ----*/
674 Lib3dsChunk c;
675 c.chunk = CHK_MAT_NAME;
676 c.size = 6 + (uint32_t)strlen(material->name) + 1;
677 lib3ds_chunk_write(&c, io);
678 lib3ds_io_write_string(io, material->name);
679 }
680
681 { /*---- CHK_MAT_AMBIENT ----*/
682 Lib3dsChunk c;
683 c.chunk = CHK_MAT_AMBIENT;
684 c.size = 24;
685 lib3ds_chunk_write(&c, io);
686 color_write(material->ambient, io);
687 }
688
689 { /*---- CHK_MAT_DIFFUSE ----*/
690 Lib3dsChunk c;
691 c.chunk = CHK_MAT_DIFFUSE;
692 c.size = 24;
693 lib3ds_chunk_write(&c, io);
694 color_write(material->diffuse, io);
695 }
696
697 { /*---- CHK_MAT_SPECULAR ----*/
698 Lib3dsChunk c;
699 c.chunk = CHK_MAT_SPECULAR;
700 c.size = 24;
701 lib3ds_chunk_write(&c, io);
702 color_write(material->specular, io);
703 }
704
705 { /*---- CHK_MAT_SHININESS ----*/
706 Lib3dsChunk c;
707 c.chunk = CHK_MAT_SHININESS;
708 c.size = 14;
709 lib3ds_chunk_write(&c, io);
710 int_percentage_write(material->shininess, io);
711 }
712
713 { /*---- CHK_MAT_SHIN2PCT ----*/
714 Lib3dsChunk c;
715 c.chunk = CHK_MAT_SHIN2PCT;
716 c.size = 14;
717 lib3ds_chunk_write(&c, io);
718 int_percentage_write(material->shin_strength, io);
719 }
720
721 { /*---- CHK_MAT_TRANSPARENCY ----*/
722 Lib3dsChunk c;
723 c.chunk = CHK_MAT_TRANSPARENCY;
724 c.size = 14;
725 lib3ds_chunk_write(&c, io);
726 int_percentage_write(material->transparency, io);
727 }
728
729 { /*---- CHK_MAT_XPFALL ----*/
730 Lib3dsChunk c;
731 c.chunk = CHK_MAT_XPFALL;
732 c.size = 14;
733 lib3ds_chunk_write(&c, io);
734 int_percentage_write(material->falloff, io);
735 }
736
737 if (material->use_falloff) { /*---- CHK_MAT_USE_XPFALL ----*/
738 Lib3dsChunk c;
739 c.chunk = CHK_MAT_USE_XPFALL;
740 c.size = 6;
741 lib3ds_chunk_write(&c, io);
742 }
743
744 { /*---- CHK_MAT_SHADING ----*/
745 Lib3dsChunk c;
746 c.chunk = CHK_MAT_SHADING;
747 c.size = 8;
748 lib3ds_chunk_write(&c, io);
749 lib3ds_io_write_intw(io, material->shading);
750 }
751
752 { /*---- CHK_MAT_REFBLUR ----*/
753 Lib3dsChunk c;
754 c.chunk = CHK_MAT_REFBLUR;
755 c.size = 14;
756 lib3ds_chunk_write(&c, io);
757 int_percentage_write(material->blur, io);
758 }
759
760 if (material->use_blur) { /*---- CHK_MAT_USE_REFBLUR ----*/
761 Lib3dsChunk c;
762 c.chunk = CHK_MAT_USE_REFBLUR;
763 c.size = 6;
764 lib3ds_chunk_write(&c, io);
765 }
766
767 if (material->self_illum_flag) { /*---- CHK_MAT_SELF_ILLUM ----*/
768 Lib3dsChunk c;
769 c.chunk = CHK_MAT_SELF_ILLUM;
770 c.size = 6;
771 lib3ds_chunk_write(&c, io);
772 }
773
774 if (material->two_sided) { /*---- CHK_MAT_TWO_SIDE ----*/
775 Lib3dsChunk c;
776 c.chunk = CHK_MAT_TWO_SIDE;
777 c.size = 6;
778 lib3ds_chunk_write(&c, io);
779 }
780
781 if (material->map_decal) { /*---- CHK_MAT_DECAL ----*/
782 Lib3dsChunk c;
783 c.chunk = CHK_MAT_DECAL;
784 c.size = 6;
785 lib3ds_chunk_write(&c, io);
786 }
787
788 if (material->is_additive) { /*---- CHK_MAT_ADDITIVE ----*/
789 Lib3dsChunk c;
790 c.chunk = CHK_MAT_ADDITIVE;
791 c.size = 6;
792 lib3ds_chunk_write(&c, io);
793 }
794
795 if (material->use_wire) { /*---- CHK_MAT_WIRE ----*/
796 Lib3dsChunk c;
797 c.chunk = CHK_MAT_WIRE;
798 c.size = 6;
799 lib3ds_chunk_write(&c, io);
800 }
801
802 if (material->use_wire_abs) { /*---- CHK_MAT_WIREABS ----*/
803 Lib3dsChunk c;
804 c.chunk = CHK_MAT_WIREABS;
805 c.size = 6;
806 lib3ds_chunk_write(&c, io);
807 }
808
809 { /*---- CHK_MAT_WIRE_SIZE ----*/
810 Lib3dsChunk c;
811 c.chunk = CHK_MAT_WIRE_SIZE;
812 c.size = 10;
813 lib3ds_chunk_write(&c, io);
814 lib3ds_io_write_float(io, material->wire_size);
815 }
816
817 if (material->face_map) { /*---- CHK_MAT_FACEMAP ----*/
818 Lib3dsChunk c;
819 c.chunk = CHK_MAT_FACEMAP;
820 c.size = 6;
821 lib3ds_chunk_write(&c, io);
822 }
823
824 if (material->soften) { /*---- CHK_MAT_PHONGSOFT ----*/
825 Lib3dsChunk c;
826 c.chunk = CHK_MAT_PHONGSOFT;
827 c.size = 6;
828 lib3ds_chunk_write(&c, io);
829 }
830
831 texture_map_write(CHK_MAT_TEXMAP, &material->texture1_map, io);
832 texture_map_write(CHK_MAT_TEXMASK, &material->texture1_mask, io);
833 texture_map_write(CHK_MAT_TEX2MAP, &material->texture2_map, io);
834 texture_map_write(CHK_MAT_TEX2MASK, &material->texture2_mask, io);
835 texture_map_write(CHK_MAT_OPACMAP, &material->opacity_map, io);
836 texture_map_write(CHK_MAT_OPACMASK, &material->opacity_mask, io);
837 texture_map_write(CHK_MAT_BUMPMAP, &material->bump_map, io);
838 texture_map_write(CHK_MAT_BUMPMASK, &material->bump_mask, io);
839 texture_map_write(CHK_MAT_SPECMAP, &material->specular_map, io);
840 texture_map_write(CHK_MAT_SPECMASK, &material->specular_mask, io);
841 texture_map_write(CHK_MAT_SHINMAP, &material->shininess_map, io);
842 texture_map_write(CHK_MAT_SHINMASK, &material->shininess_mask, io);
843 texture_map_write(CHK_MAT_SELFIMAP, &material->self_illum_map, io);
844 texture_map_write(CHK_MAT_SELFIMASK, &material->self_illum_mask, io);
845 texture_map_write(CHK_MAT_REFLMAP, &material->reflection_map, io);
846 texture_map_write(CHK_MAT_REFLMASK, &material->reflection_mask, io);
847
848 { /*---- CHK_MAT_ACUBIC ----*/
849 Lib3dsChunk c;
850 c.chunk = CHK_MAT_ACUBIC;
851 c.size = 18;
852 lib3ds_chunk_write(&c, io);
853 lib3ds_io_write_intb(io, 0);
854 lib3ds_io_write_intb(io, material->autorefl_map_anti_alias);
855 lib3ds_io_write_intw(io, material->autorefl_map_flags);
856 lib3ds_io_write_intd(io, material->autorefl_map_size);
857 lib3ds_io_write_intd(io, material->autorefl_map_frame_step);
858 }
859
860 lib3ds_chunk_write_end(&c, io);
861 }
Lib3dsMaterial::self_illum_map
Lib3dsTextureMap self_illum_map
Definition: lib3ds.h:261
CHK_MAT_TWO_SIDE
Definition: lib3ds_impl.h:125
lib3ds_io_write_intw
void lib3ds_io_write_intw(Lib3dsIo *io, int16_t w)
Definition: lib3ds_io.c:368
CHK_MAT_MAP_TILING
Definition: lib3ds_impl.h:167
CHK_MAT_ADDITIVE
Definition: lib3ds_impl.h:127
CHK_MAT_MAP_GCOL
Definition: lib3ds_impl.h:177
CHK_MAT_SELFIMASK
Definition: lib3ds_impl.h:160
CHK_MAT_OPACMASK
Definition: lib3ds_impl.h:144
lib3ds_io_read_intw
int16_t lib3ds_io_read_intw(Lib3dsIo *io)
Definition: lib3ds_io.c:203
CHK_MAT_SELF_ILLUM
Definition: lib3ds_impl.h:124
lib3ds_material_free
LIB3DSAPI void lib3ds_material_free(Lib3dsMaterial *material)
Definition: lib3ds_material.c:79
chunk
else Out of place iCCP chunk
Definition: pngrutil.c:1260
Lib3dsMaterial::face_map
int face_map
Definition: lib3ds.h:243
texture_map_write
static void texture_map_write(uint16_t chunk, Lib3dsTextureMap *map, Lib3dsIo *io)
Definition: lib3ds_material.c:537
lib3ds_io_write_intd
void lib3ds_io_write_intd(Lib3dsIo *io, int32_t d)
Definition: lib3ds_io.c:384
lib3ds_io_read_intd
int32_t lib3ds_io_read_intd(Lib3dsIo *io)
Definition: lib3ds_io.c:219
Lib3dsMaterial::soften
int soften
Definition: lib3ds.h:242
Lib3dsMaterial::autorefl_map_frame_step
int autorefl_map_frame_step
Definition: lib3ds.h:268
Lib3dsMaterial::specular
float specular[3]
Definition: lib3ds.h:230
Lib3dsMaterial::transparency
float transparency
Definition: lib3ds.h:235
Lib3dsChunk
Definition: lib3ds_impl.h:295
initialize_texture_map
static void initialize_texture_map(Lib3dsTextureMap *map)
Definition: lib3ds_material.c:22
color_write
static void color_write(float rgb[3], Lib3dsIo *io)
Definition: lib3ds_material.c:506
int_percentage_read
static void int_percentage_read(float *p, Lib3dsIo *io)
Definition: lib3ds_material.c:145
CHK_INT_PERCENTAGE
Definition: lib3ds_impl.h:81
uint16_t
unsigned short uint16_t
Definition: SDL_config_windows.h:60
Lib3dsMaterial::use_wire
int use_wire
Definition: lib3ds.h:246
Lib3dsMaterial::texture1_mask
Lib3dsTextureMap texture1_mask
Definition: lib3ds.h:250
Lib3dsTextureMap::scale
float scale[2]
Definition: lib3ds.h:197
Lib3dsMaterial::specular_map
Lib3dsTextureMap specular_map
Definition: lib3ds.h:257
CHK_MAT_ENTRY
Definition: lib3ds_impl.h:111
color_read
static void color_read(float rgb[3], Lib3dsIo *io)
Definition: lib3ds_material.c:86
CHK_MAT_AMBIENT
Definition: lib3ds_impl.h:113
lib3ds_io_write_byte
void lib3ds_io_write_byte(Lib3dsIo *io, uint8_t b)
Definition: lib3ds_io.c:310
CHK_MAT_FACEMAP
Definition: lib3ds_impl.h:130
free
SDL_EventEntry * free
Definition: SDL_events.c:80
Lib3dsMaterial::autorefl_map_size
int autorefl_map_size
Definition: lib3ds.h:267
Lib3dsMaterial::use_wire_abs
int use_wire_abs
Definition: lib3ds.h:247
CHK_MAT_SHADING
Definition: lib3ds_impl.h:122
CHK_MAT_MAP_RCOL
Definition: lib3ds_impl.h:176
Lib3dsMaterial::texture1_map
Lib3dsTextureMap texture1_map
Definition: lib3ds.h:249
memset
#define memset
Definition: SDL_malloc.c:633
texture_map_read
static void texture_map_read(Lib3dsTextureMap *map, Lib3dsIo *io)
Definition: lib3ds_material.c:169
CHK_COLOR_24
Definition: lib3ds_impl.h:78
Lib3dsMaterial::name
char name[64]
Definition: lib3ds.h:227
lib3ds_material_new
LIB3DSAPI Lib3dsMaterial * lib3ds_material_new(const char *name)
Definition: lib3ds_material.c:39
CHK_MAT_TEXMASK
Definition: lib3ds_impl.h:136
CHK_MAT_SPECMASK
Definition: lib3ds_impl.h:152
CHK_MAT_ACUBIC
Definition: lib3ds_impl.h:165
lib3ds_chunk_unknown
void lib3ds_chunk_unknown(uint16_t chunk, Lib3dsIo *io)
Definition: lib3ds_chunk.c:140
name
EGLImageKHR EGLint * name
Definition: eglext.h:284
Lib3dsMaterial::wire_size
float wire_size
Definition: lib3ds.h:248
CHK_MAT_USE_REFBLUR
Definition: lib3ds_impl.h:123
CHK_MAT_SELFIMAP
Definition: lib3ds_impl.h:158
CHK_MAT_SHININESS
Definition: lib3ds_impl.h:116
lib3ds_io_read_intb
int8_t lib3ds_io_read_intb(Lib3dsIo *io)
Definition: lib3ds_io.c:190
CHK_MAT_MAP_USCALE
Definition: lib3ds_impl.h:169
CHK_MAT_MAP_TEXBLUR
Definition: lib3ds_impl.h:168
assert
#define assert(x)
Definition: SDL_malloc.c:1234
Lib3dsMaterial::bump_mask
Lib3dsTextureMap bump_mask
Definition: lib3ds.h:256
Lib3dsMaterial::self_illum
float self_illum
Definition: lib3ds.h:239
lib3ds_io_write_intb
void lib3ds_io_write_intb(Lib3dsIo *io, int8_t b)
Definition: lib3ds_io.c:356
CHK_MAT_MAP_VOFFSET
Definition: lib3ds_impl.h:172
CHK_MAT_SHINMASK
Definition: lib3ds_impl.h:156
CHK_MAT_REFLMAP
Definition: lib3ds_impl.h:162
Lib3dsTextureMap::percent
float percent
Definition: lib3ds.h:195
calloc
#define calloc
Definition: SDL_malloc.c:636
Lib3dsTextureMap::flags
unsigned flags
Definition: lib3ds.h:194
Lib3dsChunk::size
uint32_t size
Definition: lib3ds_impl.h:297
Lib3dsMaterial::autorefl_map_flags
unsigned autorefl_map_flags
Definition: lib3ds.h:265
Lib3dsMaterial::two_sided
int two_sided
Definition: lib3ds.h:244
lib3ds_chunk_read_next
uint16_t lib3ds_chunk_read_next(Lib3dsChunk *c, Lib3dsIo *io)
Definition: lib3ds_chunk.c:68
CHK_LIN_COLOR_F
Definition: lib3ds_impl.h:80
CHK_MAT_REFLMASK
Definition: lib3ds_impl.h:163
Lib3dsTextureMap::tint_g
float tint_g[3]
Definition: lib3ds.h:203
CHK_MAT_MAP_COL2
Definition: lib3ds_impl.h:175
Lib3dsTextureMap::rotation
float rotation
Definition: lib3ds.h:199
CHK_MAT_MAPNAME
Definition: lib3ds_impl.h:166
Lib3dsMaterial::specular_mask
Lib3dsTextureMap specular_mask
Definition: lib3ds.h:258
lib3ds_io_write_string
void lib3ds_io_write_string(Lib3dsIo *io, const char *s)
Definition: lib3ds_io.c:443
Lib3dsTextureMap::tint_b
float tint_b[3]
Definition: lib3ds.h:204
lib3ds_material_write
void lib3ds_material_write(Lib3dsMaterial *material, Lib3dsIo *io)
Definition: lib3ds_material.c:667
Lib3dsMaterial::reflection_mask
Lib3dsTextureMap reflection_mask
Definition: lib3ds.h:264
LIB3DS_LOG_INFO
Definition: lib3ds.h:52
lib3ds_chunk_write_start
void lib3ds_chunk_write_start(Lib3dsChunk *c, Lib3dsIo *io)
Definition: lib3ds_chunk.c:119
lib3ds_io_read_byte
uint8_t lib3ds_io_read_byte(Lib3dsIo *io)
Definition: lib3ds_io.c:143
CHK_MAT_TEX2MASK
Definition: lib3ds_impl.h:140
Lib3dsMaterial::autorefl_map_anti_alias
int autorefl_map_anti_alias
Definition: lib3ds.h:266
lib3ds_io_write_float
void lib3ds_io_write_float(Lib3dsIo *io, float l)
Definition: lib3ds_io.c:402
CHK_MAT_DECAL
Definition: lib3ds_impl.h:126
Lib3dsMaterial::opacity_mask
Lib3dsTextureMap opacity_mask
Definition: lib3ds.h:254
CHK_MAT_NAME
Definition: lib3ds_impl.h:112
Lib3dsMaterial::diffuse
float diffuse[3]
Definition: lib3ds.h:229
CHK_MAT_WIRE_SIZE
Definition: lib3ds_impl.h:133
CHK_MAT_MAP_BCOL
Definition: lib3ds_impl.h:178
lib3ds_chunk_read_reset
void lib3ds_chunk_read_reset(Lib3dsChunk *c, Lib3dsIo *io)
Definition: lib3ds_chunk.c:90
Lib3dsMaterial::shin_strength
float shin_strength
Definition: lib3ds.h:232
CHK_MAT_XPFALL
Definition: lib3ds_impl.h:119
Lib3dsTextureMap::tint_1
float tint_1[3]
Definition: lib3ds.h:200
p
GLfloat GLfloat p
Definition: glew.h:14938
CHK_MAT_SHIN2PCT
Definition: lib3ds_impl.h:117
CHK_MAT_SPECMAP
Definition: lib3ds_impl.h:150
Lib3dsMaterial::shading
int shading
Definition: lib3ds.h:241
int_percentage_write
static void int_percentage_write(float p, Lib3dsIo *io)
Definition: lib3ds_material.c:526
c
const GLfloat * c
Definition: glew.h:14913
CHK_MAT_BUMPMASK
Definition: lib3ds_impl.h:148
CHK_MAT_MAP_UOFFSET
Definition: lib3ds_impl.h:171
CHK_MAT_TEX2MAP
Definition: lib3ds_impl.h:138
lib3ds_io_read_word
uint16_t lib3ds_io_read_word(Lib3dsIo *io)
Definition: lib3ds_io.c:156
Lib3dsMaterial::texture2_mask
Lib3dsTextureMap texture2_mask
Definition: lib3ds.h:252
lib3ds_material_read
void lib3ds_material_read(Lib3dsMaterial *material, Lib3dsIo *io)
Definition: lib3ds_material.c:265
floor
double floor(double x)
Definition: s_floor.c:40
lib3ds_io_read_float
float lib3ds_io_read_float(Lib3dsIo *io)
Definition: lib3ds_io.c:237
Lib3dsMaterial::reflection_map
Lib3dsTextureMap reflection_map
Definition: lib3ds.h:263
FALSE
#define FALSE
Definition: ftobjs.h:57
int16_t
short int16_t
Definition: types.h:8
Lib3dsMaterial::use_falloff
int use_falloff
Definition: lib3ds.h:240
CHK_MAT_PHONGSOFT
Definition: lib3ds_impl.h:131
Lib3dsMaterial::map_decal
int map_decal
Definition: lib3ds.h:245
Lib3dsMaterial
Definition: lib3ds.h:224
Lib3dsTextureMap
Definition: lib3ds.h:190
Lib3dsMaterial::use_blur
int use_blur
Definition: lib3ds.h:233
CHK_MAT_BUMPMAP
Definition: lib3ds_impl.h:146
lib3ds_chunk_read_end
void lib3ds_chunk_read_end(Lib3dsChunk *c, Lib3dsIo *io)
Definition: lib3ds_chunk.c:96
CHK_COLOR_F
Definition: lib3ds_impl.h:77
Lib3dsMaterial::falloff
float falloff
Definition: lib3ds.h:236
CHK_MAT_SELF_ILPCT
Definition: lib3ds_impl.h:128
uint8_t
unsigned char uint8_t
Definition: SDL_config_windows.h:58
uint32_t
unsigned int uint32_t
Definition: SDL_config_windows.h:62
Lib3dsMaterial::opacity_map
Lib3dsTextureMap opacity_map
Definition: lib3ds.h:253
Lib3dsTextureMap::offset
float offset[2]
Definition: lib3ds.h:198
Lib3dsMaterial::blur
float blur
Definition: lib3ds.h:234
Lib3dsIo
Definition: lib3ds.h:56
CHK_MAT_WIRE
Definition: lib3ds_impl.h:129
CHK_MAT_SHINMAP
Definition: lib3ds_impl.h:154
lib3ds_io_read_string
void lib3ds_io_read_string(Lib3dsIo *io, char *s, int buflen)
Definition: lib3ds_io.c:285
Lib3dsMaterial::shininess_map
Lib3dsTextureMap shininess_map
Definition: lib3ds.h:259
Lib3dsMaterial::self_illum_flag
int self_illum_flag
Definition: lib3ds.h:238
Lib3dsTextureMap::blur
float blur
Definition: lib3ds.h:196
CHK_MAT_TEXMAP
Definition: lib3ds_impl.h:134
CHK_MAT_SPECULAR
Definition: lib3ds_impl.h:115
lib3ds_io_log
void lib3ds_io_log(Lib3dsIo *io, Lib3dsLogLevel level, const char *format,...)
Definition: lib3ds_io.c:100
Lib3dsTextureMap::name
char name[64]
Definition: lib3ds.h:193
lib3ds_chunk_write
void lib3ds_chunk_write(Lib3dsChunk *c, Lib3dsIo *io)
Definition: lib3ds_chunk.c:111
Lib3dsMaterial::shininess
float shininess
Definition: lib3ds.h:231
lib3ds_chunk_read_start
void lib3ds_chunk_read_start(Lib3dsChunk *c, uint16_t chunk, Lib3dsIo *io)
Definition: lib3ds_chunk.c:50
CHK_MAT_USE_XPFALL
Definition: lib3ds_impl.h:120
CHK_MAT_OPACMAP
Definition: lib3ds_impl.h:142
CHK_MAT_WIREABS
Definition: lib3ds_impl.h:132
Lib3dsMaterial::ambient
float ambient[3]
Definition: lib3ds.h:228
Lib3dsMaterial::texture2_map
Lib3dsTextureMap texture2_map
Definition: lib3ds.h:251
CHK_LIN_COLOR_24
Definition: lib3ds_impl.h:79
Lib3dsTextureMap::tint_r
float tint_r[3]
Definition: lib3ds.h:202
Lib3dsMaterial::shininess_mask
Lib3dsTextureMap shininess_mask
Definition: lib3ds.h:260
Lib3dsChunk::chunk
uint16_t chunk
Definition: lib3ds_impl.h:296
CHK_MAT_MAP_COL1
Definition: lib3ds_impl.h:174
i
int i
Definition: pngrutil.c:1377
map
const GLubyte GLuint GLuint GLuint GLuint alpha GLboolean GLboolean GLboolean GLboolean alpha GLint GLint GLsizei GLsizei GLenum type GLenum GLint GLenum GLint GLint GLsizei GLsizei GLint border GLenum GLint GLint GLint GLint GLint GLsizei GLsizei height GLsizei GLsizei GLenum GLenum const GLvoid *pixels GLenum GLint GLint GLint GLint j2 GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble zFar GLenum GLenum GLint *params GLenum GLenum GLint *params GLenum GLenum GLint *params GLenum GLenum GLfloat *params GLenum GLint GLenum GLenum GLvoid *pixels GLenum GLint GLenum GLint *params GLenum GLenum GLint *params GLenum GLsizei const GLvoid *pointer GLenum GLenum const GLint *params GLenum GLfloat GLfloat GLint GLint const GLfloat *points GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat *points GLint GLfloat GLfloat GLint GLfloat GLfloat v2 GLenum GLenum const GLint *params GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble zFar GLenum map
Definition: SDL_glfuncs.h:268
CHK_MAT_DIFFUSE
Definition: lib3ds_impl.h:114
CHK_MAT_MAP_VSCALE
Definition: lib3ds_impl.h:170
CHK_MAT_TRANSPARENCY
Definition: lib3ds_impl.h:118
Lib3dsMaterial::self_illum_mask
Lib3dsTextureMap self_illum_mask
Definition: lib3ds.h:262
TRUE
#define TRUE
Definition: ftobjs.h:53
lib3ds_impl.h
CHK_MAT_REFBLUR
Definition: lib3ds_impl.h:121
Lib3dsMaterial::is_additive
int is_additive
Definition: lib3ds.h:237
lib3ds_chunk_write_end
void lib3ds_chunk_write_end(Lib3dsChunk *c, Lib3dsIo *io)
Definition: lib3ds_chunk.c:129
CHK_MAT_MAP_ANG
Definition: lib3ds_impl.h:173
Lib3dsTextureMap::tint_2
float tint_2[3]
Definition: lib3ds.h:201
lib3ds_io_write_word
void lib3ds_io_write_word(Lib3dsIo *io, uint16_t w)
Definition: lib3ds_io.c:322
Lib3dsMaterial::bump_map
Lib3dsTextureMap bump_map
Definition: lib3ds.h:255