19fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/**************************************************************************** 29fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* 39fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* MegaGraph Graphics Library 49fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* 59fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* Copyright (C) 1996 SciTech Software. 69fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* All rights reserved. 79fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* 89fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* Filename: $Workfile: mgraph.h $ 99fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* Version: $Revision: 1.29 $ 109fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* 119fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* Language: ANSI C 129fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* Environment: IBM PC (MS DOS) 139fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* 149fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* Description: Header file for the MegaGraph Graphics Library. You can 159fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* defined one of the following to specify which MGL API you 169fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* wish to use. 179fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* 189fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* MGL_LITE - Compile for the MGL/Lite API 199fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* MGL_PRO - Compile for the MGL/Pro API 209fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* MGL_FIX3D - Compile for the MGL/3D API (fixed point) 219fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* MGL_FLT3D - Compile for the MGL/3D API (floating point) 229fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* 239fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* If you do not define any of these, MGL_FIX3D will be defined 249fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* automatically for compatibility with older versions of the 259fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* MGL. 269fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* 279fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* $Date: 11 Mar 1997 16:46:42 $ $Author: KendallB $ 289fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream* 299fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream****************************************************************************/ 309fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 319fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef __MGRAPH_H 329fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define __MGRAPH_H 339fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 349fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#include <stdio.h> 359fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 369fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef __DEBUG_H 379fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#include "debug.h" 389fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 399fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 409fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#if !defined(MGL_LITE) && !defined(MGL_PRO) && !defined(MGL_FIX3D) \ 419fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream && !defined(MGL_FLT3D) 429fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_FIX3D 439fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 449fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 459fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#if defined(MGL_FIX3D) || defined(MGL_FLT3D) 469fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_3D 479fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 489fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 499fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/*---------------------- Macros and type definitions ----------------------*/ 509fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 519fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#pragma pack(1) /* Pack structures to byte granularity */ 529fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 539fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Define the version number for the MGL release */ 549fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 559fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_VERSION_STR "3.1" 569fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 579fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Define the calling conventions for all public MGL functions. If we 589fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * are compiling the MGL as a DLL, then all public functions are compiled 599fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * and exported with standard C calling conventions, otherwise we use 609fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * the default calling conventions provided by the compiler. 619fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * 629fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * Note that because Watcom C++ uses register based parameter passing 639fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * by default we also provide special DLL's for watcom that are compiled 649fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * with register parameter passing. This is necessary to work with all 659fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * the extra libraries provided as they are all compiled to call MGL 669fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * functions with arguments in registers whenever possible. You can still 679fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * use the standard DLL but if you do you will need to re-compile all 689fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * of the extra libraries with the MGL_DLL #define to change the calling 699fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * conventions for the MGL functions. 709fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 719fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 729fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#if defined(MGL_DLL) 739fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGLAPI _EXPORT __cdecl 749fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#else 759fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGLAPI _EXPORT _PUBAPI 769fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 779fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define ASMAPI _EXPORT __cdecl 789fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 799fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Define a type for integers used in the library. For most environments 809fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * we simply define it as a normal integer (16 or 32 bits), however for 819fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * 16 bit Windows it is defined as a 32 bit integer as all the real code 829fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * lives in a 32 bit DLL that uses 32 bit integers. 839fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 849fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 859fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef __M_INT_DEFINED 869fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#if defined(__WINDOWS16__) 879fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef long m_int; 889fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef unsigned long m_uint; 899fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#else 909fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef int m_int; 919fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef unsigned int m_uint; 929fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 939fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define __M_INT_DEFINED 949fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 959fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 969fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Define the graphics subsystems available */ 979fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 989fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef enum { 999fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grDETECT = -1, /* Auto detect the graphics subsystem */ 1009fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grNONE = 0, /* No graphics hardware detected */ 1019fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grVGA, /* Standard VGA */ 1029fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grVESA, /* VESA VBE compliant SuperVGA */ 1039fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA, /* Unaccelerated SuperVGA */ 1049fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grACCEL, /* Accelerated SuperVGA */ 1059fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grDDRAW, /* Unaccelerated DirectDraw */ 1069fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grDDRAWACCEL, /* Accelerated DirectDraw */ 1079fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grDDRAW3D, /* 3D Accelerated DirectDraw */ 1089fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grMAXDRIVER, /* Maximum driver number */ 1099fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } MGL_driverType; 1109fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 1119fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Graphics modes supported - the only video modes supported by this 1129fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * graphics library are those that support at least 16 colors per pixel. 1139fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 1149fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 1159fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef enum { 1169fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream /* 16 color VGA video modes */ 1179fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 1189fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grVGA_320x200x16, 1199fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grVGA_640x200x16, 1209fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grVGA_640x350x16, 1219fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grVGA_640x400x16, 1229fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grVGA_640x480x16, 1239fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_800x600x16, 1249fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 1259fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream /* 256 color VGA ModeX video modes */ 1269fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 1279fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grVGAX_320x200x256, 1289fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grVGAX_320x240x256, 1299fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grVGAX_320x400x256, 1309fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grVGAX_320x480x256, 1319fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 1329fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream /* 256 color VGA video modes */ 1339fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 1349fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grVGA_320x200x256, 1359fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 1369fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream /* 256 color VGA/SuperVGA video modes */ 1379fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 1389fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_320x200x256, 1399fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_320x240x256, 1409fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_320x400x256, 1419fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_320x480x256, 1429fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_400x300x256, 1439fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_512x384x256, 1449fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_640x350x256, 1459fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_640x400x256, 1469fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_640x480x256, 1479fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_800x600x256, 1489fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1024x768x256, 1499fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1152x864x256, 1509fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1280x960x256, 1519fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1280x1024x256, 1529fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1600x1200x256, 1539fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 1549fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream /* 32,768 color Super VGA video modes */ 1559fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 1569fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_320x200x32k, 1579fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_320x240x32k, 1589fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_320x400x32k, 1599fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_320x480x32k, 1609fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_400x300x32k, 1619fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_512x384x32k, 1629fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_640x350x32k, 1639fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_640x400x32k, 1649fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_640x480x32k, 1659fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_800x600x32k, 1669fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1024x768x32k, 1679fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1152x864x32k, 1689fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1280x960x32k, 1699fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1280x1024x32k, 1709fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1600x1200x32k, 1719fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 1729fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream /* 65,536 color Super VGA video modes */ 1739fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 1749fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_320x200x64k, 1759fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_320x240x64k, 1769fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_320x400x64k, 1779fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_320x480x64k, 1789fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_400x300x64k, 1799fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_512x384x64k, 1809fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_640x350x64k, 1819fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_640x400x64k, 1829fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_640x480x64k, 1839fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_800x600x64k, 1849fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1024x768x64k, 1859fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1152x864x64k, 1869fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1280x960x64k, 1879fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1280x1024x64k, 1889fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1600x1200x64k, 1899fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 1909fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream /* 16 million color, 24 bits per pixel Super VGA video modes */ 1919fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 1929fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_320x200x16m, 1939fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_320x240x16m, 1949fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_320x400x16m, 1959fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_320x480x16m, 1969fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_400x300x16m, 1979fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_512x384x16m, 1989fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_640x350x16m, 1999fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_640x400x16m, 2009fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_640x480x16m, 2019fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_800x600x16m, 2029fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1024x768x16m, 2039fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1152x864x16m, 2049fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1280x960x16m, 2059fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1280x1024x16m, 2069fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1600x1200x16m, 2079fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 2089fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream /* 16 million color, 32 bits per pixel Super VGA video modes */ 2099fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 2109fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_320x200x4G, 2119fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_320x240x4G, 2129fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_320x400x4G, 2139fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_320x480x4G, 2149fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_400x300x4G, 2159fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_512x384x4G, 2169fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_640x350x4G, 2179fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_640x400x4G, 2189fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_640x480x4G, 2199fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_800x600x4G, 2209fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1024x768x4G, 2219fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1152x864x4G, 2229fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1280x960x4G, 2239fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1280x1024x4G, 2249fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grSVGA_1600x1200x4G, 2259fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 2269fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream /* Render into Windowing System DC (Windows, OS/2 PM, X11) */ 2279fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 2289fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grWINDOWED, 2299fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 2309fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grMAXMODE, /* Maximum mode number */ 2319fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } MGL_modeType; 2329fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 2339fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* MGL_result() error codes */ 2349fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 2359fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef enum { 2369fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grOK = 0, /* No error */ 2379fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grNoInit = -1, /* Graphics driver has not been installed */ 2389fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grNotDetected = -2, /* Graphics hardware was not detected */ 2399fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grDriverNotFound= -3, /* Graphics driver file not found */ 2409fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grBadDriver = -4, /* File loaded was not a graphics driver */ 2419fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grLoadMem = -5, /* Not enough memory to load graphics driver*/ 2429fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grInvalidMode = -6, /* Invalid graphics mode for selected driver*/ 2439fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grError = -8, /* General graphics error */ 2449fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grInvalidName = -9, /* Invalid driver name */ 2459fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grNoMem = -10, /* Not enough memory to perform operation */ 2469fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grNoModeSupport = -11, /* Select video mode not supported by hard. */ 2479fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grInvalidFont = -12, /* Invalid font data */ 2489fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grBadFontFile = -13, /* File loaded was not a font file */ 2499fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grFontNotFound = -14, /* Font file was not found */ 2509fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grOldDriver = -15, /* Driver file is an old version */ 2519fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grInvalidDevice = -16, /* Invalid device for selected operation */ 2529fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grInvalidDC = -17, /* Invalid device context */ 2539fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grInvalidCursor = -18, /* Invalid cursor file */ 2549fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grCursorNotFound= -19, /* Cursor file was not found */ 2559fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grInvalidIcon = -20, /* Invalid icon file */ 2569fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grIconNotFound = -21, /* Icon file was not found */ 2579fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grInvalidBitmap = -22, /* Invalid bitmap file */ 2589fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grBitmapNotFound= -23, /* Bitmap file was not found */ 2599fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grZbufferTooBig = -24, /* Zbuffer allocation is too large */ 2609fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grNewFontFile = -25, /* Only Windows 2.x font files supported */ 2619fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grNoDoubleBuff = -26, /* Double buffering is not available */ 2629fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grNoHardwareBlt = -28, /* No hardware bitBlt for OffscreenDC */ 2639fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grNoOffscreenMem= -29, /* No available offscreen memory */ 2649fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grInvalidPF = -30, /* Invalid pixel format for memory DC */ 2659fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 2669fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream grLastError = -31, /* Last error number in list */ 2679fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } MGL_errorType; 2689fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 2699fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_CLIPON true 2709fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_CLIPOFF false 2719fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 2729fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Color mapped modes */ 2739fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 2749fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef enum { 2759fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_CMAP_MODE, /* Normal Color mapped mode */ 2769fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_DITHER_RGB_MODE, /* 24 bit RGB halftone dithered */ 2779fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } MGL_colorModes; 2789fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 2799fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Standard colors - this is the standard set of colors for the IBM PC. The 2809fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * default palette will have been programmed to contain these values when a 2819fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * graphics modes is started. If the palette has been changed, they will 2829fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * not correspond to the actual colors on the screen. Under a Windowing 2839fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * manage environment these colors will also not be setup by default. 2849fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 2859fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 2869fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamenum MGL_COLORS { 2879fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_BLACK, /* dark colors */ 2889fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_BLUE, 2899fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_GREEN, 2909fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_CYAN, 2919fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_RED, 2929fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_MAGENTA, 2939fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_BROWN, 2949fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_LIGHTGRAY, 2959fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_DARKGRAY, /* light colors */ 2969fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_LIGHTBLUE, 2979fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_LIGHTGREEN, 2989fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_LIGHTCYAN, 2999fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_LIGHTRED, 3009fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_LIGHTMAGENTA, 3019fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_YELLOW, 3029fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_WHITE, 3039fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream }; 3049fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 3059fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Windows standard color indices for 256 color bitmaps. 8,9,246,247 are 3069fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * reserved and you should not count on these colors always being the 3079fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * same. For 16 color bitmaps, colors 248-255 map to colors 8-15. 3089fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 3099fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 3109fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamenum MGL_WIN_COLORS { 3119fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_WIN_BLACK = 0, 3129fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_WIN_DARKRED = 1, 3139fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_WIN_DARKGREEN = 2, 3149fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_WIN_DARKYELLOW = 3, 3159fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_WIN_DARKBLUE = 4, 3169fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_WIN_DARKMAGENTA = 5, 3179fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_WIN_DARKCYAN = 6, 3189fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_WIN_LIGHTGRAY = 7, 3199fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_WIN_TURQUOISE = 8, /* Reserved; dont count on this */ 3209fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_WIN_SKYBLUE = 9, /* Reserved; dont count on this */ 3219fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_WIN_CREAM = 246, /* Reserved; dont count on this */ 3229fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_WIN_MEDIUMGRAY = 247, /* Reserved; dont count on this */ 3239fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_WIN_DARKGRAY = 248, 3249fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_WIN_LIGHTRED = 249, 3259fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_WIN_LIGHTGREEN = 250, 3269fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_WIN_LIGHTYELLOW = 251, 3279fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_WIN_LIGHTBLUE = 252, 3289fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_WIN_LIGHTMAGENTA = 253, 3299fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_WIN_LIGHTCYAN = 254, 3309fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_WIN_WHITE = 255, 3319fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream }; 3329fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 3339fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef enum { 3349fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_MARKER_SQUARE, 3359fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_MARKER_CIRCLE, 3369fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_MARKER_X, 3379fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } MGL_markerStyleType; 3389fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 3399fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef enum { /* Write mode operators */ 3409fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_REPLACE_MODE, /* Replace mode */ 3419fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_AND_MODE, /* AND mode */ 3429fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_OR_MODE, /* OR mode */ 3439fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_XOR_MODE, /* XOR mode */ 3449fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } MGL_writeModeType; 3459fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 3469fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef enum { 3479fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_BITMAP_SOLID, 3489fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_BITMAP_OPAQUE, 3499fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_BITMAP_TRANSPARENT, 3509fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_PIXMAP, 3519fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } MGL_fillStyleType; 3529fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 3539fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef enum { 3549fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_LINE_PENSTYLE, /* Line drawn in current pen style */ 3559fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_LINE_STIPPLE, /* Line drawn with current stipple */ 3569fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } MGL_lineStyleType; 3579fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 3589fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef enum { 3599fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_CONVEX_POLYGON, /* Monotone vertical polygon */ 3609fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_COMPLEX_POLYGON, /* Non-Simple polygons */ 3619fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_AUTO_POLYGON, /* Auto detect the polygon type */ 3629fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } MGL_polygonType; 3639fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 3649fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Text manipulation defines */ 3659fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 3669fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef enum { 3679fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_LEFT_TEXT = 0, /* Justify from left */ 3689fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_TOP_TEXT = 0, /* Justify from top */ 3699fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_CENTER_TEXT = 1, /* Center the text */ 3709fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_RIGHT_TEXT = 2, /* Justify from right */ 3719fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_BOTTOM_TEXT = 2, /* Justify from bottom */ 3729fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_BASELINE_TEXT = 3, /* Justify from the baseline */ 3739fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } MGL_textJustType; 3749fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 3759fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef enum { 3769fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_LEFT_DIR = 0, /* Text goes to left */ 3779fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_UP_DIR = 1, /* Text goes up */ 3789fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_RIGHT_DIR = 2, /* Text goes right */ 3799fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_DOWN_DIR = 3, /* Text goes down */ 3809fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } MGL_textDirType; 3819fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 3829fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Font types */ 3839fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 3849fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef enum { 3859fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_VECTORFONT = 1, /* Vector font */ 3869fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_FIXEDFONT, /* Fixed width bitmap font */ 3879fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_PROPFONT, /* Proportional width bitmap font */ 3889fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } MGL_fontType; 3899fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 3909fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Palette rotation directions */ 3919fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 3929fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef enum { 3939fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_ROTATE_UP, /* Rotate the palette values up */ 3949fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_ROTATE_DOWN, /* Rotate the palette values down */ 3959fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } MGL_palRotateType; 3969fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 3979fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Border drawing routine styles */ 3989fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 3999fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef enum { 4009fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_BDR_INSET, /* Interior is inset into screen */ 4019fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_BDR_OUTSET, /* Interior is outset from screen */ 4029fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_BDR_OUTLINE, /* Border is 3d outline */ 4039fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } MGL_bdrStyleType; 4049fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 4059fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Standard display driver names */ 4069fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 4079fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_VGA4NAME "VGA4.DRV" /* Standard VGA drivers */ 4089fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_VGA8NAME "VGA8.DRV" 4099fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_VGAXNAME "VGAX.DRV" 4109fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 4119fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_SVGA4NAME "SVGA4.DRV" /* Generic SuperVGA drivers */ 4129fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_SVGA8NAME "SVGA8.DRV" 4139fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_SVGA16NAME "SVGA16.DRV" 4149fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_SVGA24NAME "SVGA24.DRV" 4159fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_SVGA32NAME "SVGA32.DRV" 4169fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 4179fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_LINEAR8NAME "LINEAR8.DRV" /* Linear framebuffer drivers */ 4189fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_LINEAR16NAME "LINEAR16.DRV" 4199fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_LINEAR24NAME "LINEAR24.DRV" 4209fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_LINEAR32NAME "LINEAR32.DRV" 4219fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 4229fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_ACCEL8NAME "ACCEL8.DRV" /* VBE/AF Accelerated drivers */ 4239fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_ACCEL16NAME "ACCEL16.DRV" 4249fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_ACCEL24NAME "ACCEL24.DRV" 4259fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_ACCEL32NAME "ACCEL32.DRV" 4269fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 4279fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_DDRAW8NAME "DDRAW8.DRV" /* DirectDraw drivers */ 4289fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_DDRAW16NAME "DDRAW16.DRV" 4299fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_DDRAW24NAME "DDRAW24.DRV" 4309fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_DDRAW32NAME "DDRAW32.DRV" 4319fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 4329fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Standard memory driver names */ 4339fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 4349fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_PACKED1NAME "PACK1.DRV" 4359fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_PACKED4NAME "PACK4.DRV" 4369fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_PACKED8NAME "PACK8.DRV" 4379fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_PACKED16NAME "PACK16.DRV" 4389fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_PACKED24NAME "PACK24.DRV" 4399fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_PACKED32NAME "PACK32.DRV" 4409fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 4419fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Standard bitmap names */ 4429fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 4439fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_EMPTY_FILL _MGL_getEmptyPat() 4449fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_GRAY_FILL _MGL_getGrayPat() 4459fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_SOLID_FILL _MGL_getSolidPat() 4469fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 4479fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Event message masks for keyDown events */ 4489fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 4499fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_ASCIIMASK 0x00FF /* Ascii code of key pressed */ 4509fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_SCANMASK 0xFF00 /* Scan code of key pressed */ 4519fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_COUNTMASK 0x7FFF0000L /* Count for KEYREPEAT's */ 4529fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 4539fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_asciiCode(m) ( (uchar) (m & EVT_ASCIIMASK) ) 4549fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_scanCode(m) ( (uchar) ( (m & EVT_SCANMASK) >> 8 ) ) 4559fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_repeatCount(m) ( (short) ( (m & EVT_COUNTMASK) >> 16 ) ) 4569fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 4579fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Event message masks for mouse events */ 4589fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 4599fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_LEFTBMASK 0x0001 /* Left button is bit 0 */ 4609fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_RIGHTBMASK 0x0004 /* Right button is bit 1 */ 4619fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_BOTHBMASK 0x0005 /* Both left and right together */ 4629fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_ALLBMASK 0x0005 /* All buttons pressed */ 4639fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 4649fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Modifier masks */ 4659fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 4669fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_LEFTBUT 0x0001 /* Set if left button was down */ 4679fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_RIGHTBUT 0x0002 /* Set if right button was down */ 4689fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_RIGHTSHIFT 0x0008 /* Set if right shift down */ 4699fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_LEFTSHIFT 0x0010 /* Set if left shift down */ 4709fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_CTRLSTATE 0x0020 /* Set if ctrl key down */ 4719fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_ALTSTATE 0x0040 /* Set if alt key down */ 4729fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_LEFTCTRL 0x0080 /* Set if left ctrl key down */ 4739fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_LEFTALT 0x0100 /* Set if left alt key down */ 4749fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_SHIFTKEY 0x0018 /* Any shift key */ 4759fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 4769fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Event codes */ 4779fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 4789fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_NULLEVT 0x0000 /* A null event */ 4799fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_KEYDOWN 0x0001 /* Key down event */ 4809fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_KEYREPEAT 0x0002 /* Key repeat event */ 4819fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_KEYUP 0x0004 /* Key up event */ 4829fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_MOUSEDOWN 0x0008 /* Mouse down event */ 4839fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_MOUSEUP 0x0010 /* Mouse up event */ 4849fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_MOUSEMOVE 0x0020 /* Mouse movement event */ 4859fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_TIMERTICK 0x0040 /* Timer tick event */ 4869fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_USEREVT 0x0080 /* First user event */ 4879fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 4889fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Event code masks */ 4899fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 4909fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_KEYEVT (EVT_KEYDOWN | EVT_KEYREPEAT | EVT_KEYUP) 4919fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_MOUSEEVT (EVT_MOUSEDOWN | EVT_MOUSEUP | EVT_MOUSEMOVE) 4929fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_MOUSECLICK (EVT_MOUSEDOWN | EVT_MOUSEUP) 4939fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define EVT_EVERYEVT 0xFFFF 4949fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 4959fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Suspend Application callback type codes. This callback is called 4969fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * when the user presses one of the corresponding keys indicating that 4979fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * they wish to change the active application. The MGL will catch these 4989fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * events and if you have registered a callback, will call the callback to 4999fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * save the state of the application so that it can be properly restored 5009fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * when the user switches back to your application. The MGL takes care of 5019fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * all the details about saving and restoring the state of the hardware, 5029fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * and all your application needs to do is save its own state so that you can 5039fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * re-draw the application screen upon re-activation. 5049fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * 5059fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * NOTE: Your application suspend callback may get called twice with the 5069fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * MGL_DEACTIVATE flag in order to test whether the switch should 5079fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * occur (under both DirectDraw and WinDirect fullscreen modes). 5089fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * 5099fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * NOTE: When your callback is called with the MGL_DEACTIVATE flag, you 5109fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * cannot assume that you have access to the display memory surfaces 5119fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * as they may have been lost by the time your callback has been called. 5129fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 5139fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 5149fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_DEACTIVATE 0x0001 /* Application losing active focus */ 5159fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_REACTIVATE 0x0002 /* Application regaining active focus */ 5169fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 5179fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Return codes from the suspend application callback. The normal value 5189fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * to be returned is MGL_SUSPEND_APP and this will cause the app to be 5199fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * suspended while back in GDI mode until the app is re-activated again 5209fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * by the user. 5219fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * 5229fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * MGL_NO_DEACTIVATE signals to WinDirect that the application does not want 5239fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * to allow switching to occur, and the switch request will be ignored and 5249fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * the app will remain in fullscreen mode. 5259fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * 5269fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * MGL_NO_SUSPEND_APP can be used to tell WinDirect to switch back to the 5279fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * desktop, but not to suspend the application. This must be used with 5289fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * care as the suspend application callback is then responsible for setting 5299fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * a flag in the application that will stop the application from doing any 5309fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * rendering to the framebuffer while the application is in GDI mode. This 5319fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * return value is useful for games that need to maintain network 5329fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * connectivity while the user has temporarily switched back to GDI mode. 5339fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 5349fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 5359fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_NO_DEACTIVATE 0 /* Dont allow app to be deactivated */ 5369fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_SUSPEND_APP 1 /* Suspend application until restored */ 5379fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_NO_SUSPEND_APP 2 /* Dont suspend, but allow switch */ 5389fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 5399fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Here we define the structures used to represent points and rectangles */ 5409fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 5419fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 5429fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int x,y; 5439fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } point_t; 5449fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 5459fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 5469fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int left; 5479fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int top; 5489fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int right; 5499fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int bottom; 5509fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } rect_t; 5519fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 5529fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* All colors are represented as longs by the library. This allows 5539fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * code to work correctly with up to 24 bit color device drivers. The 5549fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * device drivers themselves expect the color to be a color index if in 5559fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * a color mapped mode, or a 15/16/24 bit RGB tuple in a hicolor or truecolor 5569fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * mode. You can use the appropriate routines to pack and unpack 5579fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * colors into the color_t format. 5589fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 5599fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 5609fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef ulong color_t; 5619fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 5629fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Define the value used to clear the software ZBuffer. The MGL always uses 5639fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * a > operator for the z compare, and the smallest value is 0. 5649fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 5659fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 5669fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_ZCLEARVAL 0 5679fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 5689fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Structures for passing vertex information to polygon rendering routines. 5699fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * All fixed point coordinates are passed in 16.16 signed fixed point 5709fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * format, while zbuffer coordinates are passed in 4.28 signed fixed point 5719fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * format. The sign bit is used purely for overflow and arithmetic 5729fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * internally, and all user passed zbuffer values should be greater than 5739fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * 0. All shaded rendering routines either take a color index in 8.16 fixed 5749fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * point format (range 0-255.9) or separate RGB components in 8.16 fixed 5759fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * point format (range 0-255.9). 5769fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 5779fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 5789fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifdef __FX_FIXED_H 5799fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define fix32_t FXFixed 5809fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#else 5819fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef long fix32_t; 5829fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 5839fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef fix32_t fxcolor_t; 5849fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef long zfix32_t; 5859fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 5869fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 5879fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream fix32_t x,y; 5889fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } fxpoint_t; 5899fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 5909fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 5919fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream fxcolor_t r,g,b; 5929fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } fxrgb_t; 5939fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 5949fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 5959fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream fix32_t w,s,t; 5969fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } fxtex_t; 5979fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 5989fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 5999fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream fxcolor_t c; 6009fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream fxpoint_t p; 6019fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } fxpointc_t; 6029fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 6039fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 6049fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream fxrgb_t c; 6059fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream fxpoint_t p; 6069fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } fxpointrgb_t; 6079fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 6089fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 6099fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream fxpoint_t p; 6109fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream zfix32_t z; 6119fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } fxpointz_t; 6129fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 6139fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 6149fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream fxcolor_t c; 6159fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream fxpoint_t p; 6169fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream zfix32_t z; 6179fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } fxpointcz_t; 6189fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 6199fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 6209fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream fxrgb_t c; 6219fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream fxpoint_t p; 6229fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream zfix32_t z; 6239fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } fxpointrgbz_t; 6249fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 6259fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Macros to convert between integer and 32 bit fixed point format */ 6269fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 6279fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_FIX_1 0x10000L 6289fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_FIX_2 0x20000L 6299fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_FIX_HALF 0x08000L 6309fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_TOFIX(i) ((long)(i) << 16) 6319fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_FIXTOINT(f) ((m_int)((f) >> 16)) 6329fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_FIXROUND(f) ((m_int)(((f) + MGL_FIX_HALF) >> 16)) 6339fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 6349fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_ZFIX_1 0x10000000L 6359fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_ZFIX_HALF 0x08000000L 6369fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_FIXTOZ(i) ((i) << 12) 6379fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_ZTOFIX(i) ((i) >> 12) 6389fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_TOZFIX(i) ((long)(i) << 28) 6399fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_ZFIXTOINT(f) ((m_int)((f) >> 28)) 6409fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_ZFIXROUND(f) ((m_int)(((f) + MGL_ZFIX_HALF) >> 28)) 6419fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 6429fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Region structure */ 6439fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 6449fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifdef BUILD_MGL 6459fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamstruct _span_t; 6469fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct _span_t span_t; 6479fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#else 6489fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef void span_t; 6499fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 6509fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 6519fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 6529fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream rect_t rect; /* Bounding rectangle for region */ 6539fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream span_t *spans; /* Start of span list for region */ 6549fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } region_t; 6559fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 6569fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Palette entry structure */ 6579fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 6589fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 6599fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream uchar blue; /* Blue component of color */ 6609fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream uchar green; /* Green component of color */ 6619fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream uchar red; /* Blue component of color */ 6629fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream uchar alpha; /* Alpha or alignment byte */ 6639fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } palette_t; 6649fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 6659fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Maximum value for each palette entry component */ 6669fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 6679fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define PALMAX 255 /* Max value for palette components */ 6689fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 6699fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Pixel format structure */ 6709fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 6719fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 6729fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream uchar redMask,greenMask; /* Mask values for pixels */ 6739fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream uchar blueMask,rsvdMask; 6749fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int redPos,redAdjust; /* Red position and adjustment */ 6759fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int greenPos,greenAdjust; /* Green position and adjustment */ 6769fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int bluePos,blueAdjust; /* Blue position and adjustment */ 6779fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int rsvdPos,rsvdAdjust; /* Reserved position and adjustment */ 6789fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } pixel_format_t; 6799fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 6809fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Structure to hold arc coordinate information */ 6819fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 6829fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 6839fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int x,y; /* Centre point of the arc */ 6849fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int startX,startY; /* Starting point on arc */ 6859fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int endX,endY; /* Ending point on arc */ 6869fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } arc_coords_t; 6879fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 6889fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Mouse cursor structure */ 6899fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 6909fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 6919fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream ulong xorMask[32]; 6929fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream ulong andMask[32]; 6939fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int xHotSpot; 6949fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int yHotSpot; 6959fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } cursor_t; 6969fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 6979fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Bitmap structure - always packed pixel DIB format */ 6989fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 6999fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 7009fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int width; /* Width of bitmap in pixels */ 7019fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int height; /* Height of bitmap in pixels */ 7029fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int bitsPerPixel; /* Pixel width */ 7039fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int bytesPerLine; /* Bytes per line value for surface */ 7049fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream uchar *surface; /* Pointer to bitmap surface */ 7059fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream palette_t *pal; /* Palette (NULL if not loaded) */ 7069fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream pixel_format_t *pf; /* Pixel format (NULL if none) */ 7079fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 7089fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream /* ... palette, pixel format and bitmap data are store contiguously */ 7099fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } bitmap_t; 7109fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 7119fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Icon structure - can be 32x23, 64x64 or in fact any size */ 7129fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 7139fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 7149fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int byteWidth; /* Byte with for AND mask */ 7159fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream uchar *andMask; /* Hold punch mask for icon */ 7169fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream bitmap_t xorMask; /* XOR mask for the icon */ 7179fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 7189fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream /* ... AND mask and bitmap structure are stored contiguously */ 7199fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } icon_t; 7209fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 7219fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Default cursor name */ 7229fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 7239fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_DEF_CURSOR _MGL_getDefCursor() 7249fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 7259fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Generic Font structure */ 7269fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 7279fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define _MGL_FNAMESIZE 58 7289fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 7299fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 7309fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream char name[_MGL_FNAMESIZE];/* Name of the font */ 7319fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream short fontType; /* Type of font */ 7329fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream short maxWidth; /* Maximum character width */ 7339fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream short maxKern; /* Maximum character kern */ 7349fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream short fontWidth; /* Font width */ 7359fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream short fontHeight; /* Font height */ 7369fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream short ascent; /* Font ascent value */ 7379fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream short descent; /* Font descent value */ 7389fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream short leading; /* Font leading value */ 7399fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } font_t; 7409fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 7419fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Character and font metrics structure */ 7429fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 7439fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 7449fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int width; /* Width of character or font */ 7459fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int fontWidth; /* Character width (tightest fit) */ 7469fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int fontHeight; /* Height of the font */ 7479fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int ascent; /* Ascent value */ 7489fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int descent; /* Descent value */ 7499fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int leading; /* Leading value */ 7509fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int kern; /* Kern value */ 7519fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } metrics_t; 7529fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 7539fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Text settings structure */ 7549fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 7559fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 7569fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int horizJust; /* Horizontal justfication */ 7579fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int vertJust; /* Vertical justification */ 7589fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int dir; /* Text drawing direction */ 7599fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int szNumerx; /* Text x size numerator */ 7609fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int szNumery; /* Text y size numerator */ 7619fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int szDenomx; /* Text x size denominator */ 7629fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int szDenomy; /* Text y size denominator */ 7639fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int spaceExtra; /* Space extra term */ 7649fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream font_t *font; /* Currently selected font */ 7659fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } text_settings_t; 7669fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 7679fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Macros to access the (left,top) and (right,bottom) points of a 7689fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * rectangle. 7699fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 7709fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 7719fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_leftTop(r) (((point_t *) &(r))[0]) 7729fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_rightBottom(r) (((point_t *) &(r))[1]) 7739fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 7749fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef uchar pattern_t[8]; 7759fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef color_t pixpattern_t[8][8]; 7769fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 7779fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Attributes structure */ 7789fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 7799fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 7809fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream color_t color; /* Foreground color */ 7819fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream color_t backColor; /* Background color */ 7829fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int colorMode; /* Current color mode */ 7839fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int markerSize; /* Size of markers in pixels */ 7849fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int markerStyle; /* Style of markers */ 7859fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream color_t markerColor; /* Color to draw markers in */ 7869fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream color_t bdrBright; /* Border bright color */ 7879fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream color_t bdrDark; /* Border dark color */ 7889fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream point_t CP; /* Graphics pen position */ 7899fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int writeMode; /* Scan conversion write mode op. */ 7909fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int penStyle; /* Pen style */ 7919fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int penHeight; /* Height of pen */ 7929fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int penWidth; /* Width of pen */ 7939fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream pattern_t penPat; /* Pattern for pen */ 7949fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream pixpattern_t penPixPat; /* Pixmap pattern for pen */ 7959fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int lineStyle; /* Line style */ 7969fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream ushort lineStipple; /* Line stipple */ 7979fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_uint stippleCount; /* Current line stipple count */ 7989fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream rect_t viewPort; /* Viewport dimensions */ 7999fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream point_t viewPortOrg; /* Logical viewport origin */ 8009fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream rect_t clipRect; /* Clipping rectangle dimensions */ 8019fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int clip; /* Is clipping on? */ 8029fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int polyType; /* Polygon drawing type */ 8039fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream text_settings_t ts; /* Text drawing attributes */ 8049fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } attributes_t; 8059fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 8069fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Mode specific format information. This structrure can be used by 8079fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * the device driver to build tables of values for all supported modes 8089fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 8099fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 8109fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 8119fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int xRes; /* Device x resolution - 1 */ 8129fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int yRes; /* Device y resolution - 1 */ 8139fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int bitsPerPixel; /* Number of bits per pixel */ 8149fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int numberOfPlanes; /* Number of planes in image */ 8159fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream color_t maxColor; /* Maximum number of colors - 1 */ 8169fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int maxPage; /* Maximum number of video pages - 1 */ 8179fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int bytesPerLine; /* Number of bytes in a line */ 8189fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int aspectRatio; /* Mode aspect ratio (horiz/vert * 1000) */ 8199fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream long pageSize; /* Number of bytes in a page */ 8209fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int scratch1; /* Scratch pad value 1 */ 8219fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int scratch2; /* Scratch pad value 2 */ 8229fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream char redMaskSize; /* Size of direct color red mask */ 8239fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream char redFieldPosition; /* Bit posn of lsb of red mask */ 8249fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream char greenMaskSize; /* Size of direct color green mask */ 8259fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream char greenFieldPosition; /* Bit posn of lsb of green mask */ 8269fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream char blueMaskSize; /* Size of direct color blue mask */ 8279fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream char blueFieldPosition; /* Bit posn of lsb of blue mask */ 8289fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream char rsvdMaskSize; /* Size of reserved mask */ 8299fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream char rsvdFieldPosition; /* Bit posn of reserved mask */ 8309fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } gmode_t; 8319fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 8329fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Public Device Context Structure. The 'surface' member along with the 8339fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * gmode_t information block, provides direct access to the active 8349fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * display surface for user applications. The MGL virtualises the surface 8359fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * in SuperVGA modes that dont have a real linear framebuffer. 8369fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 8379fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 8389fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 8399fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream attributes_t a; /* Active device attributes */ 8409fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream void *surface; /* Pointer to active device surface */ 8419fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream void *zbuffer; /* Pointer to Z-buffer if allocated */ 8429fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int zbits; /* Bits per zbuffer element */ 8439fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int zwidth; /* Width of the zbuffer in pixels */ 8449fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream gmode_t mi; /* Mode specific information block */ 8459fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream pixel_format_t pf; /* Current pixel format for device context */ 8469fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream color_t *colorTab; /* Color lookup table cache */ 8479fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream color_t *shadeTab; /* Currently active shade table */ 8489fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int bankOffset; /* Offset of starting bank number */ 8499fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 8509fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream /* Remainder of Device Context structure is private and internal */ 8519fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } publicDevCtx_t; 8529fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 8539fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef BUILD_MGL 8549fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef publicDevCtx_t MGLDC; 8559fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#else 8569fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamstruct internalDevCtx_t; 8579fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct internalDevCtx_t MGLDC; 8589fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 8599fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 8609fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 8619fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream ulong which; /* Which window for window manager code */ 8629fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_uint what; /* Event code */ 8639fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream ulong when; /* Clock ticks since midnight */ 8649fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int where_x; /* Mouse location */ 8659fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int where_y; 8669fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream ulong message; /* Event specific message */ 8679fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream ulong modifiers; /* Modifier flags */ 8689fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int next; /* Next event in queue */ 8699fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream m_int prev; /* Previous event in queue */ 8709fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } event_t; 8719fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 8729fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Structure containing file I/O functions allowing the user application to 8739fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * completely replace the MGL's file I/O functions with their own. This 8749fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * allows the app to store all MGL related files in a single large file, 8759fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * with encryption or compression is desired. By default normal file I/O 8769fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * functions will be used. 8779fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 8789fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 8799fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef struct { 8809fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream FILE * (*fopen)(const char *filename,const char *mode); 8819fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream int (*fclose)(FILE *f); 8829fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream int (*fseek)(FILE *f,long offset,int whence); 8839fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream long (*ftell)(FILE *f); 8849fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream size_t (*fread)(void *ptr,size_t size,size_t n,FILE *f); 8859fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream size_t (*fwrite)(const void *ptr,size_t size,size_t n,FILE *f); 8869fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream } fileio_t; 8879fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 8889fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Define the flags for the types of direct surface access provided */ 8899fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 8909fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_NO_ACCESS 0x0 /* Surface cannot be accessed */ 8919fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_VIRTUAL_ACCESS 0x1 /* Surface is virtualised */ 8929fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_LINEAR_ACCESS 0x2 /* Surface can be linearly accessed */ 8939fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_SURFACE_FLAGS 0x3 8949fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 8959fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Define the flags for the types of direct zbuffer access provided */ 8969fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 8979fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_NO_ZACCESS 0x0 /* Zbuffer cannot be accessed */ 8989fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_VIRTUAL_ZACCESS 0x4 /* Zbuffer is virtualised in */ 8999fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_LINEAR_ZACCESS 0x8 /* Zbuffer can be linearly accessed */ 9009fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_ZBUFFER_FLAGS 0xC 9019fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 9029fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Define the flags for the types of hardware acceleration supported by 9039fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * the device context. This will allow the application to tailor the use of 9049fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * MGL functions depending upon whether specific hardware support is 9059fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * available. Hence applications can use specialised software rendering 9069fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * support if the desired hardware support is not available. 9079fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * 9089fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * NOTE: If the hardware flags are not MGL_HW_NONE, you *must* call 9099fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * the MGL_beginDirectAccess() and MGL_endDirectAccess() functions 9109fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * before and after any custom code that does direct framebuffer 9119fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * rendering!! 9129fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * 9139fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * This is not necessary for non-accelerated device context, so you 9149fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * might want to optimise these calls out if there is no hardware 9159fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * acceleration support. 9169fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 9179fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 9189fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_HW_NONE 0x0000 /* No hardware acceleration */ 9199fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_HW_LINE 0x0010 /* Hardware line drawing */ 9209fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_HW_STIPPLE_LINE 0x0020 /* Hardware stippled line drawing */ 9219fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_HW_POLY 0x0040 /* Hardware polygon filling */ 9229fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_HW_RECT 0x0080 /* Hardware rectangle fill */ 9239fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_HW_PATT_RECT 0x0100 /* Hardware pattern rectangle fill */ 9249fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_HW_CLRPATT_RECT 0x0200 /* Hardware color pattern fill */ 9259fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_HW_SCR_BLT 0x0400 /* Hardware screen/screen bitBlt */ 9269fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_HW_SRCTRANS_BLT 0x0800 /* Hardware source transparent blt */ 9279fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_HW_DSTTRANS_BLT 0x1000 /* Hardware dest. transparent blt */ 9289fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_HW_MONO_BLT 0x2000 /* Hardware monochrome blt */ 9299fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_HW_CLIP 0x4000 /* Hardware clipping */ 9309fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_HW_FLAGS 0xFFF0 9319fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 9329fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifdef __cplusplus 9339fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern "C" { /* Use "C" linkage when in C++ mode */ 9349fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 9359fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 9369fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/*------------------------- Function Prototypes ---------------------------*/ 9379fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 9389fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/*--------------------------------------------------------------------------- 9399fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * Routines bound to a specific device context. These routines all take 9409fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * an MGLDC as a parmeter for the context to work with and hence dont work 9419fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * with the current context. If however the context passed is the currently 9429fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * active context, all changes to that context are reflected in the 9439fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * currently active context as well. 9449fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream *-------------------------------------------------------------------------*/ 9459fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 9469fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Environment detection and initialisation */ 9479fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 9489fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_registerDriver(const char *name,void *driver); 9499fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_unregisterAllDrivers(void); 9509fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_registerAllDispDrivers(bool useLinear,bool useDirectDraw,bool useWinDirect); 9519fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_registerAllMemDrivers(void); 9529fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_detectGraph(m_int *driver,m_int *mode); 9539fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamuchar * MGLAPI MGL_availableModes(void); 9549fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_availablePages(m_int mode); 9559fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_modeResolution(m_int mode,m_int *xRes,m_int *yRes,m_int *bitsPerPixel); 9569fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_isDisplayDC(MGLDC *dc); 9579fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_isWindowedDC(MGLDC *dc); 9589fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_isMemoryDC(MGLDC *dc); 9599fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_exit(void); 9609fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setBufSize(unsigned size); 9619fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_fatalError(const char *msg); 9629fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_result(void); 9639fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setResult(m_int result); 9649fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamconst char * MGLAPI MGL_errorMsg(m_int err); 9659fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamconst char * MGLAPI MGL_modeName(m_int mode); 9669fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamconst char * MGLAPI MGL_modeDriverName(m_int mode); 9679fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamconst char * MGLAPI MGL_driverName(m_int driver); 9689fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_getDriver(MGLDC *dc); 9699fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_getMode(MGLDC *dc); 9709fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_surfaceAccessType(MGLDC *dc); 9719fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_zbufferAccessType(MGLDC *dc); 9729fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamlong MGLAPI MGL_getHardwareFlags(MGLDC *dc); 9739fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_defaultAttributes(MGLDC *dc); 9749fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_makeSubDC(MGLDC *dc,m_int left,m_int top,m_int right,m_int bottom); 9759fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 9769fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Viewport and clip rectangle manipulation bound to a specific DC */ 9779fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 9789fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setViewportDC(MGLDC *dc,rect_t view); 9799fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setRelViewportDC(MGLDC *dc,rect_t view); 9809fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getViewportDC(MGLDC *dc,rect_t *view); 9819fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setViewportOrgDC(MGLDC *dc,point_t org); 9829fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getViewportOrgDC(MGLDC *dc,point_t *org); 9839fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_globalToLocalDC(MGLDC *dc,point_t *p); 9849fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_localToGlobalDC(MGLDC *dc,point_t *p); 9859fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_maxxDC(MGLDC *dc); 9869fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_maxyDC(MGLDC *dc); 9879fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setClipRectDC(MGLDC *dc,rect_t clip); 9889fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getClipRectDC(MGLDC *dc,rect_t *clip); 9899fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setClipModeDC(MGLDC *dc,bool mode); 9909fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_getClipModeDC(MGLDC *dc); 9919fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 9929fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Color and palette manipulation */ 9939fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 9949fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamcolor_t MGLAPI MGL_realColor(MGLDC *dc,m_int color); 9959fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamcolor_t MGLAPI MGL_rgbColor(MGLDC *dc,uchar R,uchar G,uchar B); 9969fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setPaletteEntry(MGLDC *dc,m_int entry,uchar red,uchar green,uchar blue); 9979fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getPaletteEntry(MGLDC *dc,m_int entry,uchar *red,uchar *green,uchar *blue); 9989fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setPalette(MGLDC *dc,palette_t *pal,m_int numColors,m_int startIndex); 9999fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getPalette(MGLDC *dc,palette_t *pal,m_int numColors,m_int startIndex); 10009fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_rotatePalette(MGLDC *dc,m_int numColors,m_int startIndex,m_int direction); 10019fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool ASMAPI MGL_fadePalette(MGLDC *dc,palette_t *fullIntensity,m_int numColors,m_int startIndex,uchar intensity); 10029fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_realizePalette(MGLDC *dc,m_int numColors,m_int startIndex,m_int waitVRT); 10039fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_getPaletteSize(MGLDC *dc); 10049fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getDefaultPalette(MGLDC *dc,palette_t *pal); 10059fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setDefaultPalette(MGLDC *dc); 10069fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 10079fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_checkIdentityPalette(bool enable); 10089fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_mapToPalette(MGLDC *dc,palette_t *pal); 10099fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 10109fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 10119fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Generic device context information and manipulation */ 10129fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 10139fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_haveWidePalette(MGLDC *dc); 10149fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_getBitsPerPixel(MGLDC *dc); 10159fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamcolor_t MGLAPI MGL_maxColor(MGLDC *dc); 10169fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_maxPage(MGLDC *dc); 10179fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_sizex(MGLDC *dc); 10189fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_sizey(MGLDC *dc); 10199fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getPixelFormat(MGLDC *dc,pixel_format_t *pf); 10209fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI MGL_computePixelAddr(MGLDC *dc,int x,int y); 10219fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 10229fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Double buffering support */ 10239fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 10249fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setActivePage(MGLDC *dc,m_int page); 10259fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_getActivePage(MGLDC *dc); 10269fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setVisualPage(MGLDC *dc,m_int page,m_int waitVRT); 10279fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_getVisualPage(MGLDC *dc); 10289fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setDisplayStart(MGLDC *dc,m_int x,m_int y,m_int waitFlag); 10299fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getDisplayStart(MGLDC *dc,m_int *x,m_int *y); 10309fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_vSync(MGLDC *dc); 10319fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_doubleBuffer(MGLDC *dc); 10329fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_singleBuffer(MGLDC *dc); 10339fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_swapBuffers(MGLDC *dc,m_int waitVRT); 10349fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 10359fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Zbuffering support */ 10369fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 10379fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifdef MGL_3D 10389fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_getHardwareZBufferDepth(MGLDC *dc); 10399fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool ASMAPI MGL_zBegin(MGLDC *dc,m_int zbits); 10409fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_zShareZBuffer(MGLDC *dc,MGLDC *dcShared,m_int zbits); 10419fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 10429fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 10439fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Event handling support */ 10449fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 10459fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI EVT_getNext(event_t *evt,m_uint mask); 10469fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI EVT_peekNext(event_t *evt,m_uint mask); 10479fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI EVT_post(ulong which,m_uint what,ulong message,ulong modifiers); 10489fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI EVT_flush(m_uint mask); 10499fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI EVT_halt(event_t *evt,m_uint mask); 10509fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI EVT_setTimerTick(m_int ticks); 10519fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 10529fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/*--------------------------------------------------------------------------- 10539fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * Routines bound to the currently active context. All these routines work 10549fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * with the currently active context and do not reflect any changes made 10559fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * to the global context to the original user supplied context (because it 10569fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * may be cached). The cached DC is automatically flushed back to the 10579fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * original DC when a new context is enabled with MGL_makeCurrentDC(). 10589fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * 10599fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * Before destroying a DC that is current, make sure you call 10609fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * MGL_makeCurrentDC(NULL) first! 10619fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream *-------------------------------------------------------------------------*/ 10629fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 10639fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Routines to change the active global device context */ 10649fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 10659fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamMGLDC * MGLAPI MGL_makeCurrentDC(MGLDC *dc); 10669fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_isCurrentDC(MGLDC *dc); 10679fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 10689fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Current device context information and manipulation */ 10699fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 10709fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_getAspectRatio(void); 10719fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setAspectRatio(m_int aspectRatio); 10729fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_setColor(color_t color); 10739fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setColorRGB(uchar R,uchar G,uchar B); 10749fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setColorCI(m_int index); 10759fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamcolor_t MGLAPI MGL_getColor(void); 10769fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_setBackColor(color_t color); 10779fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamcolor_t MGLAPI MGL_getBackColor(void); 10789fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamcolor_t ASMAPI MGL_packColor(pixel_format_t *pf,uchar R,uchar G,uchar B); 10799fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_unpackColor(pixel_format_t *pf,color_t color,uchar *R,uchar *G,uchar *B); 10809fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamcolor_t ASMAPI MGL_packColorRGB(uchar R,uchar G,uchar B); 10819fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_unpackColorRGB(color_t color,uchar *R,uchar *G,uchar *B); 10829fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamcolor_t MGLAPI MGL_defaultColor(void); 10839fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 10849fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setMarkerSize(m_int size); 10859fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_getMarkerSize(void); 10869fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setMarkerStyle(m_int style); 10879fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_getMarkerStyle(void); 10889fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setMarkerColor(color_t color); 10899fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamcolor_t MGLAPI MGL_getMarkerColor(void); 10909fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setBorderColors(color_t bright,color_t dark); 10919fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getBorderColors(color_t *bright,color_t *dark); 10929fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_setWriteMode(m_int mode); 10939fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_getWriteMode(void); 10949fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_setPenStyle(m_int style); 10959fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_getPenStyle(void); 10969fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setLineStyle(m_int style); 10979fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_getLineStyle(void); 10989fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_setLineStipple(ushort stipple); 10999fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamushort MGLAPI MGL_getLineStipple(void); 11009fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_setLineStippleCount(m_uint stippleCount); 11019fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_uint MGLAPI MGL_getLineStippleCount(void); 11029fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_setPenBitmapPattern(const pattern_t *pat); 11039fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getPenBitmapPattern(pattern_t *pat); 11049fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_setPenPixmapPattern(const pixpattern_t *pat); 11059fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getPenPixmapPattern(pixpattern_t *pat); 11069fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setPenSize(m_int height,m_int width); 11079fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getPenSize(m_int *height,m_int *width); 11089fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 11099fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setColorMapMode(m_int mode); 11109fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_getColorMapMode(void); 11119fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 11129fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setPolygonType(m_int type); 11139fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_getPolygonType(void); 11149fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 11159fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getAttributes(attributes_t *attr); 11169fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_restoreAttributes(attributes_t *attr); 11179fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 11189fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Device clearing */ 11199fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 11209fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_clearDevice(void); 11219fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_clearViewport(void); 11229fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 11239fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Viewport and clip rectangle manipulation */ 11249fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 11259fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setViewport(rect_t view); 11269fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setRelViewport(rect_t view); 11279fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getViewport(rect_t *view); 11289fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setViewportOrg(point_t org); 11299fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getViewportOrg(point_t *org); 11309fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_globalToLocal(point_t *p); 11319fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_localToGlobal(point_t *p); 11329fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_maxx(void); 11339fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_maxy(void); 11349fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setClipRect(rect_t clip); 11359fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getClipRect(rect_t *clip); 11369fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setClipMode(bool mode); 11379fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_getClipMode(void); 11389fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 11399fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Pixel plotting */ 11409fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 11419fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_pixelCoord(m_int x,m_int y); 11429fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamcolor_t MGLAPI MGL_getPixelCoord(m_int x,m_int y); 11439fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_beginPixel(void); 11449fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_pixelCoordFast(m_int x,m_int y); 11459fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamcolor_t MGLAPI MGL_getPixelCoordFast(m_int x,m_int y); 11469fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_endPixel(void); 11479fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 11489fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Line drawing and clipping */ 11499fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 11509fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_moveToCoord(m_int x,m_int y); 11519fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_moveRelCoord(m_int dx,m_int dy); 11529fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_lineToCoord(m_int x,m_int y); 11539fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_lineRelCoord(m_int dx,m_int dy); 11549fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_getX(void); 11559fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_getY(void); 11569fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getCP(point_t* CP); 11579fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_lineCoord(m_int x1,m_int y1,m_int x2,m_int y2); 11589fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_lineCoordFX(fix32_t x1,fix32_t y1,fix32_t x2,fix32_t y2); 11599fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_lineCoordFast(m_int x1,m_int y1,m_int x2,m_int y2); 11609fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_lineCoordFastFX(fix32_t x1,fix32_t y1,fix32_t x2,fix32_t y2); 11619fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_lineEngine(fix32_t x1,fix32_t y1,fix32_t x2,fix32_t y2,void (ASMAPI *plotPoint)(m_int x,m_int y)); 11629fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_clipLineFX(fix32_t *x1,fix32_t *y1,fix32_t *x2,fix32_t *y2,fix32_t left,fix32_t top,fix32_t right,fix32_t bottom); 11639fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 11649fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_scanLine(m_int y,m_int x1,m_int x2); 11659fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 11669fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 11679fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Routines to perform bank switching for banked framebuffers for custom 11689fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * rendering code. The first version is callable only from assembler and 11699fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * requires the new bank value to be passed in the DL register. The second 11709fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * version is callable directly from C. DO NOT CALL THESE FUNCTIONS WHEN 11719fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * RUNNING WITH A LINEAR FRAMEBUFFER!!! 11729fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 11739fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 11749fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid _ASMAPI SVGA_setBank(void); 11759fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid _ASMAPI SVGA_setBankC(int bank); 11769fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 11779fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Routines to begin/end direct framebuffer access. You must call these 11789fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * functions is you wish to render directly to a hardware accelerated 11799fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * device surface. 11809fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 11819fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 11829fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_beginDirectAccess(void); 11839fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_endDirectAccess(void); 11849fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 11859fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Routines to begin/end fast rendering of flat shaded lines, scanlines 11869fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * and polygons. 11879fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 11889fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 11899fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_beginDrawing(void); 11909fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_endDrawing(void); 11919fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 11929fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Routines to begin/end fast rendering of smooth shaded lines, scanlines 11939fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * and polygons. 11949fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 11959fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 11969fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifdef MGL_3D 11979fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_beginShadedDrawing(void); 11989fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_endShadedDrawing(void); 11999fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 12009fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 12019fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Routines to begin/end fast rendering of flat shaded, zbuffered lines and 12029fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * polygons. 12039fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 12049fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 12059fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifdef MGL_3D 12069fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_beginZDrawing(void); 12079fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_endZDrawing(void); 12089fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 12099fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 12109fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Routines to begin/end fast rendering of smooth shaded, zbuffered lines and 12119fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * polygons. 12129fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 12139fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 12149fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifdef MGL_3D 12159fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_beginZShadedDrawing(void); 12169fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_endZShadedDrawing(void); 12179fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 12189fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 12199fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Polygon drawing: Note that the following fast polygon routines 12209fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * only work with convex polygons. The integer coordinate versions are 12219fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * provided for compatibility only, and convert the coordinates to fixed 12229fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * point and call the appropriate fixed point routines below. 12239fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 12249fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 12259fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 12269fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_fillPolygon(m_int count,point_t *vArray,m_int xOffset,m_int yOffset); 12279fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_fillPolygonFast(m_int count,point_t *vArray,m_int xOffset,m_int yOffset); 12289fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_fillPolygonFX(m_int count,fxpoint_t *vArray,m_int vinc,fix32_t xOffset,fix32_t yOffset); 12299fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_fillPolygonFastFX(m_int count,fxpoint_t *vArray,m_int vinc,fix32_t xOffset,fix32_t yOffset); 12309fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 12319fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 12329fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* 3D rasterization routines */ 12339fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 12349fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifdef MGL_3D 12359fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_zClearCoord(m_int left,m_int top,m_int right,m_int bottom,zfix32_t clearVal); 12369fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 12379fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 12389fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifdef MGL_FIX3D 12399fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_cLineCoordFast(fix32_t x1,fix32_t y1,fix32_t c1,fix32_t x2,fix32_t y2,fix32_t c2); 12409fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_rgbLineCoordFast(fix32_t x1,fix32_t y1,fix32_t r1,fix32_t g1,fix32_t b1,fix32_t x2,fix32_t y2,fix32_t r2,fix32_t g2,fix32_t b2); 12419fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_zLineCoordFast(fix32_t x1,fix32_t y1,zfix32_t z1,fix32_t x2,fix32_t y2,zfix32_t z2); 12429fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_czLineCoordFast(fix32_t x1,fix32_t y1,zfix32_t z1,fix32_t c1,fix32_t x2,fix32_t y2,zfix32_t z2,fix32_t c2); 12439fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_rgbzLineCoordFast(fix32_t x1,fix32_t y1,zfix32_t z1,fix32_t r1,fix32_t g1,fix32_t b1,fix32_t x2,fix32_t y2,zfix32_t z2,fix32_t r2,fix32_t g2,fix32_t b2); 12449fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 12459fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_triFast(fxpoint_t *v1,fxpoint_t *v2,fxpoint_t *v3,fix32_t xOffset,fix32_t yOffset); 12469fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_cTriFast(fxpointc_t *v1,fxpointc_t *v2,fxpointc_t *v3,fix32_t xOffset,fix32_t yOffset); 12479fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_rgbTriFast(fxpointrgb_t *v1,fxpointrgb_t *v2,fxpointrgb_t *v3,fix32_t xOffset,fix32_t yOffset); 12489fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_zTriFast(fxpointz_t *v1,fxpointz_t *v2,fxpointz_t *v3,fix32_t xOffset,fix32_t yOffset,zfix32_t zOffset); 12499fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_czTriFast(fxpointcz_t *v1,fxpointcz_t *v2,fxpointcz_t *v3,fix32_t xOffset,fix32_t yOffset,zfix32_t zOffset); 12509fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_rgbzTriFast(fxpointrgbz_t *v1,fxpointrgbz_t *v2,fxpointrgbz_t *v3,fix32_t xOffset,fix32_t yOffset,zfix32_t zOffset); 12519fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 12529fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_quadFast(fxpoint_t *v1,fxpoint_t *v2,fxpoint_t *v3,fxpoint_t *v4,fix32_t xOffset,fix32_t yOffset); 12539fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_cQuadFast(fxpointc_t *v1,fxpointc_t *v2,fxpointc_t *v3,fxpointc_t *v4,fix32_t xOffset,fix32_t yOffset); 12549fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_rgbQuadFast(fxpointrgb_t *v1,fxpointrgb_t *v2,fxpointrgb_t *v3,fxpointrgb_t *v4,fix32_t xOffset,fix32_t yOffset); 12559fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_zQuadFast(fxpointz_t *v1,fxpointz_t *v2,fxpointz_t *v3,fxpointz_t *v4,fix32_t xOffset,fix32_t yOffset,zfix32_t zOffset); 12569fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_czQuadFast(fxpointcz_t *v1,fxpointcz_t *v2,fxpointcz_t *v3,fxpointcz_t *v4,fix32_t xOffset,fix32_t yOffset,zfix32_t zOffset); 12579fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_rgbzQuadFast(fxpointrgbz_t *v1,fxpointrgbz_t *v2,fxpointrgbz_t *v3,fxpointrgbz_t *v4,fix32_t xOffset,fix32_t yOffset,zfix32_t zOffset); 12589fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 12599fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 12609fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Routine to set the currently active shade table. In HiColor and TrueColor 12619fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * video modes, you must set a valid shadeTable before you call any of the 12629fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * color index shaded rendering routines (MGL_cTri() etc). These routines 12639fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * will interpolate an index into the current shade table rather than 12649fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * each of the RGB color channels, and the appropriate full RGB color is 12659fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * extracted directly from the shade table. The shade table can be any size, 12669fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * but the application must ensure that the indices passed in are within 12679fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * the range of the current shade table. 12689fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 12699fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 12709fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifdef MGL_3D 12719fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setShadeTable(color_t *shadeTab); 12729fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 12739fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 12749fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Polyline drawing */ 12759fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 12769fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 12779fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_marker(point_t p); 12789fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_polyPoint(m_int count,point_t *vArray); 12799fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_polyMarker(m_int count,point_t *vArray); 12809fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_polyLine(m_int count,point_t *vArray); 12819fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 12829fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 12839fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Rectangle drawing */ 12849fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 12859fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 12869fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_rectCoord(m_int left,m_int top,m_int right,m_int bottom); 12879fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_fillRectCoord(m_int left,m_int top,m_int right,m_int bottom); 12889fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 12899fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 12909fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Scanline color scanning. Thee routines are primitive, and do not perform 12919fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * any clipping or viewport mapping, so can be used to build you own 12929fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * high performance floodfilling routines (see the example file ffill.c 12939fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * for pre-built high speed floodfill routines). 12949fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 12959fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 12969fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 12979fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int ASMAPI MGL_scanRightForColor(m_int x,m_int y,color_t color); 12989fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int ASMAPI MGL_scanLeftForColor(m_int x,m_int y,color_t color); 12999fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int ASMAPI MGL_scanRightWhileColor(m_int x,m_int y,color_t color); 13009fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int ASMAPI MGL_scanLeftWhileColor(m_int x,m_int y,color_t color); 13019fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 13029fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 13039fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Psuedo 3D border drawing */ 13049fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 13059fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 13069fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_drawBorderCoord(m_int left,m_int top,m_int right,m_int bottom,m_int style,m_int thickness); 13079fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_drawHDivider(m_int y,m_int x1,m_int x2); 13089fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_drawVDivider(m_int x,m_int y1,m_int y2); 13099fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 13109fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 13119fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Ellipse drawing */ 13129fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 13139fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 13149fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_ellipseArc(rect_t extentRect,m_int startAngle,m_int endAngle); 13159fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_ellipseArcCoord(m_int x,m_int y,m_int xradius,m_int yradius,m_int startAngle,m_int endAngle); 13169fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_getArcCoords(arc_coords_t *coords); 13179fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_ellipse(rect_t extentRect); 13189fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_ellipseCoord(m_int x,m_int y,m_int xradius,m_int yradius); 13199fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_fillEllipseArc(rect_t extentRect,m_int startAngle,m_int endAngle); 13209fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_fillEllipseArcCoord(m_int x,m_int y,m_int xradius,m_int yradius,m_int startAngle,m_int endAngle); 13219fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_fillEllipse(rect_t extentRect); 13229fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_fillEllipseCoord(m_int x,m_int y,m_int xradius,m_int yradius); 13239fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_ellipseEngine(rect_t extentRect,void (ASMAPI *setup)(m_int topY,m_int botY,m_int left,m_int right),void (ASMAPI *set4pixels)(bool inc_x,bool inc_y,bool region1),void (ASMAPI *finished)(void)); 13249fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_ellipseArcEngine(rect_t extentRect,m_int startAngle,m_int endAngle,arc_coords_t *ac,void (ASMAPI *plotPoint)(m_int x,m_int y)); 13259fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 13269fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 13279fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Text attribute manipulation */ 13289fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 13299fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 13309fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setTextJustify(m_int horiz,m_int vert); 13319fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getTextJustify(m_int *horiz,m_int *vert); 13329fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setTextDirection(m_int direction); 13339fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_getTextDirection(void); 13349fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setTextSize(m_int numerx,m_int denomx,m_int numery,m_int denomy); 13359fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getTextSize(m_int *numerx,m_int *denomx,m_int *numery,m_int *denomy); 13369fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setSpaceExtra(m_int extra); 13379fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_getSpaceExtra(void); 13389fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setTextSettings(text_settings_t *settings); 13399fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getTextSettings(text_settings_t *settings); 13409fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_textHeight(void); 13419fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_textWidth(const char *str); 13429fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_textBounds(m_int x,m_int y,const char *str,rect_t *bounds); 13439fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_charWidth(char ch); 13449fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getFontMetrics(metrics_t *metrics); 13459fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getCharMetrics(char ch,metrics_t *metrics); 13469fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_maxCharWidth(void); 13479fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_underScoreLocation(m_int *x,m_int *y,const char *str); 13489fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 13499fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 13509fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Text drawing */ 13519fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 13529fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 13539fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_drawStr(const char *str); 13549fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_drawStrXY(m_int x,m_int y,const char *str); 13559fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_useFont(font_t *font); 13569fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamfont_t * MGLAPI MGL_getFont(void); 13579fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_vecFontEngine(m_int x,m_int y,const char *str,void (ASMAPI *move)(m_int x,m_int y),void (ASMAPI *draw)(m_int x,m_int y)); 13589fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 13599fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 13609fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* BitBlt support */ 13619fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 13629fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_bitBltCoord(MGLDC *dst,MGLDC *src,m_int left,m_int top,m_int right,m_int bottom,m_int dstLeft,m_int dstTop,m_int op); 13639fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_stretchBltCoord(MGLDC *dst,MGLDC *src,m_int left,m_int top,m_int right,m_int bottom,m_int dstLeft,m_int dstTop,m_int dstRight,m_int dstBottom); 13649fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 13659fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getDivotCoord(MGLDC *dc,m_int left,m_int top,m_int right,m_int bottom,void *divot); 13669fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_putDivot(MGLDC *dc,void *divot); 13679fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamlong MGLAPI MGL_divotSizeCoord(MGLDC *dc,m_int left,m_int top,m_int right,m_int bottom); 13689fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_putMonoImage(MGLDC *dc,m_int x,m_int y,m_int byteWidth,m_int height,void *image); 13699fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_putBitmap(MGLDC *dc,m_int x,m_int y,const bitmap_t *bitmap,m_int op); 13709fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_putBitmapSection(MGLDC *dc,m_int left,m_int top,m_int right,m_int bottom,m_int dstLeft,m_int dstTop,const bitmap_t *bitmap,m_int op); 13719fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_putBitmapTransparent(MGLDC *dc,m_int x,m_int y,const bitmap_t *bitmap,color_t transparent,bool sourceTrans); 13729fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_putBitmapTransparentSection(MGLDC *dc,m_int left,m_int top,m_int right,m_int bottom,m_int dstLeft,m_int dstTop,const bitmap_t *bitmap,color_t transparent,bool sourceTrans); 13739fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_putBitmapMask(MGLDC *dc,m_int x,m_int y,const bitmap_t *mask,color_t color); 13749fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_stretchBitmap(MGLDC *dc,m_int left,m_int top,m_int right,m_int bottom,const bitmap_t *bitmap); 13759fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_putIcon(MGLDC *dc,m_int x,m_int y,const icon_t *icon); 13769fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_transBltCoord(MGLDC *dst,MGLDC *src,m_int left,m_int top,m_int right,m_int bottom,m_int dstLeft,m_int dstTop,color_t transparent,bool sourceTrans); 13779fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 13789fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 13799fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Linear offscreen DC BitBlt support */ 13809fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 13819fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 13829fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_bitBltLinCoord(MGLDC *dst,MGLDC *src,ulong srcOfs,m_int dstLeft,m_int dstTop,m_int dstRight,m_int dstBottom,m_int op); 13839fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_transBltLinCoord(MGLDC *dst,MGLDC *src,ulong srcOfs,m_int dstLeft,m_int dstTop,m_int dstRight,m_int dstBottom,color_t transparent,bool sourceTrans); 13849fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 13859fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 13869fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Monochrome bitmap manipulation */ 13879fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 13889fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 13899fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_drawGlyph(font_t *g,m_int x,m_int y,uchar glyph); 13909fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_getGlyphWidth(font_t *font,uchar glyph); 13919fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGLAPI MGL_getGlyphHeight(font_t *font); 13929fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_rotateGlyph(uchar *dst,uchar *src,m_int *byteWidth,m_int *height,m_int rotation); 13939fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_mirrorGlyph(uchar *dst,uchar *src,m_int byteWidth,m_int height); 13949fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 13959fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 13969fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Region management */ 13979fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 13989fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 13999fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamregion_t * MGLAPI MGL_newRegion(void); 14009fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamregion_t * MGLAPI MGL_copyRegion(const region_t *s); 14019fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_clearRegion(region_t *r); 14029fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_freeRegion(region_t *r); 14039fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_drawRegion(m_int x,m_int y,const region_t *r); 14049fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 14059fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 14069fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Region generation primitives */ 14079fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 14089fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 14099fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamregion_t * MGLAPI MGL_rgnLineCoord(m_int x1,m_int y1,m_int x2,m_int y2,const region_t *pen); 14109fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamregion_t * MGLAPI MGL_rgnLineCoordFX(fix32_t x1,fix32_t y1,fix32_t x2,fix32_t y2,const region_t *pen); 14119fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/*region_t * MGLAPI MGL_rgnPolygon(m_int count,point_t *vArray);*/ 14129fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/*region_t * MGLAPI MGL_rgnPolygonFast(m_int count,point_t *vArray);*/ 14139fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamregion_t * MGLAPI MGL_rgnSolidRectCoord(m_int left,m_int top,m_int right,m_int bottom); 14149fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamregion_t * MGLAPI MGL_rgnEllipse(rect_t extentRect,const region_t *pen); 14159fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamregion_t * MGLAPI MGL_rgnEllipseArc(rect_t extentRect,m_int startAngle,m_int endAngle,const region_t *pen); 14169fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_rgnGetArcCoords(arc_coords_t *coords); 14179fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamregion_t * MGLAPI MGL_rgnSolidEllipse(rect_t extentRect); 14189fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamregion_t * MGLAPI MGL_rgnSolidEllipseArc(rect_t extentRect,m_int startAngle,m_int endAngle); 14199fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 14209fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 14219fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Region alegbra */ 14229fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 14239fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 14249fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamregion_t * MGLAPI MGL_sectRegion(const region_t *r1,const region_t *r2); 14259fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamregion_t * MGLAPI MGL_sectRegionRect(const region_t *r1,const rect_t *r2); 14269fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_unionRegion(region_t *r1,const region_t *r2); 14279fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_unionRegionRect(region_t *r1,const rect_t *r2); 14289fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_unionRegionOfs(region_t *r1,const region_t *r2,m_int xOffset,m_int yOffset); 14299fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_diffRegion(region_t *r1,const region_t *r2); 14309fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_diffRegionRect(region_t *r1,const rect_t *r2); 14319fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_optimizeRegion(region_t *r); 14329fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_offsetRegion(region_t *r,m_int dx,m_int dy); 14339fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_emptyRegion(const region_t *r); 14349fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_equalRegion(const region_t *r1,const region_t *r2); 14359fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_ptInRegionCoord(m_int x,m_int y,const region_t *r); 14369fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 14379fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 14389fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Region traversal */ 14399fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 14409fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 14419fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef void (ASMAPI *rgncallback_t)(const rect_t *r); 14429fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 14439fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_traverseRegion(region_t *rgn,rgncallback_t doRect); 14449fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 14459fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 14469fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* RGB to 8 bit halftone dithering routines */ 14479fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 14489fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 14499fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_getHalfTonePalette(palette_t *pal); 14509fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamuchar MGLAPI MGL_halfTonePixel(m_int x,m_int y,uchar R,uchar G,uchar B); 14519fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 14529fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 14539fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Resource loading/unloading */ 14549fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 14559fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamfont_t * MGLAPI MGL_loadFont(const char *fontname); 14569fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_availableFont(const char *fontname); 14579fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_unloadFont(font_t *font); 14589fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamcursor_t * MGLAPI MGL_loadCursor(const char *cursorName); 14599fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_availableCursor(const char *cursorName); 14609fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_unloadCursor(cursor_t *cursor); 14619fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 14629fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamicon_t * MGLAPI MGL_loadIcon(const char *iconName,bool loadPalette); 14639fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_availableIcon(const char *iconName); 14649fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_unloadIcon(icon_t *icon); 14659fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 14669fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 14679fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Windows BMP bitmap loading/unloading/saving */ 14689fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 14699fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 14709fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambitmap_t * MGLAPI MGL_loadBitmap(const char *bitmapName,bool loadPalette); 14719fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_availableBitmap(const char *bitmapName); 14729fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_unloadBitmap(bitmap_t *bitmap); 14739fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_getBitmapSize(const char *bitmapName,m_int *width,m_int *height,m_int *bitsPerPixel,pixel_format_t *pf); 14749fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_loadBitmapIntoDC(MGLDC *dc,const char *bitmapName,m_int dstLeft,m_int dstTop,bool loadPalette); 14759fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_saveBitmapFromDC(MGLDC *dc,const char *bitmapName,m_int left,m_int top,m_int right,m_int bottom); 14769fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambitmap_t * MGLAPI MGL_getBitmapFromDC(MGLDC *dc,m_int left,m_int top,m_int right,m_int bottom,bool savePalette); 14779fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambitmap_t * MGLAPI MGL_buildMonoMask(bitmap_t *bitmap,color_t transparent); 14789fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 14799fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 14809fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* PCX bitmap loading/unloading/saving (1/4/8 bpp only) */ 14819fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 14829fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 14839fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambitmap_t * MGLAPI MGL_loadPCX(const char *bitmapName,bool loadPalette); 14849fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_availablePCX(const char *bitmapName); 14859fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_getPCXSize(const char *bitmapName,m_int *width,m_int *height,m_int *bitsPerPixel); 14869fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_loadPCXIntoDC(MGLDC *dc,const char *bitmapName,m_int dstLeft,m_int dstTop,bool loadPalette); 14879fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_savePCXFromDC(MGLDC *dc,const char *bitmapName,m_int left,m_int top,m_int right,m_int bottom); 14889fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 14899fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 14909fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Random number generation routines for shorts and longs with full range */ 14919fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 14929fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_srand(m_uint seed); 14939fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamushort ASMAPI MGL_random(ushort max); 14949fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamulong ASMAPI MGL_randoml(ulong max); 14959fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 14969fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Mouse support */ 14979fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 14989fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MS_available(void); 14999fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MS_show(void); 15009fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MS_hide(void); 15019fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MS_obscure(void); 15029fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MS_setCursor(cursor_t *curs); 15039fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MS_setCursorColor(color_t color); 15049fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MS_moveTo(m_int x,m_int y); 15059fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MS_getPos(m_int *x,m_int *y); 15069fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MS_drawCursor(void); 15079fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 15089fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Rectangle and Point manipulation */ 15099fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 15109fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamrect_t MGLAPI MGL_defRect(m_int left,m_int top,m_int right,m_int bottom); 15119fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamrect_t MGLAPI MGL_defRectPt(point_t leftTop,point_t rightBottom); 15129fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_sectRect(rect_t s1,rect_t s2,rect_t *d); 15139fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI MGL_sectRectCoord(m_int left1,m_int top1,m_int right1,m_int bottom1,m_int left2,m_int top2,m_int right2,m_int bottom2,rect_t *d); 15149fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_unionRect(rect_t s1,rect_t s2,rect_t *d); 15159fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_unionRectCoord(m_int left1,m_int top1,m_int right1,m_int bottom1,m_int left2,m_int top2,m_int right2,m_int bottom2,rect_t *d); 15169fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 15179fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Built-in patterns and mouse cursor */ 15189fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 15199fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef MGL_LITE 15209fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreampattern_t * MGLAPI _MGL_getEmptyPat(void); 15219fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreampattern_t * MGLAPI _MGL_getGrayPat(void); 15229fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreampattern_t * MGLAPI _MGL_getSolidPat(void); 15239fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 15249fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamcursor_t * MGLAPI _MGL_getDefCursor(void); 15259fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 15269fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Fixed point multiplication/divide routines */ 15279fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 15289fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#if defined(__WATCOMC__) && defined(__386__) 15299fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 15309fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* For Watcom C++ we can use special inline assembler code that is much 15319fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * faster than calling the 386 assembler functions. Currently this is the 15329fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * the only compiler that will allow inline assembler to be expanded 15339fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * directly as inline functions. 15349fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 15359fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 15369fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamfix32_t MGL_FixMul(fix32_t a,fix32_t b); 15379fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#pragma aux MGL_FixMul = \ 15389fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "imul edx" \ 15399fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "add eax,8000h" \ 15409fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "adc edx,0" \ 15419fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "shrd eax,edx,16" \ 15429fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream parm [eax] [edx] \ 15439fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream value [eax] \ 15449fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream modify exact [eax edx]; 15459fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 15469fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamfix32_t MGL_FixDiv(fix32_t a,fix32_t b); 15479fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#pragma aux MGL_FixDiv = \ 15489fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "xor eax,eax" \ 15499fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "shrd eax,edx,16" \ 15509fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "sar edx,16" \ 15519fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "idiv ebx" \ 15529fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream parm [edx] [ebx] \ 15539fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream value [eax] \ 15549fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream modify exact [eax edx]; 15559fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 15569fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamfix32_t MGL_FixMulDiv(fix32_t a,fix32_t b,fix32_t c); 15579fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#pragma aux MGL_FixMulDiv = \ 15589fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "imul ebx" \ 15599fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "idiv ecx" \ 15609fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream parm [eax] [ebx] [ecx] \ 15619fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream value [eax] \ 15629fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream modify exact [eax edx]; 15639fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 15649fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int MGL_backfacing(fix32_t dx1,fix32_t dy1,fix32_t dx2,fix32_t dy2); 15659fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#pragma aux MGL_backfacing = \ 15669fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "imul ebx" \ 15679fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "mov ebx,eax" \ 15689fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "mov ecx,edx" \ 15699fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "mov eax,esi" \ 15709fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "imul edi" \ 15719fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "sub eax,ebx" \ 15729fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "mov eax,1" \ 15739fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "sbb edx,ecx" \ 15749fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "jns @@Backfacing" \ 15759fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "xor eax,eax" \ 15769fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "@@Backfacing:" \ 15779fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream parm [eax] [esi] [edi] [ebx] \ 15789fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream value [eax] \ 15799fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream modify exact [eax ecx edx]; 15809fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 15819fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGL_memcpy(void *dst,void *src,m_int n); 15829fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#pragma aux MGL_memcpy = \ 15839fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "mov eax,ecx" \ 15849fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "shr ecx,2" \ 15859fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "rep movsd" \ 15869fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "mov cl,al" \ 15879fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "and cl,3" \ 15889fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream "rep movsb" \ 15899fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream parm [edi] [esi] [ecx] \ 15909fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream modify exact [eax ecx esi edi]; 15919fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 15929fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#else 15939fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 15949fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamfix32_t ASMAPI MGL_FixMul(fix32_t a,fix32_t b); 15959fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamfix32_t ASMAPI MGL_FixDiv(fix32_t a,fix32_t b); 15969fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamfix32_t ASMAPI MGL_FixMulDiv(fix32_t a,fix32_t b,fix32_t c); 15979fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamm_int ASMAPI MGL_backfacing(fix32_t dx1,fix32_t dy1,fix32_t dx2,fix32_t dy2); 15989fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_memcpy(void *dst,void *src,m_int n); 15999fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 16009fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 16019fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 16029fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* The following are special memcpy routines that properly handler reading 16039fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * and writing to virtual linear buffer memory by forcing the proper 16049fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * alignment. Note that the copy is extended to use a DWORD copy of speed. 16059fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 16069fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 16079fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_memcpyVIRTSRC(void *dst,void *src,m_int n); 16089fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid ASMAPI MGL_memcpyVIRTDST(void *dst,void *src,m_int n); 16099fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 16109fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Function to find an MGL system file's full pathname */ 16119fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 16129fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreambool MGLAPI _MGL_findFile(char *validpath,const char *dir, const char *filename, const char *mode); 16139fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 16149fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Override the internal MGL file I/O functions */ 16159fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 16169fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setFileIO(fileio_t *fio); 16179fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 16189fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* The following dummy symbols are used to link in driver files to be used. A 16199fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * driver is not active until it is linked in with the MGL_registerDriver 16209fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * call. Because we dont export globals in DLLs, we provide functions to 16219fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * get the address of the drivers. However for a static link library we 16229fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * need to use globals so that if the driver data is unreferenced, it will 16239fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * not be linked in with the code. 16249fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream */ 16259fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 16269fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef BUILD_MGL 16279fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#if defined(MGL_DLL) && !defined(BUILD_MGLDLL) 16289fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI VGA4_getDriverAddr(void); 16299fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI VGAX_getDriverAddr(void); 16309fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI SVGA4_getDriverAddr(void); 16319fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI SVGA8_getDriverAddr(void); 16329fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI SVGA16_getDriverAddr(void); 16339fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI SVGA24_getDriverAddr(void); 16349fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI SVGA32_getDriverAddr(void); 16359fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#if !defined(__16BIT__) 16369fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI VGA8_getDriverAddr(void); 16379fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI LINEAR8_getDriverAddr(void); 16389fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI LINEAR16_getDriverAddr(void); 16399fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI LINEAR24_getDriverAddr(void); 16409fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI LINEAR32_getDriverAddr(void); 16419fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI ACCEL8_getDriverAddr(void); 16429fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI ACCEL16_getDriverAddr(void); 16439fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI ACCEL24_getDriverAddr(void); 16449fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI ACCEL32_getDriverAddr(void); 16459fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#if defined(MGLWIN) || defined(__WINDOWS__) 16469fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI DDRAW8_getDriverAddr(void); 16479fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI DDRAW16_getDriverAddr(void); 16489fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI DDRAW24_getDriverAddr(void); 16499fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI DDRAW32_getDriverAddr(void); 16509fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 16519fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 16529fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI PACKED1_getDriverAddr(void); 16539fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI PACKED4_getDriverAddr(void); 16549fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI PACKED8_getDriverAddr(void); 16559fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI PACKED16_getDriverAddr(void); 16569fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI PACKED24_getDriverAddr(void); 16579fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI PACKED32_getDriverAddr(void); 16589fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define VGA4_driver VGA4_getDriverAddr() 16599fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define VGAX_driver VGAX_getDriverAddr() 16609fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define SVGA4_driver SVGA4_getDriverAddr() 16619fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define SVGA8_driver SVGA8_getDriverAddr() 16629fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define SVGA16_driver SVGA16_getDriverAddr() 16639fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define SVGA24_driver SVGA24_getDriverAddr() 16649fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define SVGA32_driver SVGA32_getDriverAddr() 16659fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#if !defined(__16BIT__) 16669fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define VGA8_driver VGA8_getDriverAddr() 16679fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define LINEAR8_driver LINEAR8_getDriverAddr() 16689fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define LINEAR16_driver LINEAR16_getDriverAddr() 16699fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define LINEAR24_driver LINEAR24_getDriverAddr() 16709fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define LINEAR32_driver LINEAR32_getDriverAddr() 16719fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define ACCEL8_driver ACCEL8_getDriverAddr() 16729fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define ACCEL16_driver ACCEL16_getDriverAddr() 16739fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define ACCEL24_driver ACCEL24_getDriverAddr() 16749fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define ACCEL32_driver ACCEL32_getDriverAddr() 16759fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#if defined(MGLWIN) || defined(__WINDOWS__) 16769fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define DDRAW8_driver DDRAW8_getDriverAddr() 16779fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define DDRAW16_driver DDRAW16_getDriverAddr() 16789fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define DDRAW24_driver DDRAW24_getDriverAddr() 16799fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define DDRAW32_driver DDRAW32_getDriverAddr() 16809fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 16819fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 16829fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define PACKED1_driver PACKED1_getDriverAddr() 16839fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define PACKED4_driver PACKED4_getDriverAddr() 16849fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define PACKED8_driver PACKED8_getDriverAddr() 16859fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define PACKED16_driver PACKED16_getDriverAddr() 16869fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define PACKED24_driver PACKED24_getDriverAddr() 16879fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define PACKED32_driver PACKED32_getDriverAddr() 16889fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#else 16899fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI VGA4_driver[]; 16909fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI VGAX_driver[]; 16919fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI SVGA4_driver[]; 16929fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI SVGA8_driver[]; 16939fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI SVGA16_driver[]; 16949fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI SVGA24_driver[]; 16959fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI SVGA32_driver[]; 16969fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#if !defined(__16BIT__) 16979fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI VGA8_driver[]; 16989fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI LINEAR8_driver[]; 16999fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI LINEAR16_driver[]; 17009fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI LINEAR24_driver[]; 17019fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI LINEAR32_driver[]; 17029fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI ACCEL8_driver[]; 17039fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI ACCEL16_driver[]; 17049fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI ACCEL24_driver[]; 17059fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI ACCEL32_driver[]; 17069fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#if defined(MGLWIN) || defined(__WINDOWS__) 17079fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI DDRAW8_driver[]; 17089fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI DDRAW16_driver[]; 17099fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI DDRAW24_driver[]; 17109fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI DDRAW32_driver[]; 17119fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 17129fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 17139fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI PACKED1_driver[]; 17149fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI PACKED4_driver[]; 17159fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI PACKED8_driver[]; 17169fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI PACKED16_driver[]; 17179fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI PACKED24_driver[]; 17189fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamextern m_int _VARAPI PACKED32_driver[]; 17199fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 17209fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 17219fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 17229fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/*--------------------------------------------------------------------------- 17239fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * Memory allocation and utility functions. 17249fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream *-------------------------------------------------------------------------*/ 17259fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 17269fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifndef __16BIT__ 17279fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define _HUGE 17289fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#else 17299fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define _HUGE _huge 17309fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 17319fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 17329fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGL_availableMemory(ulong *physical,ulong *total); 17339fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGL_useLocalMalloc(void _HUGE * (*malloc)(long size),void (*free)(void _HUGE *p)); 17349fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI MGL_malloc(long size); 17359fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid * MGLAPI MGL_calloc(long size,long n); 17369fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_free(void _HUGE *p); 17379fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_memset(void _HUGE *s,m_int c,long n); 17389fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_memsetw(void _HUGE *s,m_int c,long n); 17399fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_memsetl(void _HUGE *s,long c,long n); 17409fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 17419fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/*--------------------------------------------------------------------------- 17429fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * Set a fullscreen suspend application callback function. This is used in 17439fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * fullscreen video modes to allow switching back to the normal operating 17449fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * system graphical shell (such as Windows GDI, OS/2 PM etc). 17459fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream *-------------------------------------------------------------------------*/ 17469fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 17479fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamtypedef m_int (ASMAPI *MGL_suspend_cb_t)(MGLDC *dc,m_int flags); 17489fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setSuspendAppCallback(MGL_suspend_cb_t staveState); 17499fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 17509fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/*--------------------------------------------------------------------------- 17519fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * Tell the MGL to use a pre-loaded ACCEL.DRV driver file. This allows 17529fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * you to link with the SciTech WinDirect/Pro and WinDirect/Ultra device 17539fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * support libraries and tell the MGL to use the device support drivers. 17549fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * If the user has a real ACCEL.DRV driver file in the standard location 17559fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream * on their machine, this driver file will still be used. 17569fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream *-------------------------------------------------------------------------*/ 17579fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 17589fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstreamvoid MGLAPI MGL_setACCELDriver(void *driver); 17599fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 17609fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/*---------------------- Inline functions as Macros -----------------------*/ 17619fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 17629fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_equalPoint(p1,p2) ((p1).x == (p2).x && (p1).y == (p2).y) 17639fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 17649fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_equalRect(r1,r2) ((r1).left == (r2).left && \ 17659fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (r1).top == (r2).top && \ 17669fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (r1).right == (r2).right && \ 17679fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (r1).bottom == (r2).bottom) 17689fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 17699fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_emptyRect(r) ((r).bottom <= (r).top || \ 17709fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (r).right <= (r).left) 17719fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 17729fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_disjointRect(r1,r2) ((r1).right <= (r2).left || \ 17739fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (r1).left >= (r2).right || \ 17749fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (r1).bottom <= (r2).top || \ 17759fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (r1).top >= (r2).bottom) 17769fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 17779fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_sectRect(s1,s2,d) \ 17789fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream ((d)->left = MAX((s1).left,(s2).left), \ 17799fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (d)->right = MIN((s1).right,(s2).right), \ 17809fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (d)->top = MAX((s1).top,(s2).top), \ 17819fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (d)->bottom = MIN((s1).bottom,(s2).bottom), \ 17829fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream !MGL_emptyRect(*d)) 17839fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 17849fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_sectRectFast(s1,s2,d) \ 17859fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (d)->left = MAX((s1).left,(s2).left); \ 17869fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (d)->right = MIN((s1).right,(s2).right); \ 17879fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (d)->top = MAX((s1).top,(s2).top); \ 17889fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (d)->bottom = MIN((s1).bottom,(s2).bottom) 17899fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 17909fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_sectRectCoord(l1,t1,r1,b1,l2,t2,r2,b2,d) \ 17919fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream ((d)->left = MAX(l1,l2), \ 17929fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (d)->right = MIN(r1,r2), \ 17939fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (d)->top = MAX(t1,t2), \ 17949fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (d)->bottom = MIN(b1,b2), \ 17959fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream !MGL_emptyRect(*d)) 17969fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 17979fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_sectRectFastCoord(l1,t1,r1,b1,l2,t2,r2,b2,d) \ 17989fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (d)->left = MAX(l1,l2); \ 17999fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (d)->right = MIN(r1,r2); \ 18009fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (d)->top = MAX(t1,t2); \ 18019fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (d)->bottom = MIN(b1,b2) 18029fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 18039fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_unionRect(s1,s2,d) \ 18049fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (d)->left = MIN((s1).left,(s2).left); \ 18059fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (d)->right = MAX((s1).right,(s2).right); \ 18069fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (d)->top = MIN((s1).top,(s2).top); \ 18079fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (d)->bottom = MAX((s1).bottom,(s2).bottom) 18089fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 18099fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_unionRectCoord(l1,t1,r1,b1,l2,t2,r2,b2,d) \ 18109fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (d)->left = MIN(l1,l2); \ 18119fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (d)->right = MAX(r1,r2); \ 18129fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (d)->top = MIN(t1,t2); \ 18139fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (d)->bottom = MAX(b1,b2) 18149fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 18159fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_offsetRect(r,dx,dy) \ 18169fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream { (r).left += dx; (r).right += dx; \ 18179fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (r).top += dy; (r).bottom += dy; } 18189fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 18199fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_insetRect(r,dx,dy) \ 18209fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream { (r).left += dx; (r).right -= dx; \ 18219fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (r).top += dy; (r).bottom -= dy; \ 18229fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream if (MGL_emptyRect(r)) \ 18239fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (r).left = (r).right = (r).top = (r).bottom = 0; } 18249fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 18259fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_ptInRect(p,r) ((p).x >= (r).left && \ 18269fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (p).x < (r).right && \ 18279fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (p).y >= (r).top && \ 18289fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (p).y < (r).bottom) 18299fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 18309fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_ptInRectCoord(x,y,r) ((x) >= (r).left && \ 18319fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (x) < (r).right && \ 18329fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (y) >= (r).top && \ 18339fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (y) < (r).bottom) 18349fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 18359fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_ptInRegion(p,r) MGL_ptInRegionCoord((p).x,(p).y,r) 18369fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 18379fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_pixel(p) MGL_pixelCoord((p).x,(p).y) 18389fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_getPixel(p) MGL_getPixelCoord((p).x,(p).y) 18399fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_pixelFast(p) MGL_pixelCoordFast((p).x,(p).y) 18409fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_getPixelFast(p) MGL_getPixelCoordFast((p).x,(p).y) 18419fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_moveTo(p) MGL_moveToCoord((p).x,(p).y) 18429fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_moveRel(p) MGL_moveRelCoord((p).x,(p).y) 18439fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_line(p1,p2) MGL_lineCoord((p1).x,(p1).y,(p2).x,(p2).y) 18449fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_lineFast(p1,p2) MGL_lineCoordFast((p1).x,(p1).y,(p2).x,(p2).y) 18459fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_lineFX(p1,p2) MGL_lineCoordFX((p1).x,(p1).y,(p2).x,(p2).y) 18469fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_lineFastFX(p1,p2) MGL_lineCoordFastFX((p1).x,(p1).y,(p2).x,(p2).y) 18479fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_cLineFast(p1,p2) MGL_cLineCoordFast((p1).p.x,(p1).p.y,(p1).c,(p2).p.x,(p2).p.y,(p2).c) 18489fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_rgbLineFast(p1,p2) MGL_rgbLineCoordFast((p1).p.x,(p1).p.y,(p1).c.r,(p1).c.g,(p1).c.b,(p2).p.x,(p2).p.y,(p2).c.r,(p2).c.g,(p2).c.b) 18499fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_zLineFast(p1,p2) MGL_zLineCoordFast((p1).p.x,(p1).p.y,(p1).z,(p2).p.x,(p2).p.y,(p2).z) 18509fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_czLineFast(p1,p2) MGL_czLineCoordFast((p1).p.x,(p1).p.y,(p1).z,(p1).c,(p2).p.x,(p2).p.y,(p2).z,(p2).c) 18519fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_rgbzLineFast(p1,p2) MGL_rgbzLineCoordFast((p1).p.x,(p1).p.y,(p1).z,(p1).c.r,(p1).c.g,(p1).c.b,(p2).p.x,(p2).p.y,(p2).z,(p2).c.r,(p2).c.g,(p2).c.b) 18529fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 18539fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_zClearPt(lt,rb,z) MGL_zClearCoord((lt).x,(lt).y, \ 18549fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (rb).x,(rb).y,z) 18559fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_zClear(r,z) MGL_zClearCoord((r).left,(r).top, \ 18569fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (r).right,(r).bottom,z) 18579fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_lineTo(p) MGL_lineToCoord((p).x,(p).y) 18589fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_lineRel(p) MGL_lineRelCoord((p).x,(p).y); 18599fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_rectPt(lt,rb) MGL_rectCoord((lt).x,(lt).y,(rb).x,(rb).y) 18609fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_rect(r) MGL_rectCoord((r).left,(r).top, \ 18619fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (r).right,(r).bottom) 18629fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_drawBorder(r,s,t) MGL_drawBorderCoord((r).left,(r).top, \ 18639fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (r).right,(r).bottom,(s),(t)) 18649fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_fillRectPt(lt,rb) MGL_fillRectCoord((lt).x,(lt).y, \ 18659fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (rb).x,(rb).y) 18669fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_fillRect(r) MGL_fillRectCoord((r).left,(r).top, \ 18679fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (r).right,(r).bottom) 18689fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_bitBlt(d,s,r,dl,dt,op) MGL_bitBltCoord((d),(s),(r).left, \ 18699fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (r).top,(r).right,(r).bottom,dl,dt,op) 18709fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_bitBltLin(d,s,so,r,op) MGL_bitBltLinCoord((d),(s),so, \ 18719fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (r).left,(r).top,(r).right,(r).bottom,op) 18729fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_stretchBlt(d,s,sr,dr) MGL_stretchBltCoord((d),(s),(sr).left, \ 18739fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (sr).top,(sr).right,(sr).bottom, \ 18749fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (dr).left,(dr).top,(dr).right,(dr).bottom) 18759fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_transBlt(d,s,r,dl,dt,c,st) MGL_transBltCoord((d),(s),(r).left, \ 18769fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (r).top,(r).right,(r).bottom,dl,dt,c,st) 18779fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_transBltLin(d,s,so,r,c,st) MGL_transBltLinCoord((d),(s),so, \ 18789fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (r).left,(r).top,(r).right,(r).bottom,c,st) 18799fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_getDivot(dc,r,divot) MGL_getDivotCoord(dc,(r).left,(r).top, \ 18809fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (r).right,(r).bottom,divot) 18819fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_divotSize(dc,r) MGL_divotSizeCoord(dc,(r).left,(r).top,\ 18829fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (r).right,(r).bottom) 18839fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_isSimpleRegion(r) (((region_t*)(r))->spans == NULL) 18849fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_rgnLine(p1,p2,p) MGL_rgnLineCoord((p1).x,(p1).y,(p2).x,(p2).y,p) 18859fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_rgnLineFX(p1,p2,p) MGL_rgnLineCoordFX((p1).x,(p1).y,(p2).x,(p2).y,p) 18869fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_rgnSolidRectPt(lt,rb) MGL_rgnSolidRectCoord((lt).x,(lt).y, \ 18879fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (rb).x,(rb).y) 18889fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_rgnSolidRect(r) MGL_rgnSolidRectCoord((r).left,(r).top, \ 18899fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (r).right,(r).bottom) 18909fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 18919fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Fast color packing/unpacking routines implemented as macros */ 18929fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 18939fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_packColorFast(pf,R,G,B) \ 18949fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream ((ulong)(((uchar)(R) >> (pf)->redAdjust) & (pf)->redMask) << (pf)->redPos) \ 18959fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream | ((ulong)(((uchar)(G) >> (pf)->greenAdjust) & (pf)->greenMask) << (pf)->greenPos) \ 18969fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream | ((ulong)(((uchar)(B) >> (pf)->blueAdjust) & (pf)->blueMask) << (pf)->bluePos) 18979fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 18989fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_unpackColorFast(pf,c,R,G,B) \ 18999fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream{ \ 19009fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (R) = (uchar)((((ulong)(c) >> (pf)->redPos) & (pf)->redMask) << (pf)->redAdjust); \ 19019fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (G) = (uchar)((((ulong)(c) >> (pf)->greenPos) & (pf)->greenMask) << (pf)->greenAdjust);\ 19029fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (B) = (uchar)((((ulong)(c) >> (pf)->bluePos) & (pf)->blueMask) << (pf)->blueAdjust); \ 19039fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream} 19049fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 19059fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Macros to access the RGB components in a packed 24 bit RGB tuple */ 19069fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 19079fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_rgbRed(c) (((uchar*)&(c))[2]) 19089fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_rgbGreen(c) (((uchar*)&(c))[1]) 19099fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_rgbBlue(c) (((uchar*)&(c))[0]) 19109fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 19119fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Fast 24 bit color packing/unpacking routines implemented as macros */ 19129fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 19139fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_packColorRGBFast(R,G,B) \ 19149fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (((ulong)((uchar)(R)) << 16) | ((ulong)((uchar)(G)) << 8) | (uchar)(B)) 19159fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 19169fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_packColorRGBFast2(c,R,G,B) \ 19179fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream{ \ 19189fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_rgbRed(c) = (uchar)(R); \ 19199fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_rgbGreen(c) = (uchar)(G); \ 19209fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream MGL_rgbBlue(c) = (uchar)(B); \ 19219fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream} 19229fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 19239fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#define MGL_unpackColorRGBFast(c,R,G,B) \ 19249fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream{ \ 19259fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (R) = MGL_rgbRed(c); \ 19269fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (G) = MGL_rgbGreen(c); \ 19279fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream (B) = MGL_rgbBlue(c); \ 19289fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream} 19299fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 19309fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#ifdef __cplusplus 19319fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream} /* End of "C" linkage for C++ */ 19329fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 19339fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#include "mglrect.hpp" /* Include C++ point/rectangle classes */ 19349fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 19359fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif /* __cplusplus */ 19369fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 19379fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/* Include appropriate platform specific bindings */ 19389fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 19399fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#if defined(MGLWIN) || defined(__WINDOWS__) 19409fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#include "mglwin.h" 19419fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#elif defined(MGLPM) || defined(__OS2__) 19429fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/*#include "mglpm.h"*/ 19439fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#elif defined(MGLX) || defined(__UNIX__) 19449fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream/*#include "mglx.h"*/ 19459fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#else 19469fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#include "mgldos.h" 19479fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif 19489fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 19499fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#pragma pack() /* Return to default packing */ 19509fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream 19519fd67c44777b350dc56f3e70c88963b0d966ffc7quake upstream#endif /* __MGRAPH_H */ 1952