游戏开发论坛

 找回密码
 立即注册
搜索
查看: 3800|回复: 11

farcry部分代码,出售。有诚意的请进

[复制链接]

3

主题

14

帖子

14

积分

新手上路

Rank: 1

积分
14
发表于 2004-11-5 14:10:00 | 显示全部楼层 |阅读模式
属某地政府出资引进。提供详细证据证明决非虚假。
关键部分每块最低5位数价格。
大家应该都知道引擎采用的是目前最先进的技术啦。如sm3.0,hdr.性价比同2002年的unrealengine2相比不用我说了吧。
仅供个人学习,以促进中国游戏开发水平,严禁用于商业目的!
请不要故意捣乱。
qq:362982728
代码数量庞大。13个模块。带详细的注解(请看2)
CrySystem
Cry3DEngine
XRender
CryScriptSystem
CrySoundSystem
CryNetworkSystem
CryInputSystem
CryEntitySystem
CryAISystem
CryGame
CryPhysics
CryAnimation
CryConfig

以下贴出一点:
1,此XrenderD3D接口。因为属关键部分,注释和部分行删去
class CryXDeviceD3d : public  CryDevice  {

   
  static    EGxTexFormat stolerableTexFmtMapping[8];
  static    D3DFORMAT sGxTexFmtToD3dFmt[8];
  static    EGxTexFormat sGxTexFmtToUse[8];
  static    D3DCUBEMAPFACES sd3dCubeMapFaces[6];
  static    D3DFORMAT sGxFormatToD3dFormat[8];
  static    CryDeviceD3d* mthisDevice;

   
    struct HWND* mhwnd;
    unsigned short mhwndClass;
    int mownhwnd;
    struct HINSTANCE* md3dLib;
    struct IDirect3D9* md3d;
    struct IDirect3DDevice9* md3dDevice;
    struct D3DCAPS9 md3dCaps;
    int md3dIsHwDevice;
    int md3dNeedsReset;
    class CVertexBufferList mVBL[4][9];
    class CryIndexBufferD3d* mIB[4][9];
    class CryVertexBufferD3d* mvertexBuffer;
    enum EGxPrim mprimType;
    unsigned int mprimIndexCount;;
    int mprocessedIndexPtrs;
    int mwindowVisible;
    struct D3DDISPLAYMODE mdesktopDisplayMode;
    int mdeviceSupports32BitTextures;
    int minScene;
    enum D3DFORMAT mdevDepthFormat;
    enum D3DFORMAT mdevAdapterFormat;
    struct IDirect3DSurface9* mrttDepthSurface;
    struct IDirect3DSurface9* mdefColorSurface;
    struct IDirect3DSurface9* mdefDepthSurface;
    struct CryDeviceD3d::StateD3dLight md3dStatesLight[8];
    unsigned long mdeviceState[34];
    unsigned char mtexEnable[4];

  

