another non-working update
This commit is contained in:
parent
28029a2e2a
commit
bef9be64c9
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
// need to install these due to external projects that link directly with libpandadx (bartop)
|
||||
#define INSTALL_HEADERS \
|
||||
config_dxgsg8.h dxGraphicsStateGuardian8.I dxGraphicsStateGuardian8.h \
|
||||
dxgsg8base.h config_dxgsg8.h dxGraphicsStateGuardian8.I dxGraphicsStateGuardian8.h \
|
||||
dxTextureContext8.h dxGeomNodeContext8.h dxGeomNodeContext8.I
|
||||
|
||||
// build dxGraphicsStateGuardian separately since its so big
|
||||
|
|
|
|||
|
|
@ -1352,7 +1352,7 @@ render_frame() {
|
|||
}
|
||||
|
||||
DWORD nVerts = (NUM_FPSMETER_LETTERS+1)*2*3; // +1 for suffix square
|
||||
HRESULT hr = scrn.pD3DDevice->DrawPrimitive(D3DPT_TRIANGLELIST, _fpsmeter_fvfflags, _fpsmeter_verts, nVerts, NULL);
|
||||
HRESULT hr = scrn.pD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST, _fpsmeter_fvfflags, _fpsmeter_verts, nVerts, NULL);
|
||||
TestDrawPrimFailure(DrawPrim,hr,scrn.pDD,NUM_FPSMETER_LETTERS*2,0);
|
||||
|
||||
#ifdef MAKE_FPSMETER_TRANSPARENT
|
||||
|
|
@ -2125,7 +2125,7 @@ draw_point(GeomPoint *geom, GeomContext *gc) {
|
|||
draw_prim_inner_loop(nPrims, geom, _perVertex | _perPrim);
|
||||
|
||||
if(!_bDrawPrimDoSetupVertexBuffer) {
|
||||
HRESULT hr = scrn.pD3DDevice->DrawPrimitive(D3DPT_POINTLIST, _curFVFflags, _pFvfBufBasePtr, nPrims, NULL);
|
||||
HRESULT hr = scrn.pD3DDevice->DrawPrimitiveUP(D3DPT_POINTLIST, _curFVFflags, _pFvfBufBasePtr, nPrims, NULL);
|
||||
TestDrawPrimFailure(DrawPrim,hr,scrn.pDD,nPrims,0);
|
||||
} else {
|
||||
COPYVERTDATA_2_VERTEXBUFFER(D3DPT_POINTLIST,nPrims);
|
||||
|
|
@ -2223,10 +2223,10 @@ draw_line(GeomLine* geom, GeomContext *gc) {
|
|||
if(!_bDrawPrimDoSetupVertexBuffer) {
|
||||
if (_tmp_fvfOverrunBuf == NULL) {
|
||||
nassertv((nVerts*vertex_size) == (_pCurFvfBufPtr-_pFvfBufBasePtr));
|
||||
hr = scrn.pD3DDevice->DrawPrimitive(D3DPT_LINELIST, _curFVFflags, _pFvfBufBasePtr, nVerts, NULL);
|
||||
hr = scrn.pD3DDevice->DrawPrimitiveUP(D3DPT_LINELIST, _curFVFflags, _pFvfBufBasePtr, nVerts, NULL);
|
||||
} else {
|
||||
nassertv((nVerts*vertex_size) == (_pCurFvfBufPtr-_tmp_fvfOverrunBuf));
|
||||
hr = scrn.pD3DDevice->DrawPrimitive(D3DPT_LINELIST, _curFVFflags, _tmp_fvfOverrunBuf, nVerts, NULL);
|
||||
hr = scrn.pD3DDevice->DrawPrimitiveUP(D3DPT_LINELIST, _curFVFflags, _tmp_fvfOverrunBuf, nVerts, NULL);
|
||||
delete [] _tmp_fvfOverrunBuf;
|
||||
}
|
||||
TestDrawPrimFailure(DrawPrim,hr,scrn.pDD,nVerts,0);
|
||||
|
|
@ -2344,7 +2344,7 @@ draw_linestrip_base(Geom* geom, GeomContext *gc, bool bConnectEnds) {
|
|||
nassertv((nVerts*vertex_size) == (_pCurFvfBufPtr-_pFvfBufBasePtr));
|
||||
|
||||
if(!_bDrawPrimDoSetupVertexBuffer) {
|
||||
HRESULT hr = scrn.pD3DDevice->DrawPrimitive(D3DPT_LINESTRIP, _curFVFflags, _pFvfBufBasePtr, nVerts, NULL);
|
||||
HRESULT hr = scrn.pD3DDevice->DrawPrimitiveUP(D3DPT_LINESTRIP, _curFVFflags, _pFvfBufBasePtr, nVerts, NULL);
|
||||
TestDrawPrimFailure(DrawPrim,hr,scrn.pDD,nVerts,0);
|
||||
} else {
|
||||
COPYVERTDATA_2_VERTEXBUFFER(D3DPT_LINESTRIP,nVerts);
|
||||
|
|
@ -2764,7 +2764,7 @@ draw_sprite(GeomSprite *geom, GeomContext *gc) {
|
|||
|
||||
// cant do tristrip/fan since it would require 1 call want to make 1 call for multiple quads which arent connected
|
||||
// best we can do is indexed primitive, which sends 2 redundant indices instead of sending 2 redundant full verts
|
||||
HRESULT hr = scrn.pD3DDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, _curFVFflags, _pFvfBufBasePtr, 4*nprims, _index_buf,QUADVERTLISTLEN*nprims,NULL);
|
||||
HRESULT hr = scrn.pD3DDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, _curFVFflags, _pFvfBufBasePtr, 4*nprims, _index_buf,QUADVERTLISTLEN*nprims,NULL);
|
||||
TestDrawPrimFailure(DrawIndexedPrim,hr,scrn.pDD,QUADVERTLISTLEN*nprims,nprims);
|
||||
|
||||
_pCurFvfBufPtr = NULL;
|
||||
|
|
@ -2924,7 +2924,7 @@ draw_tri(GeomTri *geom, GeomContext *gc) {
|
|||
nassertv((nVerts*vertex_size) == (_pCurFvfBufPtr-_pFvfBufBasePtr));
|
||||
|
||||
if(!_bDrawPrimDoSetupVertexBuffer) {
|
||||
hr = scrn.pD3DDevice->DrawPrimitive(D3DPT_TRIANGLELIST, _curFVFflags, _pFvfBufBasePtr, nVerts, NULL);
|
||||
hr = scrn.pD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST, _curFVFflags, _pFvfBufBasePtr, nVerts, NULL);
|
||||
TestDrawPrimFailure(DrawPrim,hr,scrn.pDD,nVerts,nPrims);
|
||||
} else {
|
||||
COPYVERTDATA_2_VERTEXBUFFER(D3DPT_TRIANGLELIST,nVerts);
|
||||
|
|
@ -2947,7 +2947,7 @@ draw_tri(GeomTri *geom, GeomContext *gc) {
|
|||
scrn.pD3DDevice->SetTextureStageState(0,D3DTSS_BORDERCOLOR,MY_D3DRGBA(0,0,0,0));
|
||||
|
||||
_curFVFflags = D3DFVF_XYZ | (D3DFVF_TEX1 | D3DFVF_TEXCOORDSIZE2(0)) ;
|
||||
HRESULT hr = scrn.pD3DDevice->DrawPrimitive(D3DPT_TRIANGLELIST, _curFVFflags, vert_buf, nPrims*3, NULL);
|
||||
HRESULT hr = scrn.pD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST, _curFVFflags, vert_buf, nPrims*3, NULL);
|
||||
TestDrawPrimFailure(DrawPrim,hr,scrn.pDD,nPrims*3,nPrims);
|
||||
#endif
|
||||
}
|
||||
|
|
@ -3134,7 +3134,7 @@ draw_multitri(Geom *geom, D3DPRIMITIVETYPE trilisttype) {
|
|||
assert((nVerts*vertex_size) == (_pCurFvfBufPtr-_pFvfBufBasePtr));
|
||||
|
||||
if(!_bDrawPrimDoSetupVertexBuffer) {
|
||||
hr = scrn.pD3DDevice->DrawPrimitive(trilisttype, _curFVFflags, _pFvfBufBasePtr, nVerts, NULL);
|
||||
hr = scrn.pD3DDevice->DrawPrimitiveUP(trilisttype, _curFVFflags, _pFvfBufBasePtr, nVerts, NULL);
|
||||
TestDrawPrimFailure(DrawPrim,hr,scrn.pDD,nVerts,nVerts-2);
|
||||
} else {
|
||||
COPYVERTDATA_2_VERTEXBUFFER(trilisttype,nVerts);
|
||||
|
|
@ -3441,7 +3441,7 @@ draw_sphere(GeomSphere *geom, GeomContext *gc) {
|
|||
|
||||
// possible optimization: make DP 1 for all spheres call here, since trilist is independent tris.
|
||||
// indexes couldnt start w/0 tho, need to pass offset to gensph
|
||||
HRESULT hr = scrn.pD3DDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, _curFVFflags, _pFvfBufBasePtr, nVerts, _index_buf,nIndices,NULL);
|
||||
HRESULT hr = scrn.pD3DDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, _curFVFflags, _pFvfBufBasePtr, nVerts, _index_buf,nIndices,NULL);
|
||||
TestDrawPrimFailure(DrawIndexedPrim,hr,scrn.pDD,nVerts,(nIndices>>2));
|
||||
}
|
||||
|
||||
|
|
@ -4323,7 +4323,7 @@ issue_transform(const TransformTransition *attrib) {
|
|||
{0.0f, 0.0f, 3.0, 0.0f, -1.0f, 0.0f, MY_D3DRGBA(0.0f, 0.0f, 1.0f, 1.0f)}, // blu
|
||||
};
|
||||
|
||||
HRESULT hr = scrn.pD3DDevice->DrawPrimitive(D3DPT_LINELIST, D3DFVF_DIFFUSE | D3DFVF_XYZ | D3DFVF_NORMAL,
|
||||
HRESULT hr = scrn.pD3DDevice->DrawPrimitiveUP(D3DPT_LINELIST, D3DFVF_DIFFUSE | D3DFVF_XYZ | D3DFVF_NORMAL,
|
||||
vert_buf, 6, NULL);
|
||||
TestDrawPrimFailure(DrawPrim,hr,scrn.pDD,6,0);
|
||||
|
||||
|
|
|
|||
|
|
@ -38,50 +38,11 @@
|
|||
#include <pointerToArray.h>
|
||||
#include <planeNode.h>
|
||||
|
||||
#include "dxgsg8base.h"
|
||||
#include "dxGeomNodeContext8.h"
|
||||
#include "dxTextureContext8.h"
|
||||
#include <vector>
|
||||
|
||||
#define FLG(NN) (1<<NN)
|
||||
#define MAX_POSSIBLE_TEXFMTS 32
|
||||
typedef enum {
|
||||
R8G8B8_FLAG = FLG(0),
|
||||
A8R8G8B8_FLAG = FLG(1),
|
||||
X8R8G8B8_FLAG = FLG(2),
|
||||
R5G6B5_FLAG = FLG(3),
|
||||
X1R5G5B5_FLAG = FLG(4),
|
||||
A1R5G5B5_FLAG = FLG(5),
|
||||
A4R4G4B4_FLAG = FLG(6),
|
||||
R3G3B2_FLAG = FLG(7),
|
||||
A8_FLAG = FLG(8),
|
||||
A8R3G3B2_FLAG = FLG(9),
|
||||
X4R4G4B4_FLAG = FLG(10),
|
||||
A2B10G10R10_FLAG = FLG(12),
|
||||
// G16R16_FLAG = FLG(13), leaving this 1 out to fit in 32 bits
|
||||
A8P8_FLAG = FLG(13),
|
||||
P8_FLAG = FLG(14),
|
||||
L8_FLAG = FLG(15),
|
||||
A8L8_FLAG = FLG(16),
|
||||
A4L4_FLAG = FLG(17),
|
||||
V8U8_FLAG = FLG(18),
|
||||
L6V5U5_FLAG = FLG(19),
|
||||
X8L8V8U8_FLAG = FLG(20),
|
||||
Q8W8V8U8_FLAG = FLG(21),
|
||||
V16U16_FLAG = FLG(22),
|
||||
W11V11U10_FLAG = FLG(23),
|
||||
A2W10V10U10_FLAG = FLG(24),
|
||||
UYVY_FLAG = FLG(25),
|
||||
YUY2_FLAG = FLG(26),
|
||||
DXT1_FLAG = FLG(27),
|
||||
DXT2_FLAG = FLG(28),
|
||||
DXT3_FLAG = FLG(29),
|
||||
DXT4_FLAG = FLG(30),
|
||||
DXT5_FLAG = FLG(31)
|
||||
} D3DFORMAT_FLAG;
|
||||
|
||||
#define IS_16BPP_FORMAT(FMT) (((FMT)>=D3DFMT_R5G6B5)&&((FMT)<=D3DFMT_A1R5G5B5))
|
||||
#define IS_STENCIL_FORMAT(FMT) (((FMT)==D3DFMT_D24S8) || ((FMT)==D3DFMT_D15S1) || ((FMT)==D3DFMT_D24X4S4))
|
||||
|
||||
class PlaneNode;
|
||||
class Light;
|
||||
|
||||
|
|
@ -92,59 +53,6 @@ INLINE ostream &operator << (ostream &out, GLenum v) {
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef DO_PSTATS
|
||||
#define DO_PSTATS_STUFF(XX) XX;
|
||||
#else
|
||||
#define DO_PSTATS_STUFF(XX)
|
||||
#endif
|
||||
|
||||
#define DX_DECLARE_CLEAN(type, var) \
|
||||
type var; \
|
||||
ZeroMemory(&var, sizeof(type)); \
|
||||
var.dwSize = sizeof(type);
|
||||
|
||||
#define SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } }
|
||||
#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=NULL; } }
|
||||
|
||||
// this is bDoDownToZero argument to RELEASE()
|
||||
#define RELEASE_DOWN_TO_ZERO true
|
||||
#define RELEASE_ONCE false
|
||||
|
||||
// #define DEBUG_RELEASES
|
||||
|
||||
#ifdef DEBUG_RELEASES
|
||||
#define RELEASE(OBJECT,MODULE,DBGSTR,bDoDownToZero) \
|
||||
if(((OBJECT)!=NULL)&&(!IsBadWritePtr((OBJECT),4))) { \
|
||||
refcnt = (OBJECT)->Release(); \
|
||||
MODULE##_cat.debug() << DBGSTR << " released, refcnt = " << refcnt << endl; \
|
||||
if((bDoDownToZero) && (refcnt>0)) { \
|
||||
MODULE##_cat.warning() << DBGSTR << " released but still has a non-zero refcnt(" << refcnt << "), multi-releasing it down to zero!\n"; \
|
||||
do { \
|
||||
refcnt = (OBJECT)->Release(); \
|
||||
} while(refcnt>0); \
|
||||
} \
|
||||
(OBJECT) = NULL; \
|
||||
} else { \
|
||||
MODULE##_cat.debug() << DBGSTR << " not released, ptr == NULL" << endl; \
|
||||
}
|
||||
|
||||
#define PRINTREFCNT(OBJECT,STR) { (OBJECT)->AddRef(); dxgsg_cat.debug() << STR << " refcnt = " << (OBJECT)->Release() << endl; }
|
||||
#else
|
||||
#define RELEASE(OBJECT,MODULE,DBGSTR,bDoDownToZero) \
|
||||
if(((OBJECT)!=NULL)&&(!IsBadWritePtr((OBJECT),4))) { \
|
||||
refcnt=(OBJECT)->Release(); \
|
||||
if((bDoDownToZero) && (refcnt>0)) { \
|
||||
MODULE##_cat.warning() << DBGSTR << " released but still has a non-zero refcnt(" << refcnt << "), multi-releasing it down to zero!\n"; \
|
||||
do { \
|
||||
refcnt = (OBJECT)->Release(); \
|
||||
} while(refcnt>0); \
|
||||
} \
|
||||
(OBJECT) = NULL; \
|
||||
}
|
||||
|
||||
#define PRINTREFCNT(OBJECT,STR)
|
||||
#endif
|
||||
|
||||
//#if defined(NOTIFY_DEBUG) || defined(DO_PSTATS)
|
||||
#ifdef _DEBUG
|
||||
// This function now serves both to print a debug message to the
|
||||
|
|
@ -158,10 +66,6 @@ extern void dbgPrintVidMem(LPDIRECTDRAW7 pDD, LPDDSCAPS2 lpddsCaps,const char *p
|
|||
#define PRINTVIDMEM(pDD,pCaps,pMsg)
|
||||
#endif
|
||||
|
||||
#ifndef D3DERRORSTRING
|
||||
#define D3DERRORSTRING(HRESULT) " at (" << __FILE__ << ":" << __LINE__"), hr=" << DXGetErrorString8(HRESULT) << ": " << DXGetErrorDescription8(HRESULT) << endl
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : DXGraphicsStateGuardian
|
||||
// Description : A GraphicsStateGuardian specialized for rendering
|
||||
|
|
@ -518,8 +422,6 @@ private:
|
|||
static TypeHandle _type_handle;
|
||||
};
|
||||
|
||||
#define ISPOW2(X) (((X) & ((X)-1))==0)
|
||||
|
||||
#include "dxGraphicsStateGuardian8.I"
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -19,52 +19,11 @@
|
|||
#ifndef DXTEXTURECONTEXT_H
|
||||
#define DXTEXTURECONTEXT_H
|
||||
|
||||
#include <pandabase.h>
|
||||
|
||||
//#define DO_CUSTOM_CONVERSIONS
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#ifndef STRICT
|
||||
// enable strict type checking in windows.h, see msdn
|
||||
#define STRICT
|
||||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
#include <ddraw.h>
|
||||
|
||||
#define D3D_OVERLOADS // get D3DVECTOR '+' operator, etc from d3dtypes.h
|
||||
#include <d3d8.h>
|
||||
#include <d3dx8.h>
|
||||
#include <dxerr8.h>
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
|
||||
|
||||
#ifndef D3DERRORSTRING
|
||||
#define D3DERRORSTRING(HRESULT) " at (" << __FILE__ << ":" << __LINE__ << "), hr=" << DXGetErrorString8(HRESULT) << ": " << DXGetErrorDescription8(HRESULT) << endl
|
||||
#endif
|
||||
|
||||
#include "dxgsg8base.h"
|
||||
#include <texture.h>
|
||||
#include <textureContext.h>
|
||||
|
||||
typedef struct {
|
||||
LPDIRECT3DDEVICE8 pD3DDevice;
|
||||
LPDIRECT3D8 pD3D8;
|
||||
HWND hWnd;
|
||||
HMONITOR hMon;
|
||||
RECT view_rect,clip_rect;
|
||||
DWORD MaxAvailVidMem;
|
||||
bool bIsLowVidMemCard;
|
||||
bool bIsTNLDevice;
|
||||
bool bIsDX81;
|
||||
ushort depth_buffer_bitdepth; //GetSurfaceDesc is not reliable so must store this explicitly
|
||||
ushort CardIDNum; // adapter ID
|
||||
DWORD dwSupportedScreenDepthsMask;
|
||||
DWORD SupportedTexFmtsMask;
|
||||
D3DCAPS8 d3dcaps;
|
||||
D3DDISPLAYMODE DisplayMode;
|
||||
D3DPRESENT_PARAMETERS PresParams; // not redundant with DisplayMode since width/height must be 0 for windowed mode
|
||||
D3DADAPTER_IDENTIFIER8 DXDeviceID;
|
||||
} DXScreenData;
|
||||
//#define DO_CUSTOM_CONVERSIONS
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : DXTextureContext
|
||||
|
|
|
|||
|
|
@ -0,0 +1,159 @@
|
|||
// Filename: dxTextureContext.h
|
||||
// Created by: drose (07Oct99)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://www.panda3d.org/license.txt .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d@yahoogroups.com .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef DXGSG8BASE_H
|
||||
#define DXGSG8BASE_H
|
||||
|
||||
#include <pandabase.h>
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // get rid of mfc win32 hdr stuff
|
||||
#ifndef STRICT
|
||||
// enable strict type checking in windows.h, see msdn
|
||||
#define STRICT
|
||||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
#include <ddraw.h>
|
||||
|
||||
#define D3D_OVERLOADS // get D3DVECTOR '+' operator, etc from d3dtypes.h
|
||||
#include <d3d8.h>
|
||||
#include <d3dx8.h>
|
||||
#include <dxerr8.h>
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
|
||||
#ifndef D3DERRORSTRING
|
||||
#define D3DERRORSTRING(HRESULT) " at (" << __FILE__ << ":" << __LINE__ << "), hr=" << DXGetErrorString8(HRESULT) << ": " << DXGetErrorDescription8(HRESULT) << endl
|
||||
#endif
|
||||
|
||||
#define ISPOW2(X) (((X) & ((X)-1))==0)
|
||||
|
||||
#define DX_DECLARE_CLEAN(type, var) \
|
||||
type var; \
|
||||
ZeroMemory(&var, sizeof(type)); \
|
||||
var.dwSize = sizeof(type);
|
||||
|
||||
#define SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } }
|
||||
#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=NULL; } }
|
||||
|
||||
// this is bDoDownToZero argument to RELEASE()
|
||||
#define RELEASE_DOWN_TO_ZERO true
|
||||
#define RELEASE_ONCE false
|
||||
|
||||
// #define DEBUG_RELEASES
|
||||
|
||||
#ifdef DEBUG_RELEASES
|
||||
#define RELEASE(OBJECT,MODULE,DBGSTR,bDoDownToZero) \
|
||||
if(((OBJECT)!=NULL)&&(!IsBadWritePtr((OBJECT),4))) { \
|
||||
refcnt = (OBJECT)->Release(); \
|
||||
MODULE##_cat.debug() << DBGSTR << " released, refcnt = " << refcnt << endl; \
|
||||
if((bDoDownToZero) && (refcnt>0)) { \
|
||||
MODULE##_cat.warning() << DBGSTR << " released but still has a non-zero refcnt(" << refcnt << "), multi-releasing it down to zero!\n"; \
|
||||
do { \
|
||||
refcnt = (OBJECT)->Release(); \
|
||||
} while(refcnt>0); \
|
||||
} \
|
||||
(OBJECT) = NULL; \
|
||||
} else { \
|
||||
MODULE##_cat.debug() << DBGSTR << " not released, ptr == NULL" << endl; \
|
||||
}
|
||||
|
||||
#define PRINTREFCNT(OBJECT,STR) { (OBJECT)->AddRef(); dxgsg_cat.debug() << STR << " refcnt = " << (OBJECT)->Release() << endl; }
|
||||
#else
|
||||
#define RELEASE(OBJECT,MODULE,DBGSTR,bDoDownToZero) \
|
||||
if(((OBJECT)!=NULL)&&(!IsBadWritePtr((OBJECT),4))) { \
|
||||
refcnt=(OBJECT)->Release(); \
|
||||
if((bDoDownToZero) && (refcnt>0)) { \
|
||||
MODULE##_cat.warning() << DBGSTR << " released but still has a non-zero refcnt(" << refcnt << "), multi-releasing it down to zero!\n"; \
|
||||
do { \
|
||||
refcnt = (OBJECT)->Release(); \
|
||||
} while(refcnt>0); \
|
||||
} \
|
||||
(OBJECT) = NULL; \
|
||||
}
|
||||
|
||||
#define PRINTREFCNT(OBJECT,STR)
|
||||
#endif
|
||||
|
||||
#ifdef DO_PSTATS
|
||||
#define DO_PSTATS_STUFF(XX) XX;
|
||||
#else
|
||||
#define DO_PSTATS_STUFF(XX)
|
||||
#endif
|
||||
|
||||
#define FLG(NN) (1<<NN)
|
||||
#define MAX_POSSIBLE_TEXFMTS 32
|
||||
typedef enum {
|
||||
R8G8B8_FLAG = FLG(0),
|
||||
A8R8G8B8_FLAG = FLG(1),
|
||||
X8R8G8B8_FLAG = FLG(2),
|
||||
R5G6B5_FLAG = FLG(3),
|
||||
X1R5G5B5_FLAG = FLG(4),
|
||||
A1R5G5B5_FLAG = FLG(5),
|
||||
A4R4G4B4_FLAG = FLG(6),
|
||||
R3G3B2_FLAG = FLG(7),
|
||||
A8_FLAG = FLG(8),
|
||||
A8R3G3B2_FLAG = FLG(9),
|
||||
X4R4G4B4_FLAG = FLG(10),
|
||||
A2B10G10R10_FLAG = FLG(12),
|
||||
// G16R16_FLAG = FLG(13), leaving this 1 out to fit in 32 bits
|
||||
A8P8_FLAG = FLG(13),
|
||||
P8_FLAG = FLG(14),
|
||||
L8_FLAG = FLG(15),
|
||||
A8L8_FLAG = FLG(16),
|
||||
A4L4_FLAG = FLG(17),
|
||||
V8U8_FLAG = FLG(18),
|
||||
L6V5U5_FLAG = FLG(19),
|
||||
X8L8V8U8_FLAG = FLG(20),
|
||||
Q8W8V8U8_FLAG = FLG(21),
|
||||
V16U16_FLAG = FLG(22),
|
||||
W11V11U10_FLAG = FLG(23),
|
||||
A2W10V10U10_FLAG = FLG(24),
|
||||
UYVY_FLAG = FLG(25),
|
||||
YUY2_FLAG = FLG(26),
|
||||
DXT1_FLAG = FLG(27),
|
||||
DXT2_FLAG = FLG(28),
|
||||
DXT3_FLAG = FLG(29),
|
||||
DXT4_FLAG = FLG(30),
|
||||
DXT5_FLAG = FLG(31)
|
||||
} D3DFORMAT_FLAG;
|
||||
|
||||
#define IS_16BPP_FORMAT(FMT) (((FMT)>=D3DFMT_R5G6B5)&&((FMT)<=D3DFMT_A1R5G5B5))
|
||||
#define IS_STENCIL_FORMAT(FMT) (((FMT)==D3DFMT_D24S8) || ((FMT)==D3DFMT_D15S1) || ((FMT)==D3DFMT_D24X4S4))
|
||||
|
||||
typedef struct {
|
||||
LPDIRECT3DDEVICE8 pD3DDevice;
|
||||
LPDIRECT3D8 pD3D8;
|
||||
HWND hWnd;
|
||||
HMONITOR hMon;
|
||||
RECT view_rect,clip_rect;
|
||||
DWORD MaxAvailVidMem;
|
||||
bool bIsLowVidMemCard;
|
||||
bool bIsTNLDevice;
|
||||
bool bIsDX81;
|
||||
ushort depth_buffer_bitdepth; //GetSurfaceDesc is not reliable so must store this explicitly
|
||||
ushort CardIDNum; // adapter ID
|
||||
DWORD dwSupportedScreenDepthsMask;
|
||||
DWORD SupportedTexFmtsMask;
|
||||
D3DCAPS8 d3dcaps;
|
||||
D3DDISPLAYMODE DisplayMode;
|
||||
D3DPRESENT_PARAMETERS PresParams; // not redundant with DisplayMode since width/height must be 0 for windowed mode
|
||||
D3DADAPTER_IDENTIFIER8 DXDeviceID;
|
||||
} DXScreenData;
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue