Added some TRACEs to the ddraw code.
[wine] / dlls / ddraw / d3dcommon.c
1 /* Direct3D Common functions
2  * Copyright (c) 1998 Lionel ULMER
3  *
4  * This file contains all common miscellaneous code that spans
5  * different 'objects'
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  */
21
22 #include "windef.h"
23 #include "wine/obj_base.h"
24 #include "ddraw.h"
25 #include "d3d.h"
26 #include "wine/debug.h"
27
28 #include "d3d_private.h"
29
30 WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
31
32 const char *_get_renderstate(D3DRENDERSTATETYPE type) {
33   static const char * const states[] = {
34     "ERR",
35     "D3DRENDERSTATE_TEXTUREHANDLE",
36     "D3DRENDERSTATE_ANTIALIAS",
37     "D3DRENDERSTATE_TEXTUREADDRESS",
38     "D3DRENDERSTATE_TEXTUREPERSPECTIVE",
39     "D3DRENDERSTATE_WRAPU",
40     "D3DRENDERSTATE_WRAPV",
41     "D3DRENDERSTATE_ZENABLE",
42     "D3DRENDERSTATE_FILLMODE",
43     "D3DRENDERSTATE_SHADEMODE",
44     "D3DRENDERSTATE_LINEPATTERN",
45     "D3DRENDERSTATE_MONOENABLE",
46     "D3DRENDERSTATE_ROP2",
47     "D3DRENDERSTATE_PLANEMASK",
48     "D3DRENDERSTATE_ZWRITEENABLE",
49     "D3DRENDERSTATE_ALPHATESTENABLE",
50     "D3DRENDERSTATE_LASTPIXEL",
51     "D3DRENDERSTATE_TEXTUREMAG",
52     "D3DRENDERSTATE_TEXTUREMIN",
53     "D3DRENDERSTATE_SRCBLEND",
54     "D3DRENDERSTATE_DESTBLEND",
55     "D3DRENDERSTATE_TEXTUREMAPBLEND",
56     "D3DRENDERSTATE_CULLMODE",
57     "D3DRENDERSTATE_ZFUNC",
58     "D3DRENDERSTATE_ALPHAREF",
59     "D3DRENDERSTATE_ALPHAFUNC",
60     "D3DRENDERSTATE_DITHERENABLE",
61     "D3DRENDERSTATE_ALPHABLENDENABLE",
62     "D3DRENDERSTATE_FOGENABLE",
63     "D3DRENDERSTATE_SPECULARENABLE",
64     "D3DRENDERSTATE_ZVISIBLE",
65     "D3DRENDERSTATE_SUBPIXEL",
66     "D3DRENDERSTATE_SUBPIXELX",
67     "D3DRENDERSTATE_STIPPLEDALPHA",
68     "D3DRENDERSTATE_FOGCOLOR",
69     "D3DRENDERSTATE_FOGTABLEMODE",
70     "D3DRENDERSTATE_FOGTABLESTART",
71     "D3DRENDERSTATE_FOGTABLEEND",
72     "D3DRENDERSTATE_FOGTABLEDENSITY",
73     "D3DRENDERSTATE_STIPPLEENABLE",
74     "D3DRENDERSTATE_EDGEANTIALIAS",
75     "D3DRENDERSTATE_COLORKEYENABLE",
76     "ERR",
77     "D3DRENDERSTATE_BORDERCOLOR",
78     "D3DRENDERSTATE_TEXTUREADDRESSU",
79     "D3DRENDERSTATE_TEXTUREADDRESSV",
80     "D3DRENDERSTATE_MIPMAPLODBIAS",
81     "D3DRENDERSTATE_ZBIAS",
82     "D3DRENDERSTATE_RANGEFOGENABLE",
83     "D3DRENDERSTATE_ANISOTROPY",
84     "D3DRENDERSTATE_FLUSHBATCH",
85     "ERR", "ERR", "ERR", "ERR", "ERR", "ERR", "ERR",
86     "ERR", "ERR", "ERR", "ERR", "ERR", "ERR",
87     "D3DRENDERSTATE_STIPPLEPATTERN00",
88     "D3DRENDERSTATE_STIPPLEPATTERN01",
89     "D3DRENDERSTATE_STIPPLEPATTERN02",
90     "D3DRENDERSTATE_STIPPLEPATTERN03",
91     "D3DRENDERSTATE_STIPPLEPATTERN04",
92     "D3DRENDERSTATE_STIPPLEPATTERN05",
93     "D3DRENDERSTATE_STIPPLEPATTERN06",
94     "D3DRENDERSTATE_STIPPLEPATTERN07",
95     "D3DRENDERSTATE_STIPPLEPATTERN08",
96     "D3DRENDERSTATE_STIPPLEPATTERN09",
97     "D3DRENDERSTATE_STIPPLEPATTERN10",
98     "D3DRENDERSTATE_STIPPLEPATTERN11",
99     "D3DRENDERSTATE_STIPPLEPATTERN12",
100     "D3DRENDERSTATE_STIPPLEPATTERN13",
101     "D3DRENDERSTATE_STIPPLEPATTERN14",
102     "D3DRENDERSTATE_STIPPLEPATTERN15",
103     "D3DRENDERSTATE_STIPPLEPATTERN16",
104     "D3DRENDERSTATE_STIPPLEPATTERN17",
105     "D3DRENDERSTATE_STIPPLEPATTERN18",
106     "D3DRENDERSTATE_STIPPLEPATTERN19",
107     "D3DRENDERSTATE_STIPPLEPATTERN20",
108     "D3DRENDERSTATE_STIPPLEPATTERN21",
109     "D3DRENDERSTATE_STIPPLEPATTERN22",
110     "D3DRENDERSTATE_STIPPLEPATTERN23",
111     "D3DRENDERSTATE_STIPPLEPATTERN24",
112     "D3DRENDERSTATE_STIPPLEPATTERN25",
113     "D3DRENDERSTATE_STIPPLEPATTERN26",
114     "D3DRENDERSTATE_STIPPLEPATTERN27",
115     "D3DRENDERSTATE_STIPPLEPATTERN28",
116     "D3DRENDERSTATE_STIPPLEPATTERN29",
117     "D3DRENDERSTATE_STIPPLEPATTERN30",
118     "D3DRENDERSTATE_STIPPLEPATTERN31"
119   };
120   if (type >= (sizeof(states) / sizeof(states[0]))) return "ERR";
121   return states[type];
122 }