  static class CryDeviceD3d*  GetDevice();
  static int  CryDeviceD3d::ILoadD3dLib(  struct HINSTANCE*& d3dLib,   struct IDirect3D9*& d3d);
  static void  CryDeviceD3d::IUnloadD3dLib(  struct HINSTANCE*& d3dLib,   struct IDirect3D9*& d3d);
  static long  CryDeviceD3d::WindowProcD3d(  struct HWND* hWnd,   unsigned int uMsg,   unsigned int wParam,   long lParam);

   
  void  CryDeviceD3d::CryDeviceD3d();
  void  CryDeviceD3d(class CryDeviceD3d&);
  class CryDeviceD3d&  operator=(class CryDeviceD3d&);
  enum D3DFORMAT  IDepthStencilBitsToFormat(unsigned int, unsigned int);
  enum D3DFORMAT  IColorAlphaBitsToFormat(unsigned int, unsigned int);
  int  CryDeviceD3d::ICreateD3d();
  void  CryDeviceD3d::IDestroyD3d();
  int  CryDeviceD3d::ICreateD3dDevice(  struct CryFormat& format);
  void  CryDeviceD3d::IDestroyD3dDevice();
  void  CryDeviceD3d::ISetPresentParms(  struct D3DPRESENTPARAMETERS& d3dpp,   struct CryFormat& format);
  void  CryDeviceD3d::IReleaseD3dResources(  int freeTextures);
  void  CryDeviceD3d::IPrimSetupPos(  void* dstBuf);
  int  CryDeviceD3d::IAllocBuffers();
  void  CryDeviceD3d::ICreateBuffers(  enum EGxVertexBufferFormat vbFormat,   unsigned int numVertices,   class CVertexBufferList& vbl,   unsigned int numIndices,   class CryIndexBufferD3d*& ib);
  void  CryDeviceD3d::ICreateD3dVB(  enum EGxVertexBufferFormat format,   unsigned int& numVertices,   struct IDirect3DVertexBuffer9*& vb);
  void  CryDeviceD3d::ICreateD3dIB(  unsigned int& numIndices,   struct IDirect3DIndexBuffer9*& ib);
  void  CryDeviceD3d::IReleaseD3dVB(  struct IDirect3DVertexBuffer9*& vb);
  void  CryDeviceD3d::IReleaseD3dIB(  struct IDirect3DIndexBuffer9*& ib);
  void  CryDeviceD3d::IStateSync();
  void  CryDeviceD3d::IStateSyncLights();

  void  CryDeviceD3d::ISetLight(  unsigned long which,   struct D3DLIGHT9& value,   int enabled);
  void  CryDeviceD3d::IForceLights();
  void  CryDeviceD3d::ITexForceRecreation(  int freeTextures);
  void  CryDeviceD3d::IShaderForceRecreation(  int freeShaders);
  void  CryDeviceD3d::ISceneBegin(  unsigned int mask);
  void  CryDeviceD3d::ISceneEnd();
  void  CryDeviceD3d::IBufSetBuffers(  class CryBufD3d* buf);
  int  CryDeviceD3d::ICheckTextureFormat(  unsigned long usage,   enum D3DFORMAT textureFormat);
  void  CryDeviceD3d::ISetCaps();
  void  CryDeviceD3d::ISetTexture(  unsigned int tmu,   class CryTex* tex);
  void  CryDeviceD3d::ISetTexGen(  unsigned int tmu,   enum EGxTexGen texGen);
  void  CryDeviceD3d::ISetTexLodBias(  unsigned int tmu,   float bias);
  void  CryDeviceD3d::ISetTexBlend(  unsigned int tmu,   enum EGxTexBlend blend);
  void  CryDeviceD3d::ITexCreate(  class CryTex* gxTex,   unsigned int w,   unsigned int h,   unsigned int startLevel,   unsigned int endLevel);
  void  CryDeviceD3d::ITexUpload(  class CryTex* texId,   unsigned int w,   unsigned int h,   unsigned int startLevel,   unsigned int endLevel);
  void  CryDeviceD3d::IXformSetWorld();
    void  CryDeviceD3d::IBindVertexShader(  class CryVertexShader* vs);
  void  CryDeviceD3d::IPixelShaderCreate(  class CryPixelShader* ps);
  void  CryDeviceD3d:sSet(  enum CryDeviceD3d::EDeviceState state,   unsigned long val);
  unsigned long  DsGet(enum CryDeviceD3d::EDeviceState);
  
   
  virtual  void  CryDeviceD3d::ITexMarkAsUpdated(  class CryTex* texId);
  virtual  void  CryDeviceD3d::ISetShaderParamList(  class TSExplicitList<CryShaderParam,108>& params,   int forceForBind);
  virtual  void  CryDeviceD3d::~CryDeviceD3d();
  virtual  int  CryDeviceD3d::DeviceCreate(  unsigned int hwnd,   struct CryFormat& format);
  virtual  int  CryDeviceD3d::DeviceCreate(  long  (windowProc*)(void*, unsigned int, unsigned int, long),   struct CryFormat& format);
  virtual  void  CryDeviceD3d::DeviceDestroy();
  virtual  int  CryDeviceD3d::DeviceSetFormat(  struct CryFormat& format);
  virtual  void  CryDeviceD3d::DeviceSetBaseMipLevel(  unsigned int baseMipLevel);
  virtual  void  CryDeviceD3d::DeviceSetGamma(  struct CryGammaRamp& ramp);
  virtual  void  CryDeviceD3d::DeviceSetGamma(  float gamma);
  virtual  void  CryDeviceD3d::DeviceSetTextureQuality(  int force32);
  virtual  unsigned long  CryDeviceD3d::DeviceWindow();
  virtual  void  CryDeviceD3d::DeviceReadPixels(  class CiRect& rect,   class TSGrowableArray<CImVector>& pixels);
  virtual  void  CryDeviceD3d::DeviceReadDepths(  class CiRect& rect,   class TSGrowableArray<float>& depths);
  virtual  void  CryDeviceD3d::DeviceWM(  enum EGxWM wm,   long param1,   long param2);
  virtual  void  CryDeviceD3d::DeviceSetRenderTarget(  enum EGxBuffer buffer,   class CryTex* gxTex,   unsigned int plane);
  virtual  void  CryDeviceD3d::DeviceOverride(  enum EGxOverride override,   unsigned long value);
  virtual  void  CryDeviceD3d::CapsWindowSize(  class CRect& dst);
    virtual  void  CryDeviceD3d::XformSetProjection(  class C44Matrix& matrix);
  virtual  void  CryDeviceD3d::XformSetView(  class C44Matrix& matrix);
  virtual  void  CryDeviceD3d:rimLockAndProcessVertexPtrs(  unsigned int vertexCount,   class C3Vector* pos,   unsigned int posStride,   class C3Vector* normal,   unsigned int normalStride,   class CImVector* color,   unsigned int colorStride,   unsigned char* bone,   unsigned int boneStride,   class C2Vector* tex0,   unsigned int tex0Stride,   class C2Vector* tex1,   unsigned int tex1Stride);
  virtual  void  CryDeviceD3d::PrimDrawElements();
    virtual  void  CryDeviceD3d::BufLock(  struct CryBuf* b);
  virtual  void  CryDeviceD3d::BufRender(  struct CryBatch* batches,   unsigned int count);
  virtual  void  CryDeviceD3d::BufUnlock();
  virtual  void  CryDeviceD3d::BufDestroy(  struct CryBuf*& b);
  virtual  void  CryDeviceD3d::BufReserve(  enum EGxBufWriteFreq freq,   enum EGxVertexBufferFormat format,   unsigned int numVertices,   unsigned int numIndices);
  virtual  int  CryDeviceD3d::TexCreate(  enum EGxTexTarget target,   unsigned int width,   unsigned int height,   unsigned int depth,   enum EGxTexFormat format,   enum EGxTexFormat dataFormat,   struct CryTexFlags flags,   void* userArg,   void  (userFunc*)(enum EGxTexCommand, unsigned int, unsigned int, unsigned int, unsigned int, void*, unsigned int&, void*&),   class CryTex*& texId);
  enum EGxTexCommand, unsigned int, unsigned int, unsigned int, unsigned int, void*, unsigned int&, void*&),   class CryTex*& texId);
  virtual  void  CryDeviceD3d::TexDestroy(  class CryTex* texId);
  virtual  void  CryDeviceD3d::PixelShaderCreate(  class CryPixelShader*& ps,   char* filename);
  virtual  void  CryDeviceD3d::PixelShaderDestroy(  class CryPixelShader*& ps);
};


2,
class CryBoneDesc: public CryBoneDescData
{
public:
        CryBoneDesc ();
        ~CryBoneDesc ();

