소스 검색

another pre-working save

cxgeorge 24 년 전
부모
커밋
6cdf757749
4개의 변경된 파일237개의 추가작업 그리고 235개의 파일을 삭제
  1. 19 0
      panda/src/dxgsg8/dxGraphicsStateGuardian8.I
  2. 211 217
      panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx
  3. 5 18
      panda/src/dxgsg8/dxGraphicsStateGuardian8.h
  4. 2 0
      panda/src/dxgsg8/dxgsg8base.h

+ 19 - 0
panda/src/dxgsg8/dxGraphicsStateGuardian8.I

@@ -196,6 +196,25 @@ enable_fog(bool val) {
   }
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: DXGraphicsStateGuardian::set_vertex_format
+//       Access:
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE void DXGraphicsStateGuardian::
+set_vertex_format(DWORD NewFvfType) {
+  if (_CurFVFType != NewFvfType) {
+    _CurFVFType = NewFvfType;
+    HRESULT hr = scrn.pD3DDevice->SetVertexShader(NewFvfType);
+ #ifndef NDEBUG
+    if(FAILED(hr)) {
+           dxgsg_cat.error() << "SetVertexShader(0x" << (void*)NewFvfType<<") failed, hr = " << D3DERRORSTRING(hr);
+           exit(1);
+    }
+ #endif
+  }
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: DXGraphicsStateGuardian::enable_alpha_test
 //       Access:

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 211 - 217
panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx


+ 5 - 18
panda/src/dxgsg8/dxGraphicsStateGuardian8.h

@@ -180,7 +180,6 @@ public:
 
 public:
   // recreate_tex_callback needs these to be public
-//  LPDIRECT3DDEVICE7 _pCurD3DDevice;  //this needs to be set every device iteration
   DXScreenData scrn;
 
 protected:
@@ -193,8 +192,9 @@ protected:
   void set_draw_buffer(const RenderBuffer &rb);
   void set_read_buffer(const RenderBuffer &rb);
 
+  DWORD _CurFVFType;
   // for storage of the flexible vertex format
-  char *_pCurFvfBufPtr,*_pFvfBufBasePtr;
+  BYTE *_pCurFvfBufPtr,*_pFvfBufBasePtr;
   INLINE void add_to_FVFBuf(void *data,  size_t bytes) ;
   WORD *_index_buf;  // base of malloced array
 
@@ -211,9 +211,9 @@ protected:
 
   void GenerateSphere(void *pVertexSpace,DWORD dwVertSpaceByteSize,
                     void *pIndexSpace,DWORD dwIndexSpaceByteSize,
-                    D3DVECTOR *pCenter, float fRadius,
+                    D3DXVECTOR3 *pCenter, float fRadius,
                     DWORD wNumRings, DWORD wNumSections, float sx, float sy, float sz,
-                    DWORD *pNumVertices,DWORD *pNumIndices,DWORD fvfFlags,DWORD dwVertSize);
+                    DWORD *pNumVertices,DWORD *pNumTris,DWORD fvfFlags,DWORD dwVertSize);
   HRESULT RestoreAllVideoSurfaces(void);
   HRESULT RecreateAllVideoSurfaces(void);
   HRESULT DeleteAllVideoSurfaces(void);
@@ -229,6 +229,7 @@ protected:
   INLINE void enable_fog(bool val);
   INLINE void enable_zwritemask(bool val);
   INLINE void enable_gouraud_shading(bool val);
+  INLINE void set_vertex_format(DWORD NewFvfType);
 
   INLINE D3DTEXTUREADDRESS get_texture_wrap_mode(Texture::WrapMode wm) const;
   INLINE D3DCMPFUNC get_depth_func_type(DepthTestProperty::Mode m) const;
@@ -388,13 +389,6 @@ public:
   static void init_type(void);
   virtual TypeHandle get_type(void) const;
   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
-/*
-  LPDIRECT3DDEVICE7 GetD3DDevice()  {  return scrn.pD3DDevice; }
-  LPDIRECTDRAW7 GetDDInterface()  {  return scrn.pDD; }
-  LPDIRECTDRAWSURFACE7 GetBackBuffer()  {  return scrn.pddsBackBuffer; }
-  LPDIRECTDRAWSURFACE7 GetZBuffer()  {  return _zbuf; }
-*/  
-//  INLINE void Set_HDC(HDC hdc)  {  _front_hdc = hdc;  }
   void adjust_view_rect(int x, int y);
   INLINE void SetDXReady(bool stat)  {  _dx_ready = stat; }
   INLINE bool GetDXReady(void)  { return _dx_ready;}
@@ -409,13 +403,6 @@ public:
   void  show_frame();
   void  show_full_screen_frame();
   void  show_windowed_frame();
-/*  void  dx_init(  LPDIRECTDRAW7     context,
-          LPDIRECTDRAWSURFACE7  pri,
-          LPDIRECTDRAWSURFACE7  back,
-          LPDIRECTDRAWSURFACE7  zbuf,
-          LPDIRECT3D7          d3d,
-          LPDIRECT3DDEVICE7    d3dDevice,
-          RECT  viewrect); */
   void dx_init(void);
   
 private:

+ 2 - 0
panda/src/dxgsg8/dxgsg8base.h

@@ -95,6 +95,8 @@
 #define DO_PSTATS_STUFF(XX)
 #endif
 
+#define PANDA_MAXNUMVERTS 0xFFFF  // Note Device may support more than this if it supports D3DFMT_INDEX32 indexbufs.
+
 #define FLG(NN) (1<<NN)
 #define MAX_POSSIBLE_TEXFMTS 32
 typedef enum {

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.