aboutsummaryrefslogtreecommitdiff
path: root/src/libparsec/include/od_rast.h
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2026-08-24 11:16:07 +0200
committerFelix Morgner <felix.morgner@gmail.com>2026-08-24 11:16:07 +0200
commitc068f22329d5cc722622a2183bbb22eef2093df7 (patch)
tree12d56c1aede67988a55e241364606bfbb4dba933 /src/libparsec/include/od_rast.h
downloadopenparsec-c068f22329d5cc722622a2183bbb22eef2093df7.tar.xz
openparsec-c068f22329d5cc722622a2183bbb22eef2093df7.zip
initial importHEADmain
Diffstat (limited to 'src/libparsec/include/od_rast.h')
-rw-r--r--src/libparsec/include/od_rast.h124
1 files changed, 124 insertions, 0 deletions
diff --git a/src/libparsec/include/od_rast.h b/src/libparsec/include/od_rast.h
new file mode 100644
index 0000000..2d5e91b
--- /dev/null
+++ b/src/libparsec/include/od_rast.h
@@ -0,0 +1,124 @@
+/*
+ * PARSEC HEADER (OBJECT)
+ * Rasterization Types V1.70
+ *
+ * Copyright (c) Markus Hadwiger 1995-1999
+ * All Rights Reserved.
+ */
+
+#ifndef _OD_RAST_H_
+#define _OD_RAST_H_
+
+
+// coordinate on actual screen (integral component on the integer lattice) ----
+//
+typedef dword ugrid_t; // unsigned!
+typedef int32_t sgrid_t; // signed!
+typedef rastv_t fgrid_t;
+
+
+// 2-D point in unsigned integer coordinates (always >= 0) --------------------
+//
+struct UPoint {
+
+ ugrid_t X; // unsigned!
+ ugrid_t Y; // unsigned!
+};
+
+
+// 2-D point in screen coordinates (used in vertex list for the edge tracer) --
+//
+struct SPoint {
+
+ sgrid_t X; // signed!
+ sgrid_t Y; // signed!
+};
+
+
+// extended version of SPoint structure; contains z and color info ------------
+//
+struct SPointEx {
+
+ sgrid_t X; // signed!
+ sgrid_t Y; // signed!
+ depth_t View_Z; // Z coordinate in view space (for buffer fill)
+ dword RGBA; // RGBA color (8-bit channels)
+};
+
+
+// 2-D point in screen coordinates with fractional part -----------------------
+//
+struct FPoint {
+
+ fgrid_t X; // 8 bytes
+ fgrid_t Y;
+};
+
+
+// defines a polygon that should by rendered and drawn to the screen; ---------
+// created after projection of 3-D polygon; scaled to screen coordinates;
+// used only by edge tracer (must be filled from the object structure)
+//
+struct SVertexList {
+
+ dword VCount; // number of vertices in list
+ SPoint Vertices[ 1 ]; // first element of vertex list (array)
+};
+
+
+// list of extended SPoints ---------------------------------------------------
+//
+struct SVertexExList {
+
+ dword VCount; // number of vertices in list
+ SPointEx Vertices[ 1 ]; // first element of vertex list (array)
+};
+
+
+// defines single horizontal span; used for horizontal span list structure ----
+// the span starts at XLeft and ends at XRight (inclusively)
+//
+struct HSpan {
+
+ ugrid_t XLeft; // size is 8 bytes
+ ugrid_t XRight;
+};
+
+
+// extended version of HSpan structure; contains z and lighting info ----------
+//
+struct HSpanEx {
+
+ ugrid_t XLeft; // size is 16 bytes
+ ugrid_t XRight;
+ word ZLeft;
+ word ILeft;
+ word ZRight;
+ word IRight;
+};
+
+
+// stores list of horizontal spans; created by polygon edge-tracer; -----------
+// used by low level polygon drawing/rendering functions
+//
+struct HSpanList {
+
+ dword Height; // length of list (height of bounding rectangle)
+ ugrid_t TopY; // lowest y coordinate of polygon vertices
+ HSpan HSpans[ 1 ]; // first element of horizontal span list (array)
+};
+
+
+// list of extended HSpans ----------------------------------------------------
+//
+struct HSpanExList {
+
+ dword Height; // length of list (height of bounding rectangle)
+ ugrid_t TopY; // lowest y coordinate of polygon vertices
+ HSpanEx HSpans[ 1 ]; // first element of horizontal span list (array)
+};
+
+
+#endif // _OD_RAST_H_
+
+