wolf3d

The original open source release of Wolfenstein 3D
Log | Files | Refs

ID_VH.H (3353B)


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