source: trunk/src/ddraw/new/os2palset.cpp

Last change on this file was 21916, checked in by dmik, 14 years ago

Merge branch gcc-kmk to trunk.

File size: 2.1 KB
Line 
1/* $Id: OS2PALSET.CPP,v 1.1 2000-04-07 18:21:05 mike Exp $ */
2
3/*
4 * Functions used to Set the Physical Palette in OS/2 when in 8 Bit mode
5 *
6 * Copyright 1998 Sander va Leeuwen
7 *
8 * Project Odin Software License can be found in LICENSE.TXT
9 *
10 */
11#define INCL_GREALL
12#define INCL_GPI
13#include <os2wrap.h>
14#include <pmddi.h>
15#include <stdio.h>
16#include <stdlib.h>
17#include <string.h>
18#include "os2palset.h"
19
20//******************************************************************************
21//******************************************************************************
22void OS2SetPhysPalette(void *pal)
23{
24 PALETTEENTRY *pDirectXPal = (PALETTEENTRY *)pal;
25 HPS hps;
26 HDC hdc;
27 RGB2 os2rgb[256];
28 int i;
29
30 USHORT sel = RestoreOS2FS();
31
32
33
34
35 hps = WinGetPS(HWND_DESKTOP);
36 hdc = GpiQueryDevice(hps);
37
38 for(i=0;i<256;i++)
39 {
40 os2rgb[i].bBlue = pDirectXPal[i].peBlue;
41 os2rgb[i].bGreen = pDirectXPal[i].peGreen;
42 os2rgb[i].bRed = pDirectXPal[i].peRed;
43 os2rgb[i].fcOptions = 0;
44 }
45
46 GpiCreateLogColorTable( hps, LCOL_PURECOLOR | LCOL_REALIZABLE,
47 LCOLF_CONSECRGB,
48 0,
49 256,
50 (PLONG)&os2rgb);
51 Gre32Entry3( hdc,
52 0L,
53 0x000060C6L);
54
55 WinInvalidateRect( HWND_DESKTOP,
56 (PRECTL)NULL,
57 TRUE);
58 WinReleasePS(hps);
59
60 SetFS(sel);
61
62}
63
64//******************************************************************************
65//******************************************************************************
66void OS2ResetPhysPalette()
67{
68 HPS hps;
69 HDC hdc;
70
71 USHORT sel = RestoreOS2FS();
72
73
74
75 hps = WinGetPS( HWND_DESKTOP);
76
77 hdc = GpiQueryDevice( hps);
78
79 Gre32Entry3( hdc,
80 0L,
81 0x000060C7L);
82
83 WinInvalidateRect( HWND_DESKTOP,
84 (PRECTL)NULL,
85 TRUE);
86
87 WinReleasePS(hps);
88
89 SetFS(sel);
90
91}
92//******************************************************************************
93//******************************************************************************
Note: See TracBrowser for help on using the repository browser.