source: trunk/src/ddraw/OS2PALSET.CPP@ 2174

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

Added ODIn lic header with ID to all files where missing

Cleaned up Surface handling by movefing colorfill and
colorconversion into own files and use functionpointers
setup during creation.

updated makefile to add files

removed inhertiance from IBASE in DDrectangle class

File size: 2.0 KB
Line 
1/* $Id: OS2PALSET.CPP,v 1.7 1999-12-21 01:28:16 hugh 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
31
32 hps = WinGetPS(HWND_DESKTOP);
33 hdc = GpiQueryDevice(hps);
34
35 for(i=0;i<256;i++)
36 {
37 os2rgb[i].bBlue = pDirectXPal[i].peBlue;
38 os2rgb[i].bGreen = pDirectXPal[i].peGreen;
39 os2rgb[i].bRed = pDirectXPal[i].peRed;
40 os2rgb[i].fcOptions = 0;
41 }
42
43 GpiCreateLogColorTable( hps, LCOL_PURECOLOR | LCOL_REALIZABLE,
44 LCOLF_CONSECRGB,
45 0,
46 256,
47 (PLONG)&os2rgb);
48 Gre32Entry3( hdc,
49 0L,
50 0x000060C6L);
51
52 WinInvalidateRect( HWND_DESKTOP,
53 (PRECTL)NULL,
54 TRUE);
55 WinReleasePS(hps);
56
57
58
59}
60//******************************************************************************
61//******************************************************************************
62void OS2ResetPhysPalette()
63{
64 HPS hps;
65 HDC hdc;
66
67
68
69 hps = WinGetPS( HWND_DESKTOP);
70
71 hdc = GpiQueryDevice( hps);
72
73 Gre32Entry3( hdc,
74 0L,
75 0x000060C7L);
76
77 WinInvalidateRect( HWND_DESKTOP,
78 (PRECTL)NULL,
79 TRUE);
80
81 WinReleasePS(hps);
82
83
84
85}
86//******************************************************************************
87//******************************************************************************
Note: See TracBrowser for help on using the repository browser.