00001 /****************************************************************************************/ 00002 /* SpanBuffer.H */ 00003 /* */ 00004 /* Author: Mike Sandige */ 00005 /* Description: This is a raster-line based span buffer (like a z buffer but it works */ 00006 /* with groups of horizontal pixels, rather than single pixels) */ 00007 /* */ 00008 /* The contents of this file are subject to the Genesis3D Public License */ 00009 /* Version 1.01 (the "License"); you may not use this file except in */ 00010 /* compliance with the License. You may obtain a copy of the License at */ 00011 /* http://www.genesis3d.com */ 00012 /* */ 00013 /* Software distributed under the License is distributed on an "AS IS" */ 00014 /* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See */ 00015 /* the License for the specific language governing rights and limitations */ 00016 /* under the License. */ 00017 /* */ 00018 /* The Original Code is Genesis3D, released March 25, 1999. */ 00019 /* Genesis3D Version 1.1 released November 15, 1999 */ 00020 /* Copyright (C) 1999 WildTangent, Inc. All Rights Reserved */ 00021 /* */ 00022 /****************************************************************************************/ 00023 #ifndef SPANBUFFER_H 00024 #define SPANBUFFER_H 00025 00026 #include "basetype.h" 00027 00028 #ifdef __cplusplus 00029 extern "C" { 00030 #endif 00031 00032 typedef struct 00033 { // This is a clipped segment of a span. 00034 int LeftOffset; // offset from starting pixel from original span (LeftStart) 00035 int Width; // width of this segment 00036 } SpanBuffer_ClipSegment; 00037 00038 // this array holds the resulting clipped spans (segments) that result from calling _ClipAndAdd() 00039 extern SpanBuffer_ClipSegment *SpanBuffer_Segments; 00040 00041 00042 // initializes the span buffer 00043 geBoolean SpanBuffer_Create(int Width, int Height, int MaxSpans); 00044 00045 // destroys the span buffer 00046 void SpanBuffer_Destroy(void); 00047 00048 // empties the span buffer 00049 void SpanBuffer_Clear(void); 00050 00051 // adds a new span. The span is specified by a starting pixel and a width(number of pixels) 00052 // The return value is the number of clipped spans (segments) to draw. (0 if none) 00053 // The clipped spans are put into the exported array (SpanBuffer_Segments[0..return value+1]) 00054 int SpanBuffer_ClipAndAdd(int Line, int LeftStart, int Width); 00055 00056 00057 #ifdef __cplusplus 00058 } 00059 #endif 00060 00061 00062 #endif
1.3.2