/* DirectDraw - IDirectPalette base interface
*
* Copyright 1997-2000 Marcus Meissner
* Copyright 2000-2001 TransGaming Technologies Inc.
* Copyright 2006 Stefan Dösinger for CodeWeavers
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
* Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Oracle elects to use only
* the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
* a choice of LGPL license versions is made available with the language indicating
* that LGPLv2 or any later version may be used, or where a choice of which version
* of the LGPL is applied is otherwise unspecified.
*/
#include "config.h"
#include "winerror.h"
#include <string.h>
#include "wined3d_private.h"
{
return refcount;
}
{
if (!refcount)
{
}
return refcount;
}
{
{
case WINEDDPCAPS_1BIT: return 2;
case WINEDDPCAPS_2BIT: return 4;
case WINEDDPCAPS_4BIT: return 16;
case WINEDDPCAPS_8BIT: return 256;
default:
return 256;
}
}
{
TRACE("palette %p, flags %#x, start %u, count %u, entries %p.\n",
return WINED3DERR_INVALIDCALL;
{
unsigned int i;
}
else
return WINED3D_OK;
}
{
TRACE("palette %p, flags %#x, start %u, count %u, entries %p.\n",
{
unsigned int i;
}
else
{
/* When WINEDDCAPS_ALLOW256 isn't set we need to override entry 0 with black and 255 with white */
{
TRACE("WINEDDPCAPS_ALLOW256 set, overriding palette entry 0 with black and 255 with white\n");
}
}
/* If the palette is attached to the render target, update all render targets */
LIST_FOR_EACH_ENTRY(resource, &palette->device->resources, struct wined3d_resource, resource_list_entry)
{
{
}
}
return WINED3D_OK;
}
{
}
{
}
{
{
WARN("Failed to create palette.\n");
return E_FAIL;
}
{
return hr;
}
return WINED3D_OK;
}
{
TRACE("device %p, flags %#x, entries %p, palette %p, parent %p.\n",
if (!object)
return E_OUTOFMEMORY;
{
return hr;
}
return WINED3D_OK;
}