        // returns the bone name, if available
        const char* getNameCStr()const;
        const string& getName()const;

        unsigned getControllerId()const {return m_nControllerID;}

        // sets the name of the bone out of the given buffer of the given max size
        void setName (const char* szName);

        unsigned numChildren ()const {return m_numChildren;}
        bool hasParent() const {return m_nOffsetParent != 0;}
        int getParentIndexOffset()const {return m_nOffsetParent;}
        int getFirstChildIndexOffset() const {return m_nOffsetChildren;}

        const Matrix44& getInvDefGlobal() const {return m_matInvDefGlobal;}
        void setDefaultGlobal(const Matrix44& mxDefault);
        int getLimbId () const {return m_nLimbId;}

        BONE_PHYSICS& getPhysInfo (int nLod) {return m_PhysInfo[nLod];}

        // updates this bone physics, from the given entity descriptor, and of the given lod
        void UpdatePhysics (const BONE_ENTITY& entity, int nLod);
        void setPhysics (int nLod, const BONE_PHYSICS& BonePhysics)
        {
                assert (nLod >= 0 && nLod < sizeof(m_PhysInfo)/sizeof(m_PhysInfo[0]));
                m_PhysInfo[nLod] = BonePhysics;
        }
        // the physics for the given LOD is not available
        void resetPhysics (int nLod)
        {
                assert (nLod >= 0 && nLod < sizeof(m_PhysInfo)/sizeof(m_PhysInfo[0]));
                memset (&m_PhysInfo[nLod], 0, sizeof(m_PhysInfo[nLod]));
        }
        const BONE_PHYSICS& getPhysics (int nLod)const
        {
                assert (nLod >= 0 && nLod < sizeof(m_PhysInfo)/sizeof(m_PhysInfo[0]));
                return m_PhysInfo[nLod];
        }

        // Returns the id of the bone mesh chunk from which the bone physical geometry
        // should be taken. The caller should take this id, find the corresponding chunk in the CCG/CGF file
        // and construct physical geometry using IGeomManager::CreateMesh.
        // Then, register it with RegisterGeometry(). It will return phys_geometry* that the caller
        // should put into the corresponding LOD m_PhysInfo.pPhysGeom
        // CryBoneInfo::PostInitPhysGeom uses this same id to find the physical geometry in the map
        INT_PTR getPhysGeomId (unsigned nLOD) {return (INT_PTR)m_PhysInfo[nLOD].pPhysGeom;}

        // compares two bone descriptions and returns true if they're the same bone
        // (the same name and the same position in the hierarchy)
        bool isEqual(const CryBoneDesc& desc)const;

        // Serializes the description:
        // returns the number of required bytes for serialization, if the data pointer is NULL
        // returns 0 (if the buffer size is not enough) or the number of bytes written, if the data pointer is given
        unsigned Serialize (bool bSave, void *pStream, unsigned nSize);

        // scales the bone with the given multiplier
        void scale (float fScale);

protected:

        // loads the bone from a raw chunk data (no header)
        // returns false if the bone couldn't be loaded
        bool LoadRaw (const BONE_ENTITY* pEntity);

        //! Performs post-initialization. This step is requred to initialize the pPhysGeom of the bones
        //! After the bone has been loaded but before it is first used. When the bone is first loaded, pPhysGeom
        //! is set to the value equal to the chunk id in the file where the physical geometry (BoneMesh) chunk is kept.
        //! After those chunks are loaded, and chunk ids are mapped to the registered physical geometry objects,
        //! call this function to replace pPhysGeom chunk ids with the actual physical geometry object pointers.
        //!        NOTE:
        //!        The entries of the map that were used are deleted
        typedef std::map<INT_PTR, struct phys_geometry*> ChunkIdToPhysGeomMap;
        bool PostInitPhysGeom (ChunkIdToPhysGeomMap& mapChunkIdToPhysGeom, int nLodLevel);

