Draws the 2 triangles of the Terrainlist[index] (software)
| 2713 | static g3Point *slist[256]; |
| 2714 | // Draws the 2 triangles of the Terrainlist[index] (software) |
| 2715 | int DrawTerrainTrianglesSoftware(int index, int bm_handle, int upper_left, int lower_right) { |
| 2716 | /* |
| 2717 | #if !defined(POSIX) |
| 2718 | int i,tlist[4],close=0,lit=0; |
| 2719 | float closest_z=9999; |
| 2720 | int color; |
| 2721 | int n=Terrain_list[index].segment; |
| 2722 | int lod=Terrain_list[index].lod; |
| 2723 | |
| 2724 | terrain_segment *tseg=&Terrain_seg[n]; |
| 2725 | terrain_tex_segment *texseg=&Terrain_tex_seg[tseg->texseg_index]; |
| 2726 | int rotation=texseg->rotation & 0x0F; |
| 2727 | int tile=texseg->rotation >> 4; |
| 2728 | int simplemul=1<<((MAX_TERRAIN_LOD-1)-lod); |
| 2729 | int cx,cz,smul_x,smul_z; |
| 2730 | #if (defined(EDITOR) || defined(NEWEDITOR)) |
| 2731 | ddgr_color oldcolor; |
| 2732 | #endif |
| 2733 | cx=n%TERRAIN_WIDTH; |
| 2734 | cz=n/TERRAIN_WIDTH; |
| 2735 | int subx=cx % MAX_LOD_SIZE; |
| 2736 | int subz=(MAX_LOD_SIZE-1)-((cz+(simplemul-1)) % MAX_LOD_SIZE); |
| 2737 | if (cx+simplemul==TERRAIN_WIDTH) |
| 2738 | smul_x=simplemul-1; |
| 2739 | else |
| 2740 | smul_x=simplemul; |
| 2741 | if (cz+simplemul==TERRAIN_DEPTH) |
| 2742 | smul_z=simplemul-1; |
| 2743 | else |
| 2744 | smul_z=simplemul; |
| 2745 | |
| 2746 | // Note - this is upper left and proceeds lockwise |
| 2747 | tlist[0]=n+(TERRAIN_WIDTH*smul_z); |
| 2748 | tlist[1]=n+(TERRAIN_WIDTH*smul_z)+(smul_x); |
| 2749 | tlist[2]=n+(smul_x); |
| 2750 | tlist[3]=n; |
| 2751 | rend_SetOverlayType (OT_NONE); |
| 2752 | for (close=0,i=0;i<4;i++) |
| 2753 | { |
| 2754 | base[i]=*((g3Point *)&World_point_buffer[tlist[i]]); |
| 2755 | base[i].p3_flags|=(PF_L|PF_RGBA); |
| 2756 | base[i].p3_l=Ubyte_to_float[Terrain_seg[tlist[i]].l]; |
| 2757 | |
| 2758 | // only do perspective if all the points are inside our range |
| 2759 | if (!UseHardware) |
| 2760 | { |
| 2761 | if (base[i].p3_vec.z<TERRAIN_PERSPECTIVE_TEXTURE_DEPTH) |
| 2762 | close=1; |
| 2763 | if (base[i].p3_vec.z<closest_z) |
| 2764 | closest_z=base[i].p3_vec.z; |
| 2765 | } |
| 2766 | } |
| 2767 | base[0].p3_u=TerrainUSpeedup[rotation][subz*LOD_ROW_SIZE+subx]*tile; |
| 2768 | base[0].p3_v=TerrainVSpeedup[rotation][subz*LOD_ROW_SIZE+subx]*tile; |
| 2769 | base[1].p3_u=TerrainUSpeedup[rotation][subz*LOD_ROW_SIZE+subx+simplemul]*tile; |
| 2770 | base[1].p3_v=TerrainVSpeedup[rotation][subz*LOD_ROW_SIZE+subx+simplemul]*tile; |
| 2771 | base[2].p3_u=TerrainUSpeedup[rotation][((subz+simplemul)*LOD_ROW_SIZE)+subx+simplemul]*tile; |
| 2772 | base[2].p3_v=TerrainVSpeedup[rotation][((subz+simplemul)*LOD_ROW_SIZE)+subx+simplemul]*tile; |
no outgoing calls
no test coverage detected