source: trunk/src/ddraw/OS2PALETTE.H@ 1036

Last change on this file since 1036 was 587, checked in by hugh, 26 years ago

Implemented new colorconversion routine and fixed bug in fastblt function.
Changed the palettehandling code

File size: 2.3 KB
Line 
1#ifndef __OS2PALETTE_H__
2#define __OS2PALETTE_H__
3
4#include "divewrap.h"
5#define FAR
6#undef THIS
7#define THIS IDirectDrawPalette*
8
9#pragma pack(1) /* pack on wordboundary */
10
11typedef struct _RGB2 /* rgb2 */
12{
13 BYTE bBlue; /* Blue component of the color definition */
14 BYTE bGreen; /* Green component of the color definition*/
15 BYTE bRed; /* Red component of the color definition */
16 BYTE fcOptions; /* Reserved, must be zero */
17} RGB2;
18typedef RGB2 *PRGB2;
19#pragma pack()
20
21class OS2IDirectDrawPalette
22{
23 public:
24 //this one has to go first!
25 IDirectDrawPaletteVtbl *lpVtbl;
26 IDirectDrawPaletteVtbl Vtbl;
27
28 OS2IDirectDrawPalette( VOID *lpDirectDraw,
29 int palsize,
30 LPPALETTEENTRY lpColorTable,
31 DWORD dwPalFlags);
32 ~OS2IDirectDrawPalette();
33
34 void SetPhysPalette();
35 void RestorePhysPalette();
36 void SetIsPrimary(BOOL newValue);
37 int Referenced;
38 inline HRESULT GetLastError() { return lastError; };
39 WORD aPal16[256];
40 DWORD aPal24[256];
41 private:
42
43 protected:
44 HDIVE hDive;
45 HDIVE hDiveCC;
46 HRESULT lastError;
47 LPPALETTEENTRY os2pal;
48 VOID *lpDraw;
49 DWORD dwCaps;
50 DWORD dwSize;
51 BOOL fAttachedToPrimary;
52 friend HRESULT __stdcall PalQueryInterface(THIS, REFIID riid, LPVOID FAR * ppvObj);
53 friend ULONG __stdcall PalAddRef(THIS);
54 friend ULONG __stdcall PalRelease(THIS);
55 friend HRESULT __stdcall PalGetCaps(THIS, LPDWORD);
56 friend HRESULT __stdcall PalGetEntries(THIS, DWORD,DWORD,DWORD,LPPALETTEENTRY);
57 friend HRESULT __stdcall PalInitialize(THIS, LPDIRECTDRAW, DWORD, LPPALETTEENTRY);
58 friend HRESULT __stdcall PalSetEntries(THIS, DWORD,DWORD,DWORD,LPPALETTEENTRY);
59};
60
61
62HRESULT __stdcall PalQueryInterface(THIS, REFIID riid, LPVOID FAR * ppvObj);
63ULONG __stdcall PalAddRef(THIS);
64ULONG __stdcall PalRelease(THIS);
65HRESULT __stdcall PalGetCaps(THIS, LPDWORD);
66HRESULT __stdcall PalGetEntries(THIS, DWORD,DWORD,DWORD,LPPALETTEENTRY);
67HRESULT __stdcall PalInitialize(THIS, LPDIRECTDRAW, DWORD, LPPALETTEENTRY);
68HRESULT __stdcall PalSetEntries(THIS, DWORD,DWORD,DWORD,LPPALETTEENTRY);
69
70
71#endif
Note: See TracBrowser for help on using the repository browser.