diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2006-11-26 20:05:43 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2006-11-26 20:05:43 +0000 |
commit | c93192389bef6d79e2e18cfb36fe4f2691d7c79e (patch) | |
tree | ce6bbe58606ec948c0dde8a2c21bdf5dbc1e0005 /driver/xf86-video-impact/src/impact_cmap.c | |
parent | 66f66c4a7f92a1d10c0493ec8b4ed376edebaf4a (diff) |
Importing xf86-video-impact 0.2.0
Diffstat (limited to 'driver/xf86-video-impact/src/impact_cmap.c')
-rw-r--r-- | driver/xf86-video-impact/src/impact_cmap.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/driver/xf86-video-impact/src/impact_cmap.c b/driver/xf86-video-impact/src/impact_cmap.c new file mode 100644 index 000000000..7728b4acc --- /dev/null +++ b/driver/xf86-video-impact/src/impact_cmap.c @@ -0,0 +1,52 @@ +/* + * impact.h 2005/07/15 01:40:13, Copyright (c) 2005 peter fuerst + * + * Based on: + * # newport_cmap.c,v 1.1 2000/11/29 20:58:10 agx Exp # + * # xc/programs/Xserver/hw/xfree86/drivers/newport/newport_cmap.c,v + * 1.2 2001/11/23 19:50:45 dawes Exp # + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "impact.h" + +/* +unsigned ImpactGetPalReg(ImpactPtr pImpact, int i) +{ + return pImpact->pseudo_palette[i & 0xff]; +} +*/ + +/* Load a colormap into the "hardware" */ +void ImpactLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, + LOCO* colors, VisualPtr pVisual) +{ + ImpactPtr pImpact = IMPACTPTR(pScrn); + + TRACEV("ImpactLoadPalette(%d) %c", numColors, numColors!=1?'\n':0); + if (numColors > 256) numColors = 256; + + for ( ; numColors > 0; numColors--, indices++, colors++) { + unsigned rgb = colors->blue & 0xff00; + rgb = (rgb<<8) | (colors->green & 0xff00) | (colors->red>>8); + pImpact->pseudo_palette[*indices] = rgb; + TRACEV("%d:%04x %04x,%04x,%04x\n", *indices, rgb, + (int)colors->red, (int)colors->green, (int)colors->blue); + } + TRACEV("\n"); +} + +void ImpactBackupPalette(ScrnInfoPtr pScrn) +{ + (void)IMPACTPTR(pScrn)->pseudo_palette; /* Nothing to do? */ +} + +/* restore the default colormap */ +void ImpactRestorePalette(ScrnInfoPtr pScrn) +{ + (void)IMPACTPTR(pScrn)->pseudo_palette; /* Nothing to do? */ +} + |