00001 /****************************************************************************************/ 00002 /* GSpan.h */ 00003 /* */ 00004 /* Author: John Pollard */ 00005 /* Description: Front to back span code */ 00006 /* */ 00007 /* The contents of this file are subject to the Genesis3D Public License */ 00008 /* Version 1.01 (the "License"); you may not use this file except in */ 00009 /* compliance with the License. You may obtain a copy of the License at */ 00010 /* http://www.genesis3d.com */ 00011 /* */ 00012 /* Software distributed under the License is distributed on an "AS IS" */ 00013 /* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See */ 00014 /* the License for the specific language governing rights and limitations */ 00015 /* under the License. */ 00016 /* */ 00017 /* The Original Code is Genesis3D, released March 25, 1999. */ 00018 /* Genesis3D Version 1.1 released November 15, 1999 */ 00019 /* Copyright (C) 1999 WildTangent, Inc. All Rights Reserved */ 00020 /* */ 00021 /****************************************************************************************/ 00022 #ifndef GSPAN 00023 #define GSPAN 00024 00025 #include <Windows.h> 00026 00027 #include "DCommon.h" 00028 00029 #ifdef __cplusplus 00030 extern "C" { 00031 #endif 00032 00033 #define MAX_SPAN_LINES 1024 00034 #define MAX_SPANS 35000 00035 00036 typedef struct 00037 { 00038 int32 x1; // Starting x on screen 00039 int32 x2; // Ending x on screen 00040 } SPAN; 00041 00042 typedef struct SLIST 00043 { 00044 uint8 Used; 00045 int32 Min, Max; 00046 uint32 Flags; 00047 struct SLIST *Last; 00048 struct SLIST *Next; 00049 } SLIST; 00050 00051 typedef struct 00052 { 00053 SLIST *First; 00054 SLIST *Current; 00055 } SPAN_MINMAX; 00056 00057 extern SPAN SpanLines[MAX_SPAN_LINES]; 00058 00059 extern SPAN_MINMAX SMinMax[MAX_SPAN_LINES]; // Linked list of spans for each scanline... 00060 extern SLIST ScanHash[MAX_SPANS]; // hash table for SList 00061 00062 extern int32 NumWorldPixels; 00063 extern int32 NumSpans; 00064 extern int32 NumSpanPixels[MAX_SPAN_LINES]; 00065 extern int32 PolysRendered; 00066 00067 void DRIVERCC EdgeOutNoUV (int32 x1, int32 y1, int32 x2, int32 y2); 00068 void DRIVERCC AddSpanNoUV(int32 x1, int32 x2, int32 y); 00069 00070 void ResetSList(void); 00071 SLIST *NewSList(void); 00072 void ResetSpans(int32 Rows); 00073 00074 #ifdef __cplusplus 00075 } 00076 #endif 00077 00078 #endif
1.3.2