Ejemplo n.º 1
0
void vgainten(Sint4 inten)
{
#ifdef WIN32
  /*GdiFlush();*/
#endif
  cur_intensity=inten;
  if (g_bWindowed)
  {
#ifdef WIN32  
    SetDIBColorTable(back_dc,0,16, windowed_palette[cur_palette*2 + cur_intensity]);
#else
    WinGSetDIBColorTable(back_dc,0,16, windowed_palette[cur_palette*2 + cur_intensity]);
#endif    
    if (use_async_screen_updates)
      InvalidateRect(hWnd, NULL, FALSE);
    else
      blit_to_window();
  }
#ifdef DIRECTX
  else
  {
    IDirectDrawSurface4_SetPalette(g_pDDSPrimary, fullscreen_palette[cur_palette*2 + cur_intensity]);
    SetDIBColorTable(back_dc,0,16, windowed_palette[cur_palette*2 + cur_intensity]);
  }
#endif
};
Ejemplo n.º 2
0
static HRESULT WINAPI ddrawex_surface4_SetPalette(IDirectDrawSurface4 *iface, IDirectDrawPalette *palette)
{
    struct ddrawex_surface *surface = impl_from_IDirectDrawSurface4(iface);

    TRACE("iface %p, palette %p.\n", iface, palette);

    return IDirectDrawSurface4_SetPalette(surface->parent, palette);
}
Ejemplo n.º 3
0
Bool
winDestroyColormapShadowDDNL (ColormapPtr pColormap)
{
  winScreenPriv(pColormap->pScreen);
  winCmapPriv(pColormap);
  HRESULT		ddrval = DD_OK;

  /*
   * Is colormap to be destroyed the default?
   *
   * Non-default colormaps should have had winUninstallColormap
   * called on them before we get here.  The default colormap
   * will not have had winUninstallColormap called on it.  Thus,
   * we need to handle the default colormap in a special way.
   */
  if (pColormap->flags & IsDefault)
    {
#if CYGDEBUG
      ErrorF ("winDestroyColormapShadowDDNL - Destroying default "
	      "colormap\n");
#endif
      
      /*
       * FIXME: Walk the list of all screens, popping the default
       * palette out of each screen device context.
       */
      
      /* Pop the palette out of the primary surface */
      ddrval = IDirectDrawSurface4_SetPalette (pScreenPriv->pddsPrimary4,
					       NULL);
      if (FAILED (ddrval))
	{
	  ErrorF ("winDestroyColormapShadowDDNL - Failed freeing the "
		  "default colormap DirectDraw palette.\n");
	  return FALSE;
	}

      /* Clear our private installed colormap pointer */
      pScreenPriv->pcmapInstalled = NULL;
    }
  
  /* Release the palette */
  IDirectDrawPalette_Release (pCmapPriv->lpDDPalette);
 
  /* Invalidate the colormap privates */
  pCmapPriv->lpDDPalette = NULL;

  return TRUE;
}
static Bool
winInstallColormapShadowDDNL (ColormapPtr pColormap)
{
  ScreenPtr		pScreen = pColormap->pScreen;
  winScreenPriv(pScreen);
  winCmapPriv(pColormap);
  HRESULT		ddrval = DD_OK;

  /* Install the DirectDraw palette on the primary surface */
  ddrval = IDirectDrawSurface4_SetPalette (pScreenPriv->pddsPrimary4,
					   pCmapPriv->lpDDPalette);
  if (FAILED (ddrval))
    {
      ErrorF ("winInstallColormapShadowDDNL - Failed installing the "
	      "DirectDraw palette.\n");
      return FALSE;
    }

  /* Save a pointer to the newly installed colormap */
  pScreenPriv->pcmapInstalled = pColormap;

  return TRUE;
}