OSDN Git Service

got 8086 port of wolf3d to work and sod to work
[proj16/16.git] / 16 / WOLFSRC / ID_VH.H
1 // ID_VH.H\r
2 \r
3 \r
4 #define WHITE                   15                      // graphics mode independant colors\r
5 #define BLACK                   0\r
6 #define FIRSTCOLOR              1\r
7 #define SECONDCOLOR             12\r
8 #define F_WHITE                 15\r
9 #define F_BLACK                 0\r
10 #define F_FIRSTCOLOR    1\r
11 #define F_SECONDCOLOR   12\r
12 \r
13 //===========================================================================\r
14 \r
15 #define MAXSHIFTS       1\r
16 \r
17 typedef struct\r
18 {\r
19   int   width,\r
20         height,\r
21         orgx,orgy,\r
22         xl,yl,xh,yh,\r
23         shifts;\r
24 } spritetabletype;\r
25 \r
26 typedef struct\r
27 {\r
28         unsigned        sourceoffset[MAXSHIFTS];\r
29         unsigned        planesize[MAXSHIFTS];\r
30         unsigned        width[MAXSHIFTS];\r
31         byte            data[];\r
32 } spritetype;           // the memptr for each sprite points to this\r
33 \r
34 typedef struct\r
35 {\r
36         int width,height;\r
37 } pictabletype;\r
38 \r
39 \r
40 typedef struct\r
41 {\r
42         int height;\r
43         int location[256];\r
44         char width[256];\r
45 } fontstruct;\r
46 \r
47 \r
48 //===========================================================================\r
49 \r
50 \r
51 extern  pictabletype    _seg *pictable;\r
52 extern  pictabletype    _seg *picmtable;\r
53 extern  spritetabletype _seg *spritetable;\r
54 \r
55 extern  byte    fontcolor;\r
56 extern  int     fontnumber;\r
57 extern  int     px,py;\r
58 \r
59 //\r
60 // Double buffer management routines\r
61 //\r
62 \r
63 void VW_InitDoubleBuffer (void);\r
64 int      VW_MarkUpdateBlock (int x1, int y1, int x2, int y2);\r
65 void VW_UpdateScreen (void);\r
66 \r
67 //\r
68 // mode independant routines\r
69 // coordinates in pixels, rounded to best screen res\r
70 // regions marked in double buffer\r
71 //\r
72 \r
73 void VWB_DrawTile8 (int x, int y, int tile);\r
74 void VWB_DrawTile8M (int x, int y, int tile);\r
75 void VWB_DrawTile16 (int x, int y, int tile);\r
76 void VWB_DrawTile16M (int x, int y, int tile);\r
77 void VWB_DrawPic (int x, int y, int chunknum);\r
78 void VWB_DrawMPic(int x, int y, int chunknum);\r
79 void VWB_Bar (int x, int y, int width, int height, int color);\r
80 \r
81 void VWB_DrawPropString  (char far *string);\r
82 void VWB_DrawMPropString (char far *string);\r
83 void VWB_DrawSprite (int x, int y, int chunknum);\r
84 void VWB_Plot (int x, int y, int color);\r
85 void VWB_Hlin (int x1, int x2, int y, int color);\r
86 void VWB_Vlin (int y1, int y2, int x, int color);\r
87 \r
88 \r
89 //\r
90 // wolfenstein EGA compatability stuff\r
91 //\r
92 extern byte far gamepal;\r
93 \r
94 void VH_SetDefaultColors (void);\r
95 \r
96 #define VW_Startup              VL_Startup\r
97 #define VW_Shutdown             VL_Shutdown\r
98 #define VW_SetCRTC              VL_SetCRTC\r
99 #define VW_SetScreen    VL_SetScreen\r
100 #define VW_Bar                  VL_Bar\r
101 #define VW_Plot                 VL_Plot\r
102 #define VW_Hlin(x,z,y,c)        VL_Hlin(x,y,(z)-(x)+1,c)\r
103 #define VW_Vlin(y,z,x,c)        VL_Vlin(x,y,(z)-(y)+1,c)\r
104 #define VW_DrawPic              VH_DrawPic\r
105 #define VW_SetSplitScreen       VL_SetSplitScreen\r
106 #define VW_SetLineWidth         VL_SetLineWidth\r
107 #define VW_ColorBorder  VL_ColorBorder\r
108 #define VW_WaitVBL              VL_WaitVBL\r
109 #define VW_FadeIn()             VL_FadeIn(0,255,&gamepal,30);\r
110 #define VW_FadeOut()    VL_FadeOut(0,255,0,0,0,30);\r
111 #define VW_ScreenToScreen       VL_ScreenToScreen\r
112 #define VW_SetDefaultColors     VH_SetDefaultColors\r
113 void    VW_MeasurePropString (char far *string, word *width, word *height);\r
114 #define EGAMAPMASK(x)   VGAMAPMASK(x)\r
115 #define EGAWRITEMODE(x) VGAWRITEMODE(x)\r
116 \r
117 //#define VW_MemToScreen        VL_MemToLatch\r
118 \r
119 #define MS_Quit                 Quit\r
120 \r
121 \r
122 #define LatchDrawChar(x,y,p) VL_LatchToScreen(latchpics[0]+(p)*16,2,8,x,y)\r
123 #define LatchDrawTile(x,y,p) VL_LatchToScreen(latchpics[1]+(p)*64,4,16,x,y)\r
124 \r
125 void LatchDrawPic (unsigned x, unsigned y, unsigned picnum);\r
126 void    LoadLatchMem (void);\r
127 boolean         FizzleFade (unsigned source, unsigned dest,\r
128         unsigned width,unsigned height, unsigned frames,boolean abortable);\r
129 \r
130 \r
131 #define NUMLATCHPICS    100\r
132 extern  unsigned        latchpics[NUMLATCHPICS];\r
133 extern  unsigned freelatch;\r
134 \r