Rev 298 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 298 | Rev 333 | ||
---|---|---|---|
Line 25... | Line 25... | ||
25 | 25 | ||
26 | 26 | ||
Line 27... | Line -... | ||
27 | static const char |
- | |
28 | rcsid[] = "$Id: r_data.c,v 1.4 1997/02/03 16:47:55 b1 Exp $"; |
- | |
29 | - | ||
30 | #ifdef __BEOS__ |
- | |
31 | #ifdef __GNUC__ |
- | |
32 | extern void *alloca(int); |
- | |
33 | #else |
- | |
34 | #include |
- | |
35 | #endif |
- | |
36 | #endif /* __BEOS__ */ |
- | |
37 | 27 | static const char |
|
38 | #include "m_swap.h" |
28 | rcsid[] = "$Id: r_data.c,v 1.4 1997/02/03 16:47:55 b1 Exp $"; |
Line -... | Line 29... | ||
- | 29 | ||
- | 30 | #include "i_system.h" |
|
39 | 31 | #include "z_zone.h" |
|
Line 40... | Line 32... | ||
40 | #include "i_system.h" |
32 | |
41 | #include "z_zone.h" |
33 | #include "m_swap.h" |
42 | 34 | ||
Line 43... | Line 35... | ||
43 | #include "w_wad.h" |
35 | #include "w_wad.h" |
44 | 36 | ||
Line 45... | Line -... | ||
45 | #include "doomdef.h" |
- | |
46 | #include "r_local.h" |
37 | #include "doomdef.h" |
- | 38 | #include "r_local.h" |
|
- | 39 | #include "p_local.h" |
|
- | 40 | ||
- | 41 | #include "doomstat.h" |
|
47 | #include "p_local.h" |
42 | #include "r_sky.h" |
48 | 43 | ||
49 | #include "doomstat.h" |
44 | #include |
50 | #include "r_sky.h" |
45 | |
51 | 46 | ||
Line 120... | Line 115... | ||
120 | short int width; |
115 | short int width; |
121 | short int height; |
116 | short int height; |
Line 122... | Line 117... | ||
122 | 117 | ||
123 | // All the patches[patchcount] |
118 | // All the patches[patchcount] |
124 | // are drawn back to front into the cached texture. |
119 | // are drawn back to front into the cached texture. |
125 | short patchcount; |
120 | short int patchcount; |
Line 126... | Line 121... | ||
126 | texpatch_t patches[1]; |
121 | texpatch_t patches[1]; |
Line 289... | Line 284... | ||
289 | // Now that the texture has been built in column cache, |
284 | // Now that the texture has been built in column cache, |
290 | // it is purgable from zone memory. |
285 | // it is purgable from zone memory. |
291 | Z_ChangeTag (block, PU_CACHE); |
286 | Z_ChangeTag (block, PU_CACHE); |
292 | } |
287 | } |
Line -... | Line 288... | ||
- | 288 | ||
- | 289 | ||
293 | 290 | ||
294 | // |
291 | // |
295 | // R_GenerateLookup |
292 | // R_GenerateLookup |
296 | // |
293 | // |
297 | void R_GenerateLookup (int texnum) |
294 | void R_GenerateLookup (int texnum) |
Line 529... | Line 526... | ||
529 | 526 | ||
530 | texture->width = SHORT(mtexture->width); |
527 | texture->width = SHORT(mtexture->width); |
531 | texture->height = SHORT(mtexture->height); |
528 | texture->height = SHORT(mtexture->height); |
Line 532... | Line -... | ||
532 | texture->patchcount = SHORT(mtexture->patchcount); |
- | |
533 | - | ||
534 | // memcpy() generates a BUS error on Solaris with optimization on */ |
529 | texture->patchcount = SHORT(mtexture->patchcount); |
535 | #if 1 |
- | |
536 | memcpy (texture->name, mtexture->name, sizeof(texture->name)); |
- | |
537 | #else |
- | |
538 | { char *src; char *dst; |
- | |
539 | src = (char *)mtexture->name; |
- | |
540 | dst = (char *)texture->name; |
- | |
541 | for (j=0; j |
- | |
542 | *dst++ = *src++; |
- | |
543 | } |
530 | |
544 | #endif |
531 | memcpy (texture->name, mtexture->name, sizeof(texture->name)); |
Line 545... | Line 532... | ||
545 | mpatch = &mtexture->patches[0]; |
532 | mpatch = &mtexture->patches[0]; |
546 | patch = &texture->patches[0]; |
533 | patch = &texture->patches[0]; |
Line 663... | Line 650... | ||
663 | // Must be called after W_Init. |
650 | // Must be called after W_Init. |
664 | // |
651 | // |
665 | void R_InitData (void) |
652 | void R_InitData (void) |
666 | { |
653 | { |
667 | R_InitTextures (); |
654 | R_InitTextures (); |
668 | printf ("\nInitTextures"); |
655 | printf ("InitTextures\n\r"); |
669 | R_InitFlats (); |
656 | R_InitFlats (); |
670 | printf ("\nInitFlats"); |
657 | printf ("InitFlats\n\r"); |
671 | R_InitSpriteLumps (); |
658 | R_InitSpriteLumps (); |
672 | printf ("\nInitSprites"); |
659 | printf ("InitSprites\n\r"); |
673 | R_InitColormaps (); |
660 | R_InitColormaps (); |
674 | printf ("\nInitColormaps"); |
661 | printf ("InitColormaps\n\r"); |
675 | } |
662 | } |
Line 676... | Line 663... | ||
676 | 663 | ||
Line 711... | Line 698... | ||
711 | // "NoTexture" marker. |
698 | // "NoTexture" marker. |
712 | if (name[0] == '-') |
699 | if (name[0] == '-') |
713 | return 0; |
700 | return 0; |
Line 714... | Line 701... | ||
714 | 701 | ||
715 | for (i=0 ; i |
702 | for (i=0 ; i |
716 | if (!I_strncasecmp (textures[i]->name, name, 8) ) |
703 | if (!strnicmp (textures[i]->name, name, 8) ) |
Line 717... | Line 704... | ||
717 | return i; |
704 | return i; |
718 | 705 | ||
Line 719... | Line -... | ||
719 | return -1; |
- | |
720 | } |
- | |
721 | 706 | return -1; |
|
722 | 707 | } |
|
723 | 708 | ||
724 | // |
709 | // |
725 | // R_TextureNumForName |
710 | // R_TextureNumForName |