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 #define MAX_SPAN_LINES 1024 00028 #define MAX_SPANS 35000 00029 00030 typedef struct 00031 { 00032 int32 x1; // Starting x on screen 00033 int32 x2; // Ending x on screen 00034 } SPAN; 00035 00036 typedef struct _SList 00037 { 00038 int32 Min, Max; 00039 uint8 Used; 00040 uint32 Flags; 00041 _SList *Last; 00042 _SList *Next; 00043 } SLIST; 00044 00045 typedef struct 00046 { 00047 SLIST *First; 00048 SLIST *Current; 00049 } SPAN_MINMAX; 00050 00051 extern SPAN SpanLines[MAX_SPAN_LINES]; 00052 00053 extern SPAN_MINMAX SMinMax[MAX_SPAN_LINES]; // Linked list of spans for each scanline... 00054 extern SLIST ScanHash[MAX_SPANS]; // hash table for SList 00055 00056 extern int32 NumWorldPixels; 00057 extern int32 NumSpans; 00058 extern int32 NumSpanPixels[MAX_SPAN_LINES]; 00059 extern int32 PolysRendered; 00060 00061 void DRIVERCC EdgeOutNoUV (int32 x1, int32 y1, int32 x2, int32 y2); 00062 void DRIVERCC AddSpanNoUV(int32 x1, int32 x2, int32 y); 00063 00064 void ResetSList(void); 00065 SLIST *NewSList(void); 00066 void ResetSpans(int32 Rows); 00067 00068 #endif
1.3.2