        friend class CryBoneHierarchyLoader;

protected:
        string m_strName;
};

#endif

41

主题

340

帖子

345

积分

中级会员

Rank: 3Rank: 3

积分
345
发表于 2004-11-5 14:36:00 | 显示全部楼层

Re:farcry部分代码,出售。有诚意的请进

没有授权的源码,单位能买吗?如果是为了学习,谁又会自己花这么多钱?HL2的源码已经足够学习了!

30

主题

398

帖子

403

积分

中级会员

Rank: 3Rank: 3

积分
403
QQ
发表于 2004-11-5 15:03:00 | 显示全部楼层

Re:farcry部分代码,出售。有诚意的请进

此处有人非法经营,请站长开刀.

3

主题

14

帖子

14

积分

新手上路

Rank: 1

积分
14
 楼主| 发表于 2004-11-5 18:02:00 | 显示全部楼层

Re: Re:farcry部分代码,出售。有诚意的请进

netcat: Re:farcry部分代码,出售。有诚意的请进

没有授权的源码,单位能买吗?如果是为了学习,谁又会自己花这么多钱?HL2的源码已经足够学习了!


我主要想买给各个公司的开发人员。我认识的人月薪都在7,8000以上。你说买不起吗。这算是是一种个人技术提高的投资。
hl2代码也不错,不过我给大家多一种选择。大家可能习惯得到免费的东西。但是有价值的东西还是不会白送的。好比书本。

如果还是学生或者并不是专业人员。这不是你现在要做的事情。

30

主题

398

帖子

403

积分

中级会员

Rank: 3Rank: 3

积分
403
QQ
发表于 2004-11-5 19:53:00 | 显示全部楼层

Re: Re: Re:farcry部分代码,出售。有诚意的请进

鲍鱼饭: Re: Re:farcry部分代码,出售。有诚意的请进



我主要想买给各个公司的开发人员。我认识的人月薪都在7,8000以上。你说买不起吗。这算是是一种个人技术...


我以吃不到葡萄的心态说一句::::你是社会的蛀虫!

哇,哈哈哈哈哈,,真爽!!

139

主题

2005

帖子

2057

积分

金牌会员

Rank: 6Rank: 6

积分
2057
QQ
发表于 2004-11-5 20:05:00 | 显示全部楼层

Re:farcry部分代码,出售。有诚意的请进

删。一个字。

32

主题

543

帖子

543

积分

高级会员

Rank: 4

积分
543
发表于 2004-11-6 13:44:00 | 显示全部楼层

Re: Re:farcry部分代码,出售。有诚意的请进

♂樱♀: Re:farcry部分代码,出售。有诚意的请进

删。一个字。

同意樱兄说法. [em16]

89

主题

4036

帖子

4132

积分

论坛元老

Rank: 8Rank: 8

积分
4132
发表于 2004-11-6 20:08:00 | 显示全部楼层

Re:farcry部分代码,出售。有诚意的请进

强烈要求 sea_bug让我当斑竹,
强烈要求 sea_bug让我当斑竹
强烈要求 sea_bug让我当斑竹
强烈要求 sea_bug让我当斑竹
强烈要求 sea_bug让我当斑竹
强烈要求 sea_bug让我当斑竹
强烈要求 sea_bug让我当斑竹

这里烂帖子太多了。要删!!!!!!!!!!!!!!!!!!!!!!!

8

主题

553

帖子

560

积分

高级会员

Rank: 4

积分
560
发表于 2004-11-6 21:12:00 | 显示全部楼层

Re:farcry部分代码,出售。有诚意的请进

楼主只有两种可能,1是骗子,2是在销赃。

3

主题

14

帖子

14

积分

新手上路

Rank: 1

积分
14
 楼主| 发表于 2004-11-10 19:18:00 | 显示全部楼层

Re:farcry部分代码,出售。有诚意的请进

自己定一下。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2025-12-23 07:20

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表