├── LICENSE ├── README.md ├── bigimage ├── accumulateaction.h ├── action.h ├── bigimageinterface.h ├── boxgeometry.h ├── camera.h ├── circlegeometry.h ├── colorscene.h ├── directionallight.h ├── directionlightscene.h ├── flycameracontrol.h ├── gamemodel.h ├── gamemodelmanager.h ├── gameobject.h ├── geometry.h ├── geometrygameobject.h ├── light.h ├── orbitcontrols.h ├── panelgeometry.h ├── perspectivecamera.h ├── renderitem.h ├── renderitemmanager.h ├── ringgeometry.h ├── scene.h ├── shadowmaterial.h ├── skybox.h ├── spheregeometry.h ├── springaction.h ├── standardmaterial.h ├── teapotgeometry.h ├── terrainmaterial.h ├── transformcamera.h ├── water.h ├── watermaterial.h ├── wfxgamemodel.h ├── wfxgamemodelmanager.h ├── wfxgameobject.h ├── wfxgameobjectmanager.h ├── wfxgameparticlemanager.h ├── wfxgameparticlematerial.h └── wfxstanardmaterial.h ├── bignumber ├── bigcalculate.h ├── bignumber.h ├── bignumberconfig.h ├── comparenumber.h ├── double.h ├── identifynumber.h └── int64.h ├── cjson └── cJSON.h ├── debug ├── bigimage.lib ├── bignumber.lib ├── cjson.lib ├── espeak.lib ├── espeak.pdb ├── fcsimulator.lib ├── grey.lib ├── lua.lib ├── nanopb.lib ├── standard.lib ├── standard.pdb └── stb.lib ├── espeak ├── debug.h ├── espeak.h ├── espeak_command.h ├── event.h ├── fifo.h ├── klatt.h ├── phoneme.h ├── sintab.h ├── sonic.h ├── speak_lib.h ├── speech.h ├── stdint.h ├── synthesize.h ├── translate.h ├── voice.h └── wave.h ├── fcsimulator ├── cpu.h ├── graphic.h ├── keyboard.h ├── mappers.h ├── nes.h ├── papu.h ├── ppu.h ├── rom.h ├── ui.h └── utils.h ├── include ├── apps.h ├── assert.h ├── coroutine.h ├── cpp.h ├── ctype.h ├── datastream.h ├── debug.h ├── delegate.h ├── errno.h ├── float.h ├── limits.h ├── locale.h ├── material.h ├── math.h ├── oop.h ├── opengl.h ├── renderer.h ├── setjmp.h ├── signal.h ├── sound.h ├── stdarg.h ├── stddef.h ├── stdio.h ├── stdlib.h ├── stdtype.h ├── string.h ├── texture.h ├── time.h ├── tools.h ├── ui.h └── xml.h ├── lib ├── bigimage.asl ├── bignumber.asl ├── cjson.asl ├── drive.asm ├── espeak.asl ├── fcsimulator.asl ├── lua.asl ├── nanopb.asl ├── standard.asl └── stb.asl ├── lua ├── lapi.h ├── lauxlib.h ├── lcode.h ├── lctype.h ├── ldebug.h ├── ldo.h ├── lfunc.h ├── lgc.h ├── llex.h ├── llimits.h ├── lmem.h ├── lobject.h ├── lopcodes.h ├── lparser.h ├── lprefix.h ├── lstate.h ├── lstring.h ├── ltable.h ├── ltm.h ├── lua.h ├── luaconf.h ├── lualib.h ├── lundump.h ├── lvm.h └── lzio.h ├── nanopb ├── pb.h ├── pb_common.h ├── pb_decode.h └── pb_encode.h ├── standard ├── allocator.h ├── applite.h ├── color.h ├── csv.h ├── delegate.h ├── dialogs.h ├── filewriter.h ├── flatmaterial.h ├── gc.h ├── gui.h ├── horizontallistview.h ├── hotkey.h ├── httprequest.h ├── interpolator.h ├── layout.h ├── list.h ├── log.h ├── lymfile.h ├── map.h ├── material.h ├── math.h ├── matrix3.h ├── matrix4.h ├── notification.h ├── plane.h ├── planematerial.h ├── popmenu.h ├── quaternion.h ├── quicksort.h ├── raycaster.h ├── reference.h ├── remotefiletask.h ├── renderbuffer.h ├── resourcemanager.h ├── safedata.h ├── scrolledpanel.h ├── set.h ├── sortlist.h ├── spherical.h ├── stream.h ├── string.h ├── system.h ├── tabpanel.h ├── task.h ├── taskmanager.h ├── texture.h ├── texturebuffer.h ├── texturefile.h ├── texturepack.h ├── texturetarget.h ├── toast.h ├── trace.h ├── translatematerial.h ├── treeview.h ├── vector.h ├── vector2.h ├── vector3.h ├── vector4.h ├── wordfilter.h └── xml.h ├── stb ├── stb_image_write.h └── stbimage.h ├── tcgraphic └── graphic.h └── 添加环境变量.bat /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 grey-platform 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/README.md -------------------------------------------------------------------------------- /bigimage/accumulateaction.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/bigimage/accumulateaction.h -------------------------------------------------------------------------------- /bigimage/action.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: action.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | #ifndef __BIGIMAGE_ACTION_H__ 15 | #define __BIGIMAGE_ACTION_H__ 16 | 17 | #include 18 | 19 | class CAction{ 20 | public: 21 | CAction(); 22 | virtual ~CAction(); 23 | virtual int32 Update( float fDelta ); 24 | }; 25 | 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /bigimage/boxgeometry.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: boxgeometry.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_BOXGEOMETRY_H__ 16 | #define __BIGIMAGE_BOXGEOMETRY_H__ 17 | 18 | #include 19 | 20 | class CBoxGeometry: public CGeometry{ 21 | public: 22 | CBoxGeometry( float fLength, float fWidth, float fHeight ); 23 | virtual ~CBoxGeometry(); 24 | virtual void Render(); 25 | virtual CVertexBuffer* GetRenderBuffer(){ return m_pRenderBuffer; } 26 | virtual CIndexBuffer* GetIndexBuffer(){ return m_pIndexBuffer; } 27 | 28 | private: 29 | CVertexBuffer* m_pRenderBuffer; 30 | CIndexBuffer* m_pIndexBuffer; 31 | }; 32 | 33 | #endif 34 | 35 | -------------------------------------------------------------------------------- /bigimage/camera.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: camera.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_CAMERA_H__ 16 | #define __BIGIMAGE_CAMERA_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | class CCamera { 23 | public: 24 | CCamera(); 25 | virtual ~CCamera(); 26 | virtual void LookAt( float x, float y, float z ); 27 | virtual void UpdateMatrix( CMatrix4 *pParentM ); 28 | void TranslateX( float distance ); 29 | void TranslateY( float distance ); 30 | void TranslateZ( float distance ); 31 | void TranslateOnAxis( CVector3 &v, float distance ); 32 | void Init(); 33 | 34 | virtual void UpdateProjectionMatrix(); 35 | void AddRenderElement( HRENDERELEMENTHANDLE hHandle ); 36 | void RemoveRenderElement( HRENDERELEMENTHANDLE hHandle ); 37 | void Render(); 38 | void UpdateRenderList(); 39 | 40 | public: 41 | void UpdateLook(); 42 | CVector3 m_tPosition; 43 | CVector3 m_tView; 44 | CVector3 m_tUp; 45 | CQuaternion m_tQuaternion; 46 | CMatrix4 m_tMatrixWorld; 47 | CMatrix4 m_tMatrixWorldInverse; 48 | CMatrix4 m_tProjectionMatrix; 49 | CMatrix4 m_tProjectionMatrixInverse; 50 | 51 | CMatrix4 m_tProjectionWorldInverse, m_pWorldProjectionInverse; 52 | CMatrix4 m_tProjScreenMatrix; 53 | float zoom; 54 | 55 | CRenderItemManager* m_pRenderElementManager; 56 | }; 57 | 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /bigimage/circlegeometry.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: circlegeometry.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_CIRCLEGEOMETRY_H__ 16 | #define __BIGIMAGE_CIRCLEGEOMETRY_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | class CCircleGeometry: public CGeometry{ 23 | public: 24 | CCircleGeometry( float radiusTop = 1.0f, float radiusBottom = 1.0f, float height = 1.0f, int32 radialSegments = 8, int32 heightSegments = 1, bool32 openEnded = False, float thetaStart = 0.0f, float thetaLength = TWO_PI ); 25 | virtual ~CCircleGeometry(); 26 | virtual void Render(); 27 | virtual CVertexBuffer* GetRenderBuffer(){ return m_pRenderBuffer; } 28 | virtual CIndexBuffer* GetIndexBuffer(){ return m_pIndexBuffer; } 29 | 30 | private: 31 | void generateTorso( int32 &groupStart, float radiusTop, float radiusBottom, int32 &index, int32 heightSegments, float height, float halfHeight, int32 radialSegments, float thetaStart, float thetaLength, vector& vertices, vector& indices ); 32 | void generateCap( bool32 top, int32 &groupStart, float radiusTop, float radiusBottom, int32 &index, int32 heightSegments, float height, float halfHeight, int32 radialSegments, float thetaStart, float thetaLength, vector& vertices, vector& indices ); 33 | CVertexBuffer* m_pRenderBuffer; 34 | CIndexBuffer* m_pIndexBuffer; 35 | 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /bigimage/colorscene.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: colorscene.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_COLORSCENE_H__ 16 | #define __BIGIMAGE_COLORSCENE_H__ 17 | 18 | #include 19 | 20 | class CColorScene: public CScene{ 21 | public: 22 | CColorScene( float r, float g, float b ); 23 | virtual ~CColorScene(); 24 | 25 | public: 26 | CColor m_tColor; 27 | 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /bigimage/directionallight.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: directionallight.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_DIRECTIONALLIGHT_H__ 16 | #define __BIGIMAGE_DIRECTIONALLIGHT_H__ 17 | 18 | #include 19 | 20 | class CDirectionalLight: public CLight{ 21 | public: 22 | CDirectionalLight(); 23 | CDirectionalLight( int32 nWidth, int32 nHeight ); 24 | virtual ~CDirectionalLight(); 25 | virtual void BeginRender( int32 nViewportWidth, int32 nViewportHeight ); 26 | virtual void EndRender(); 27 | virtual void Update(); 28 | virtual void SetPosition( float x, float y, float z ); 29 | virtual void SetViewPort( float fLeft, float fRight, float fTop, float fBottom, float fNear, float fFar ); 30 | virtual void SetDirectionPos( float x, float y, float z ); 31 | virtual CVector3* GetDirectionPos(){ return &m_tDirection; } 32 | virtual CColor* GetColor(); 33 | void Move( float x, float y, float z ); 34 | 35 | CColor m_tColor; 36 | float m_fLeft, m_fRight, m_fTop, m_fBottom, m_fNear, m_fFar; 37 | CVector3 n_tView; 38 | CVector3 m_tDirection; 39 | }; 40 | 41 | 42 | 43 | 44 | 45 | 46 | #endif 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /bigimage/directionlightscene.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: directionlightscene.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_DIRECTIONLIGHTSCENE_H__ 16 | #define __BIGIMAGE_DIRECTIONLIGHTSCENE_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | class CDirectionalLight; 23 | class CDirectionLightScene: public CScene{ 24 | public: 25 | static float _fCameraX; 26 | static float _fCameraY; 27 | CDirectionLightScene(); 28 | virtual ~CDirectionLightScene(); 29 | virtual void Update( float fDelta ); 30 | virtual void Render( CTextureTarget* pTextureTarget, int32 nViewportWidth, int32 nViewportHeight ); 31 | virtual CLight* GetLight(); 32 | virtual CSkyBox* GetSkyBox(){ return m_pSkyBox; } 33 | virtual CWater* GetWater(){ return m_pWater; } 34 | // void SetAmbientLightColor( CColor tColor ); 35 | // void SetFogInfo( CColor tFogColor, float fFogNear, float fFogFar ); 36 | virtual void AddRenderElement( CGameObject* pGameObject ); 37 | virtual void RemoveRenderElement( CGameObject* pGameObject ); 38 | void SetSkyBoxInfo( int32 nSize, const char* strFileName ); 39 | CColor m_tAmbientLightColor; 40 | CColor m_tFogColor; 41 | float m_fFogNear; 42 | float m_fFogFar; 43 | 44 | 45 | public: 46 | CSkyBox* m_pSkyBox; 47 | CWater* m_pWater; 48 | CDirectionalLight* m_pLight; 49 | CShadowMaterial* m_pShadowMaterial; 50 | CWFXStandardMaterial* m_pWFXStandardMaterial; 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /bigimage/flycameracontrol.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: flycameracontrol.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_FLYCAMERACONTROL_H__ 16 | #define __BIGIMAGE_FLYCAMERACONTROL_H__ 17 | 18 | #include 19 | 20 | class CFlyCameraControl { 21 | public: 22 | CFlyCameraControl( CCamera *pCamera ); 23 | virtual ~CFlyCameraControl(); 24 | void SetPosition( float x, float y, float z ); 25 | void SetView( float x, float y, float z ); 26 | void OnMouseMove( float x, float y ); 27 | void MoveForward( float fSpeed ); 28 | void MoveLateral( float fSpeed ); 29 | void update( float delta ); 30 | void updateMovementVector(); 31 | void updateRotationVector(); 32 | void RotateView( float angle, float x, float y, float z ); 33 | 34 | protected: 35 | private: 36 | CCamera *object; 37 | float movementSpeed; 38 | float lookSpeed; 39 | bool32 lookVertical; 40 | bool32 autoForward; 41 | bool32 activeLook; 42 | bool32 heightSpeed; 43 | float heightCoef; 44 | float heightMin; 45 | float heightMax; 46 | bool32 constrainVertical; 47 | float verticalMin; 48 | float verticalMax; 49 | float autoSpeedFactor; 50 | float mouseX, mouseY; 51 | float lat, lon, phi, theta; 52 | bool32 moveForward, moveBackward, moveLeft, moveRight, moveUp, moveDown, freeze; 53 | bool32 m_bRotate; 54 | int32 viewHalfX, viewHalfY; 55 | }; 56 | 57 | #endif 58 | 59 | -------------------------------------------------------------------------------- /bigimage/gamemodel.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: gamemodel.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_GAMEMODEL_H__ 16 | #define __BIGIMAGE_GAMEMODEL_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | struct TGameObjectRenderPass{ 23 | CVertexBuffer* m_pRenderBuffer; 24 | CTexture* m_pTexture; 25 | }; 26 | 27 | class CGameModel; 28 | class CGameModelEvent { 29 | public: 30 | virtual CTexture* OnGetTexture(CGameModel* pGameModel, const char* strFileName ); 31 | }; 32 | 33 | class CGameObject; 34 | class CGameModel{ 35 | public: 36 | CGameModel( void* pStream ); 37 | virtual ~CGameModel(); 38 | virtual void Init(CGameModelEvent* pGameModelEventObject); 39 | uint32 m_nKey; 40 | CGameModelEvent* m_pGameModelEventObject; 41 | vector< CTexture* >m_vTextureList; 42 | }; 43 | 44 | CGameModel* CreateGameModel(void* pStream, uint32 nFileExt ); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /bigimage/gamemodelmanager.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: gamemodelmanager.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_GAMEMODELMANAGER_H__ 16 | #define __BIGIMAGE_GAMEMODELMANAGER_H__ 17 | 18 | #include 19 | #include 20 | 21 | class CGameModelManager{ 22 | public: 23 | static CGameModelManager* GetInterface(); 24 | CGameModelManager(); 25 | ~CGameModelManager(); 26 | CGameModel* GetGameModelFormFile(CGameModelEvent* pGameModelEventObject, const char* strFileName, void* pFileStream = NULL ); 27 | void Remove( CGameModel* pGameModel ); 28 | void Clear(); 29 | void GC(); 30 | 31 | private: 32 | mapm_vGameModelTable; 33 | }; 34 | 35 | 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /bigimage/gameobject.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/bigimage/gameobject.h -------------------------------------------------------------------------------- /bigimage/geometry.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: geometry.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_GEOMETRY_H__ 16 | #define __BIGIMAGE_GEOMETRY_H__ 17 | 18 | #include 19 | 20 | class CGeometry{ 21 | public: 22 | CGeometry(); 23 | virtual ~CGeometry(); 24 | virtual void Update(); 25 | virtual void Render(); 26 | virtual CVertexBuffer* GetRenderBuffer(); 27 | virtual CIndexBuffer* GetIndexBuffer(); 28 | }; 29 | 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /bigimage/geometrygameobject.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: geometrygameobject.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_GEOMETRYGAMEOBJECT_H__ 16 | #define __BIGIMAGE_GEOMETRYGAMEOBJECT_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | class CGeometryGameObject: public CGameObject{ 23 | public: 24 | CGeometryGameObject(); 25 | CGeometryGameObject( CGeometry* pGeometry, CTexture* pTexture ); 26 | virtual ~CGeometryGameObject(); 27 | void Init( CGeometry* pGeometry, CTexture* pTexture ); 28 | virtual void Update( Vector3 pCameraPos, int32 nDelta, float fDelta, void* pUserData ); 29 | virtual int32 GetRenderElementHandles( HRENDERELEMENTHANDLE *vRenderElementHandle, int32 nMaxCount ); 30 | virtual void ApplyTransform(); 31 | void SetOrder( int32 nOrder ); 32 | void SetVisible( bool32 bVisible ); 33 | 34 | public: 35 | CGeometry* m_pGeometry; 36 | CTexture* m_pTexture; 37 | CRenderItem* m_pRenderElement; 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /bigimage/light.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: shadowmaterial.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_LIGHT_H__ 16 | #define __BIGIMAGE_LIGHT_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | typedef uint32 HLIGHTHANGLE; 23 | 24 | class CLight{ 25 | public: 26 | CLight(); 27 | virtual ~CLight(); 28 | virtual void Update(); 29 | virtual void BeginRender( int32 nViewportWidth, int32 nViewportHeight ); 30 | virtual void EndRender(); 31 | virtual HTEXTUREHANDLE GetShadowTextureHandle(); 32 | virtual void AddRenderElement( HRENDERELEMENTHANDLE hHandle ); 33 | virtual void RemoveRenderElement( HRENDERELEMENTHANDLE hHandle ); 34 | virtual void SetPosition( float x, float y, float z ); 35 | virtual void SetViewPort( float fLeft, float fRight, float fTop, float fBottom, float fNear, float fFar ); 36 | virtual void SetDirectionPos( float x, float y, float z ); 37 | virtual CVector3* GetDirectionPos(); 38 | virtual CColor* GetColor(); 39 | void Render(); 40 | void UpdateRenderList(); 41 | 42 | public: 43 | CMatrix4 projectionMatrix; 44 | CMatrix4 viewMatrix; 45 | CMatrix4 worldMatrix; 46 | CMatrix4 matrixWorldInverse; 47 | CMatrix4 projScreenMatrix; 48 | CMatrix4 shadowMatrix; 49 | float m_fShadowBias; 50 | float m_fShadowRadius; 51 | float m_vShadowMapSize[2]; 52 | CVector3 m_tPosition; 53 | CRenderItemManager* m_pRenderElementManager; 54 | CTextureTarget* m_pTextureDepth; 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /bigimage/orbitcontrols.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: orbitcontrols.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_ORBITCONTROLS_H__ 16 | #define __BIGIMAGE_ORBITCONTROLS_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | enum STATE{ 23 | NONE = - 1, 24 | ROTATE = 0, 25 | DOLLY = 1, 26 | PAN = 2, 27 | TOUCH_ROTATE = 3, 28 | TOUCH_DOLLY_PAN = 4, 29 | }; 30 | 31 | 32 | enum keys{ 33 | LEFT = 37, 34 | UP = 38, 35 | RIGHT = 39, 36 | BOTTOM = 40, 37 | }; 38 | 39 | // Mouse buttons 40 | enum mouseButtons{ 41 | ORBIT = 0, 42 | ZOOM = 1, 43 | _PAN = 2, 44 | }; 45 | 46 | class COrbitControls{ 47 | public: 48 | COrbitControls( CCamera* object, float clientWidth, float clientHeight ); 49 | ~COrbitControls(); 50 | float getPolarAngle(); 51 | float getAzimuthalAngle(); 52 | void saveState(); 53 | void reset(); 54 | bool32 update(); 55 | float getAutoRotationAngle(); 56 | float getZoomScale(); 57 | void rotateLeft( float angle ); 58 | void rotateUp( float angle ); 59 | void panLeft( float distance, CMatrix4 &objectMatrix ); 60 | void panUp( float distance, CMatrix4 &objectMatrix ); 61 | void pan( float deltaX, float deltaY ); 62 | void dollyIn( float dollyScale ); 63 | void dollyOut( float dollyScale ); 64 | void handleMouseDownRotate( float x, float y ); 65 | void handleMouseDownDolly( float x, float y ); 66 | void handleMouseDownPan( float x, float y ); 67 | void handleMouseMoveRotate( float x, float y ); 68 | void handleMouseMoveDolly( float x, float y ); 69 | void handleMouseMovePan( float x, float y ); 70 | void handleMouseUp( float x, float y ); 71 | void handleMouseWheel( float deltaY ); 72 | void handleKeyDown( int32 keyCode ); 73 | void onMouseDown( int32 button, float x, float y ); 74 | void onMouseMove( float x, float y ); 75 | void onMouseUp( int32 button, float x, float y ); 76 | void onMouseWheel( float Y ); 77 | 78 | 79 | CCamera* object; 80 | float clientWidth; 81 | float clientHeight; 82 | 83 | bool32 enabled; 84 | CVector3 target; 85 | float minDistance; 86 | float maxDistance; 87 | 88 | float minZoom; 89 | float maxZoom; 90 | 91 | float minPolarAngle; 92 | float maxPolarAngle; 93 | 94 | float minAzimuthAngle; 95 | float maxAzimuthAngle; 96 | 97 | bool32 enableDamping; 98 | float dampingFactor; 99 | 100 | bool32 enableZoom; 101 | float zoomSpeed; 102 | 103 | bool32 enableRotate; 104 | float rotateSpeed; 105 | 106 | bool32 enablePan; 107 | float panSpeed; 108 | 109 | bool32 screenSpacePanning; 110 | float keyPanSpeed; 111 | 112 | bool32 autoRotate; 113 | float autoRotateSpeed; 114 | 115 | bool32 enableKeys; 116 | 117 | CVector3 target0; 118 | CVector3 position0; 119 | float zoom0; 120 | 121 | CSpherical spherical; 122 | CSpherical sphericalDelta; 123 | 124 | STATE state; 125 | 126 | float EPS; 127 | float scale; 128 | 129 | CVector3 panOffset; 130 | bool32 zoomChanged; 131 | 132 | CVector2 rotateStart; 133 | CVector2 rotateEnd; 134 | CVector2 rotateDelta; 135 | 136 | CVector2 panStart; 137 | CVector2 panEnd; 138 | CVector2 panDelta; 139 | 140 | CVector2 dollyStart; 141 | CVector2 dollyEnd; 142 | CVector2 dollyDelta; 143 | 144 | }; 145 | 146 | #endif 147 | -------------------------------------------------------------------------------- /bigimage/panelgeometry.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: panelgeometry.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_PANELGEOMETRY_H__ 16 | #define __BIGIMAGE_PANELGEOMETRY_H__ 17 | 18 | #include 19 | 20 | class CPanelGeometry: public CGeometry{ 21 | public: 22 | CPanelGeometry( float width, float height, int32 widthSegments = 1, int32 heightSegments = 1 ); 23 | virtual ~CPanelGeometry(); 24 | void Render(); 25 | virtual CVertexBuffer* GetRenderBuffer(){ return m_pRenderBuffer; } 26 | virtual CIndexBuffer* GetIndexBuffer(){ return m_pIndexBuffer; } 27 | 28 | private: 29 | CVertexBuffer* m_pRenderBuffer; 30 | CIndexBuffer* m_pIndexBuffer; 31 | 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /bigimage/perspectivecamera.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: perspectivecamera.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_PERSPECTIVECAMERA_H__ 16 | #define __BIGIMAGE_PERSPECTIVECAMERA_H__ 17 | 18 | #include 19 | 20 | class CPerspectiveCamera: public CCamera{ 21 | public: 22 | CPerspectiveCamera( float fFov, float fAspect, float fNear, float fFar ); 23 | virtual ~CPerspectiveCamera(); 24 | virtual void SetViewOffset( float fFullWidth, float fFullHeight, float fX, float fY, float fWidth, float fHeight ); 25 | virtual void UpdateProjectionMatrix(); 26 | public: 27 | float m_fFov; 28 | float m_fAspect; 29 | float m_fNear; 30 | float m_fFar; 31 | float m_fFullWidth; 32 | float m_fFullHeight; 33 | float m_fX; 34 | float m_fY; 35 | float m_fWidth; 36 | float m_fHeight; 37 | 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /bigimage/renderitem.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/bigimage/renderitem.h -------------------------------------------------------------------------------- /bigimage/renderitemmanager.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: renderitemmanager.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_RENDERITEMMANAGER_H__ 16 | #define __BIGIMAGE_RENDERITEMMANAGER_H__ 17 | 18 | #include 19 | #include 20 | 21 | class CRenderItemManager{ 22 | public: 23 | CRenderItemManager(); 24 | virtual ~CRenderItemManager(); 25 | void Add( HRENDERELEMENTHANDLE hRenderElementHandle ); 26 | void Remove( HRENDERELEMENTHANDLE hRenderElementHandle ); 27 | void Clear(); 28 | void Update( CMatrix4& pProjectM, CMatrix4& pViewM, CMatrix4& pProjViewM ); 29 | void UpdateShadow( CMatrix4& pProjectM, CMatrix4& pViewM, CMatrix4& pProjViewM ); 30 | void Render(); 31 | void RenderShadow(); 32 | 33 | private: 34 | HRENDERELEMENTMANAGERHANDLE m_hRenderElementManagerHandle; 35 | 36 | }; 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /bigimage/ringgeometry.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: ringgeometry.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_RINGGEOMETRY_H__ 16 | #define __BIGIMAGE_RINGGEOMETRY_H__ 17 | 18 | #include 19 | #include 20 | 21 | class CRingGeometry: public CGeometry{ 22 | public: 23 | CRingGeometry( float innerRadius = 0.5f, float outerRadius = 1.0f, int32 thetaSegments = 8, int32 phiSegments = 1, float thetaStart = 0.0f, float thetaLength = TWO_PI ); 24 | virtual ~CRingGeometry(); 25 | virtual void Render(); 26 | virtual CVertexBuffer* GetRenderBuffer(){ return m_pRenderBuffer; } 27 | virtual CIndexBuffer* GetIndexBuffer(){ return m_pIndexBuffer; } 28 | 29 | private: 30 | CVertexBuffer* m_pRenderBuffer; 31 | CIndexBuffer* m_pIndexBuffer; 32 | 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /bigimage/scene.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: scene.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_SCENE_H__ 16 | #define __BIGIMAGE_SCENE_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | class CScene; 28 | class CSceneEvent { 29 | public: 30 | virtual void OnUpdate(CScene* pScene, float fDelta, int32 nCode); 31 | virtual void OnRender(CScene* pScene, int32 nCode); 32 | }; 33 | 34 | class CScene: public CGameObject{ 35 | public: 36 | static CScene* m_pCurrentActiveScene; 37 | public: 38 | CScene(); 39 | virtual ~CScene(); 40 | virtual void Update( float fDelta ); 41 | virtual void Render( CTextureTarget* pTextureTarget, int32 nViewportWidth, int32 nViewportHeight ); 42 | virtual CCamera* GetCamera(); 43 | virtual CLight* GetLight(); 44 | virtual CSkyBox* GetSkyBox(); 45 | virtual CWater* GetWater(); 46 | void SetCamera( CCamera* pCamera ); 47 | virtual void AddRenderElement( CGameObject* pGameObject ); 48 | virtual void RemoveRenderElement( CGameObject* pGameObject ); 49 | CWFXGameParticleMaterial* GetParticleMaterial(){ return m_pParticlaMaterial; } 50 | 51 | CSceneEvent* m_pSceneEventObject; 52 | 53 | protected: 54 | void UpdateParticles( float fDelta ); 55 | void RenderParticles(); 56 | CCamera* m_pCamera; 57 | CColor m_tClearColor; 58 | CWFXGameParticleMaterial* m_pParticlaMaterial; 59 | CWFXGameParticleManager* m_pWFXParticleManager; 60 | 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /bigimage/shadowmaterial.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/bigimage/shadowmaterial.h -------------------------------------------------------------------------------- /bigimage/skybox.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: skybox.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_SKYBOX_H__ 16 | #define __BIGIMAGE_SKYBOX_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | class CSkyBox: public CGameObject{ 24 | public: 25 | CSkyBox( CMaterial* pMaterial ); 26 | virtual ~CSkyBox(); 27 | virtual int32 GetRenderElementHandles( HRENDERELEMENTHANDLE *vRenderElementHandle, int32 nMaxCount ); 28 | virtual void Update( Vector3 pCameraPos, int32 nDelta, float fDelta, void* pUserData ); 29 | void SetTexture( const char* strFileDir ); 30 | void Render(); 31 | 32 | private: 33 | void Init( CMaterial* pMaterial ); 34 | char m_strFileName[64]; 35 | CRenderItemManager* m_pRenderManager; 36 | CTexture* m_pTexture[6]; 37 | CVertexBuffer* m_vRenderBuffer[6]; 38 | CRenderItem* m_vRenderElement[6]; 39 | }; 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /bigimage/spheregeometry.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: spheregeometry.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_SPHEREGEOMETRY_H__ 16 | #define __BIGIMAGE_SPHEREGEOMETRY_H__ 17 | 18 | #include 19 | #include 20 | 21 | class CSphereGeometry: public CGeometry{ 22 | public: 23 | CSphereGeometry( float radius, int32 widthSegments, int32 heightSegments, float phiStart = 0.0f, float phiLength = TWO_PI, float thetaStart = 0.0f, float thetaLength = PI ); 24 | virtual ~CSphereGeometry(); 25 | virtual void Render(); 26 | virtual CVertexBuffer* GetRenderBuffer(){ return m_pRenderBuffer; } 27 | virtual CIndexBuffer* GetIndexBuffer(){ return m_pIndexBuffer; } 28 | 29 | private: 30 | CVertexBuffer* m_pRenderBuffer; 31 | CIndexBuffer* m_pIndexBuffer; 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /bigimage/springaction.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/bigimage/springaction.h -------------------------------------------------------------------------------- /bigimage/standardmaterial.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: standardmaterial.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_STANDARDMATERIAL_H__ 16 | #define __BIGIMAGE_STANDARDMATERIAL_H__ 17 | 18 | #include 19 | 20 | class CStandardMaterial: public CMaterial{ 21 | public: 22 | CStandardMaterial(); 23 | virtual ~CStandardMaterial(); 24 | virtual void Init(); 25 | virtual void Final(); 26 | virtual void Begin(); 27 | virtual void End(); 28 | virtual void RenderText( float x, float y, const char* strText, color32 c, int32 nStyle, color32 bk ); 29 | virtual void SetProjectViewM( Matrix4 m ); 30 | virtual void SetProjectM( Matrix4 m ); 31 | virtual void SetViewM( Matrix4 m ); 32 | virtual void SetWorldM( Matrix4 m ); 33 | virtual void SetNormalM( Matrix3 m ); 34 | virtual void SetDiffuseTexture( CTexture* pTexture ); 35 | virtual void SetMaterialInfo( Vector3 diffuse, Vector3 ambient, Vector3 emissive, Vector3 specular, float opacity, float shininess ); 36 | virtual void SetEnvironmentInfo( Vector3 ambientLightColor, Vector3 directionalLightDirection, Vector3 directionalLightColor ); 37 | 38 | private: 39 | HMATERIALATTRIBUTE m_hModelMatrixHandle; 40 | HMATERIALATTRIBUTE m_hViewMatrixHandle; 41 | HMATERIALATTRIBUTE m_hProjectionMatrixHandle; 42 | HMATERIALATTRIBUTE m_hNormalMatrixHandle; 43 | HMATERIALATTRIBUTE m_hDiffuseHandle; 44 | HMATERIALATTRIBUTE m_hOpacityHandle; 45 | HMATERIALATTRIBUTE m_hAmbientHandle; 46 | HMATERIALATTRIBUTE m_hEmissiveHandle; 47 | HMATERIALATTRIBUTE m_hSpecularHandle; 48 | HMATERIALATTRIBUTE m_hShininessHandle; 49 | HMATERIALATTRIBUTE m_hAmbientLightColorHandle; 50 | HMATERIALATTRIBUTE m_hDirectionalLightColorHandle; 51 | HMATERIALATTRIBUTE m_hDirectionalLightDirectionHandle; 52 | HMATERIALATTRIBUTE m_hDiffuseMapHandle; 53 | 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /bigimage/teapotgeometry.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: teapotgeometry.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_TEAPOTGEOMETRY_H__ 16 | #define __BIGIMAGE_TEAPOTGEOMETRY_H__ 17 | 18 | #include 19 | 20 | class CTeapotGeometry: public CGeometry{ 21 | public: 22 | CTeapotGeometry( float size, int32 segments = 10, bool32 bottom = True, bool32 lid = True, bool32 body = True, bool32 fitLid = True, bool32 blinn = True ); 23 | virtual ~CTeapotGeometry(); 24 | virtual void Render(); 25 | virtual CVertexBuffer* GetRenderBuffer(){ return m_pRenderBuffer; } 26 | virtual CIndexBuffer* GetIndexBuffer(){ return m_pIndexBuffer; } 27 | 28 | private: 29 | CVertexBuffer* m_pRenderBuffer; 30 | CIndexBuffer* m_pIndexBuffer; 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /bigimage/terrainmaterial.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: terrainmaterial.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_TERRAINMATERIAL_H__ 16 | #define __BIGIMAGE_TERRAINMATERIAL_H__ 17 | 18 | #include 19 | 20 | class CTerrainMaterial: public CMaterial{ 21 | public: 22 | CTerrainMaterial(); 23 | virtual ~CTerrainMaterial(); 24 | virtual void Init(); 25 | 26 | protected: 27 | }; 28 | 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /bigimage/transformcamera.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: transformcamera.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_TRANSFORMCAMERA_H__ 16 | #define __BIGIMAGE_TRANSFORMCAMERA_H__ 17 | 18 | #include 19 | 20 | class CTransformCamera: public CCamera{ 21 | public: 22 | CTransformCamera( float fFov, float fAspect, float fNear, float fFar ); 23 | virtual ~CTransformCamera(); 24 | void RotateView( float angle, float x, float y, float z ); 25 | void MoveView( float x, float y ); 26 | void SetViewPos( float x, float y, float z ); 27 | void SetTargetPos( float x, float y, float z ); 28 | void SetUpPos( float x, float y, float z ); 29 | void MouseMove( float x, float y ); 30 | void Zoom( float z ); 31 | void Apply(); 32 | 33 | private: 34 | float mouseX, mouseY; 35 | }; 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /bigimage/water.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: renderitem.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_WATER_H__ 16 | #define __BIGIMAGE_WATER_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | class CWater: public CGameObject{ 26 | public: 27 | CWater(); 28 | virtual ~CWater(); 29 | virtual int32 GetRenderElementHandles( HRENDERELEMENTHANDLE *vRenderElementHandle, int32 nMaxCount ); 30 | virtual void Update( Vector3 pCameraPos, int32 nDelta, float fDelta, void* pUserData ); 31 | virtual void Render( CCamera* pCamera, CVector3 &tSunDirection, CColor& tSunColor, CColor& tFogColor, float fFogNear, float fFogFar ); 32 | float alpha; 33 | float time; 34 | float size; 35 | bool32 m_bVisible; 36 | CColor waterColor; 37 | CColor mirrorColor; 38 | CVector3 eye; 39 | float distortionScale; 40 | int32 side; 41 | CVector3 normal; 42 | CVector3 mirrorWorldPosition; 43 | CVector3 cameraWorldPosition; 44 | CMatrix4 rotationMatrix; 45 | CVector3 lookAtPosition; 46 | CVector4 clipPlane; 47 | CVector3 view; 48 | CVector3 target; 49 | CVector4 q; 50 | CMatrix4 textureMatrix; 51 | CPerspectiveCamera* mirrorCamera; 52 | 53 | private: 54 | void Init(); 55 | CRenderItem* m_pRenderElement; 56 | CVertexBuffer* m_pRenderBuffer; 57 | CWaterMaterial* m_pMaterial; 58 | CTexture* m_pNormalTexture; 59 | CTexture* m_pMirrorTexture; 60 | CRenderItemManager* m_pWaterRenderManager; 61 | }; 62 | 63 | #endif 64 | 65 | -------------------------------------------------------------------------------- /bigimage/watermaterial.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: watermaterial.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_WATERMATERIAL_H__ 16 | #define __BIGIMAGE_WATERMATERIAL_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | class CWaterMaterial: public CMaterial{ 23 | public: 24 | CWaterMaterial(); 25 | virtual ~CWaterMaterial(); 26 | virtual void Init(); 27 | void SetProjectM( Matrix4 m ); 28 | void SetModelViewMatrixM( Matrix4 m ); 29 | void SetWorldM( Matrix4 m ); 30 | //void SetMirrorTexture( CTexture* pTexture ); 31 | void SetSetMirrorColor( CColor& tColor ); 32 | void SetNormalTexture( CTexture* pTexture ); 33 | void SetAlpha( float fValue ); 34 | void SetTime( float fTime ); 35 | void SetSunColor( CColor& tColor ); 36 | void SetWaterColor( CColor& tColor ); 37 | void SetSunDirection( CVector3& tValue ); 38 | void SetDistortionScale( float fScale ); 39 | void SetTextureMatrix( CMatrix4& tValue ); 40 | void SetEye( CVector3& tValue ); 41 | void SetSize( float fValue ); 42 | 43 | private: 44 | 45 | }; 46 | 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /bigimage/wfxgamemodel.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: wfxgamemodel.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_WFXGAMEMODEL_H__ 16 | #define __BIGIMAGE_WFXGAMEMODEL_H__ 17 | 18 | #include 19 | 20 | class CWFXGameModel: public CGameModel{ 21 | public: 22 | CWFXGameModel( void* pStream ); 23 | virtual ~CWFXGameModel(); 24 | virtual void Init(CGameModelEvent* pGameModelEventObject ); 25 | uint32 GetHandle(); 26 | 27 | public: 28 | uint32 m_hModelHandle; 29 | int32 m_nSequenceCount; 30 | int32 m_nTextureCount; 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /bigimage/wfxgamemodelmanager.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: wfxgamemodelmanager.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_WFXGAMEMODELMANAGER_H__ 16 | #define __BIGIMAGE_WFXGAMEMODELMANAGER_H__ 17 | 18 | 19 | 20 | 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /bigimage/wfxgameobject.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: wfxgameobject.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_WFXGAMEOBJECT_H__ 16 | #define __BIGIMAGE_WFXGAMEOBJECT_H__ 17 | 18 | #include 19 | #include 20 | 21 | class CWFXParticleManager; 22 | typedef uint32 HOBJECTHANDLE; 23 | class CWFXGameObject: public CGameObject{ 24 | public: 25 | CWFXGameObject(); 26 | virtual ~CWFXGameObject(); 27 | virtual void Init(CGameModelEvent* pGetTextureObject, const char* strFileName ); 28 | virtual void Init(CGameModelEvent* pGetTextureObject, const char* strFileName, void* pFileStream ); 29 | virtual void Init(CGameModelEvent* pGetTextureObject, const char* strFileName, Vector3 sStartPos, Vector3 sTargetPos ); 30 | 31 | virtual void Update( Vector3 pCameraPos, int32 nDelta, float fDelta, void* pUserData ); 32 | virtual int32 GetRenderElementHandles( HRENDERELEMENTHANDLE *vRenderElementHandle, int32 nMaxCount ); 33 | virtual int32 OnFrame( int32 nFrame ); 34 | virtual int32 OnAnimationEnd( int32 nAnimation ); 35 | 36 | bool32 Intersect( HOBJECTHANDLE hRayCaster, Matrix4 m, float vRet[3] ); 37 | bool32 ResetEffect(); 38 | 39 | 40 | int32 GetSequenceCount(); 41 | void GetSeqenceInfo( int32 nIndex, char* strText, float *pStartTime, float *pEndTime, float *pPlaySpeed ); 42 | void SetAnimaltionIndex( int32 nIndex, int32 nNextIndex ); 43 | int32 GetAnimationIndex(); 44 | CWFXGameModel* GetGameModel(); 45 | 46 | protected: 47 | uint32 m_hWFXObjectHandle; 48 | CGameModel* m_pGameModelReference; 49 | 50 | }; 51 | 52 | 53 | #endif 54 | 55 | -------------------------------------------------------------------------------- /bigimage/wfxgameobjectmanager.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: wfxgameobjectmanager.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_WFXGAMEOBJECTMANAGER_H__ 16 | #define __BIGIMAGE_WFXGAMEOBJECTMANAGER_H__ 17 | 18 | 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /bigimage/wfxgameparticlemanager.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: wfxgameparticlemanager.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_WFXGAMEPARTICLEMANAGER_H__ 16 | #define __BIGIMAGE_WFXGAMEPARTICLEMANAGER_H__ 17 | 18 | #include 19 | 20 | class CWFXGameParticleManager{ 21 | public: 22 | CWFXGameParticleManager(); 23 | ~CWFXGameParticleManager(); 24 | void Update( float fDelta, float* pCameraPos ); 25 | void Render( CMaterial* pMateral ); 26 | void Clear(); 27 | void SetCameraAngle( float x, float y ); 28 | uint32 GetHandle(){ return m_hWFXParticleManagerHandle; } 29 | 30 | private: 31 | uint32 m_hWFXParticleManagerHandle; 32 | }; 33 | 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /bigimage/wfxgameparticlematerial.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: wfxgameparticlematerial.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_WFXGAMEPARTICLEMATERIAL_H__ 16 | #define __BIGIMAGE_WFXGAMEPARTICLEMATERIAL_H__ 17 | 18 | #include 19 | 20 | class CWFXGameParticleMaterial : public CMaterial{ 21 | public: 22 | CWFXGameParticleMaterial(); 23 | virtual ~CWFXGameParticleMaterial(); 24 | virtual void Init(); 25 | 26 | private: 27 | 28 | }; 29 | 30 | 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /bigimage/wfxstanardmaterial.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: wfxstanardmaterial.h 4 | *Module: bigimage 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __BIGIMAGE_WFXSTANARDMATERIAL_H__ 16 | #define __BIGIMAGE_WFXSTANARDMATERIAL_H__ 17 | 18 | #include 19 | 20 | class CWFXStandardMaterial: public CMaterial{ 21 | public: 22 | CWFXStandardMaterial(); 23 | virtual ~CWFXStandardMaterial(); 24 | virtual void Init(); 25 | 26 | protected: 27 | 28 | }; 29 | 30 | 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /bignumber/bigcalculate.h: -------------------------------------------------------------------------------- 1 | #ifndef __BIGCALCULATE_H__ 2 | #define __BIGCALCULATE_H__ 3 | 4 | #include 5 | #include 6 | 7 | class CBigCalculate{ 8 | public: 9 | static void RemoveStartZero( TNumberList *one ); 10 | static void Add( CBigNumber *one, CBigNumber *two, CBigNumber *ret ); 11 | static void Minus( CBigNumber *one, CBigNumber *two, CBigNumber *ret ); 12 | 13 | static void PlusAdd( CBigNumber *one, CBigNumber *two, CBigNumber *ret ); 14 | static int DecimalAdd( TNumberList *one, TNumberList *two, TNumberList *result ); 15 | static void IntAdd( TNumberList *one, TNumberList *two, int intAdd, TNumberList *result ); 16 | static void IntAddBigAddSmall( TNumberList *one, TNumberList *two, int intAdd, TNumberList *result ); 17 | 18 | static void PlusMinus( CBigNumber *one, CBigNumber *two, CBigNumber *ret ); 19 | static int DecimalMinus( TNumberList *one, TNumberList *two, TNumberList *result ); 20 | static void IntMinus( TNumberList *one, TNumberList *two, int Minus, TNumberList *result ); 21 | 22 | static void Multiply( CBigNumber *one, CBigNumber *two, CBigNumber *result ); 23 | static void Multiply( TNumberList *one, TNumberList *two, TNumberList *result ); 24 | 25 | 26 | static void Division( CBigNumber *one, CBigNumber *two, CBigNumber *result ); 27 | static void Division( CBigNumber *one, CBigNumber *two, int precision, CBigNumber *result ); 28 | static int Division( TNumberList* one, TNumberList* two ); 29 | static int CompareList( TNumberList *one, TNumberList *two ); 30 | }; 31 | 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /bignumber/bignumber.h: -------------------------------------------------------------------------------- 1 | #ifndef __BIGNUMBER_H__ 2 | #define __BIGNUMBER_H__ 3 | 4 | #include 5 | #include 6 | 7 | class CBigNumber{ 8 | public: 9 | //static CBigNumber Zero(); 10 | CBigNumber(); 11 | CBigNumber( const char* text ); 12 | CBigNumber( const TNumberList &i, const TNumberList &d, bool plus ); 13 | // 14 | int IntLength(); 15 | // 16 | int DecimalLength(); 17 | int CompareTo( CBigNumber *other ); 18 | bool IsZero(); 19 | void SetValue( const char* strText ); 20 | char* GetText( char* strText ); 21 | 22 | CBigNumber& operator=( const CBigNumber& cls ); 23 | CBigNumber& operator += ( const CBigNumber& rhs ); 24 | CBigNumber& operator -= ( const CBigNumber& rhs ); 25 | CBigNumber& operator-(); 26 | 27 | public: 28 | // 29 | TNumberList intPart; 30 | TNumberList decimalPart; 31 | bool isPlus; 32 | }; 33 | 34 | CBigNumber operator +( const CBigNumber& a, const CBigNumber& b ); 35 | CBigNumber operator -( const CBigNumber& a, const CBigNumber& b ); 36 | CBigNumber operator *( const CBigNumber& a, const CBigNumber& b ); 37 | CBigNumber operator /( const CBigNumber& a, const CBigNumber& b ); 38 | 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /bignumber/bignumberconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef __BIGNUMBERCONFIG_H__ 2 | #define __BIGNUMBERCONFIG_H__ 3 | 4 | #include 5 | #include 6 | 7 | #define BigNumberOneCount (1) 8 | #define BigNumberMax (10) 9 | typedef /*MiniSTL::*/vector< int32 > TNumberList; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /bignumber/comparenumber.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPARENUMBER_H__ 2 | #define __COMPARENUMBER_H__ 3 | 4 | #include 5 | #include 6 | 7 | class CCompareNumber{ 8 | public: 9 | static int Compare( CBigNumber* one, CBigNumber* two ); 10 | static int ComparePlus( CBigNumber* one, CBigNumber* two ); 11 | }; 12 | 13 | 14 | #endif 15 | 16 | -------------------------------------------------------------------------------- /bignumber/identifynumber.h: -------------------------------------------------------------------------------- 1 | #ifndef __IDENTIFYNUMBER_H__ 2 | #define __IDENTIFYNUMBER_H__ 3 | 4 | #include 5 | #include 6 | 7 | class CIdentifyNumber{ 8 | public: 9 | static bool GetBigNumber( const char* text, TNumberList &intPart, TNumberList &decimalPart ); 10 | static void ValidateNumber( const char* text ); 11 | static int CharToInt( char p ); 12 | static char IntToChar( int n ); 13 | 14 | }; 15 | 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /debug/bigimage.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/debug/bigimage.lib -------------------------------------------------------------------------------- /debug/bignumber.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/debug/bignumber.lib -------------------------------------------------------------------------------- /debug/cjson.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/debug/cjson.lib -------------------------------------------------------------------------------- /debug/espeak.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/debug/espeak.lib -------------------------------------------------------------------------------- /debug/espeak.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/debug/espeak.pdb -------------------------------------------------------------------------------- /debug/fcsimulator.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/debug/fcsimulator.lib -------------------------------------------------------------------------------- /debug/grey.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/debug/grey.lib -------------------------------------------------------------------------------- /debug/lua.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/debug/lua.lib -------------------------------------------------------------------------------- /debug/nanopb.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/debug/nanopb.lib -------------------------------------------------------------------------------- /debug/standard.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/debug/standard.lib -------------------------------------------------------------------------------- /debug/standard.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/debug/standard.pdb -------------------------------------------------------------------------------- /debug/stb.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/debug/stb.lib -------------------------------------------------------------------------------- /espeak/debug.h: -------------------------------------------------------------------------------- 1 | #ifndef DEBUG_H 2 | #define DEBUG_H 3 | 4 | //#define DEBUG_ENABLED 5 | 6 | #ifdef DEBUG_ENABLED 7 | #define ENTER(text) debug_enter(text) 8 | #define SHOW(format,...) debug_show(format,__VA_ARGS__); 9 | #define SHOW_TIME(text) debug_time(text); 10 | extern void debug_enter(const char* text); 11 | extern void debug_show(const char* format,...); 12 | extern void debug_time(const char* text); 13 | 14 | #else 15 | 16 | //#ifdef NO_VARIADIC_MACROS 17 | //#define SHOW(format) // VC6 doesn't allow "..." 18 | //#else 19 | //#define SHOW(format,...) 20 | //#endif 21 | #define SHOW_TIME(text) 22 | #define ENTER(text) 23 | #endif 24 | 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /espeak/espeak.h: -------------------------------------------------------------------------------- 1 | #ifndef __ESPEAK_H__ 2 | #define __ESPEAK_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | //#include 9 | #include 10 | #include 11 | 12 | 13 | 14 | class CESpeak{ 15 | public: 16 | CESpeak(); 17 | ~CESpeak(); 18 | 19 | bool32 Init( const char* strSpeakFilePath ); 20 | bool32 Final(); 21 | bool32 SpeakText( const char* strText ); 22 | bool32 AddSpeakText( const char* strText ); 23 | bool32 Stop(); 24 | bool32 CheckSoundEvent(int32 nParame0, int32 nParame1); 25 | 26 | private: 27 | void InitWavData(CMemFile* File, int32 nRate); 28 | void Write4Bytes(CMemFile* File, int32 nValue); 29 | void FinalWavData(CMemFile* File); 30 | 31 | int32 m_samplerate; 32 | char m_strUTF8TextBuff[1024]; 33 | HSOUNDHANDLE m_hHandle; 34 | 35 | listm_vSpeakTextQuene; 36 | 37 | }; 38 | 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /espeak/event.h: -------------------------------------------------------------------------------- 1 | #ifndef EVENT_H 2 | #define EVENT_H 3 | 4 | /* 5 | Manage events (sentence, word, mark, end,...), is responsible of calling the external 6 | callback as soon as the relevant audio sample is played. 7 | 8 | 9 | The audio stream is composed of samples from synthetised messages or audio icons. 10 | Each event is associated to a sample. 11 | 12 | Scenario: 13 | 14 | - event_declare is called for each expected event. 15 | 16 | - A timeout is started for the first pending event. 17 | 18 | - When the timeout happens, the synth_callback is called. 19 | 20 | Note: the timeout is checked against the real progress of the audio stream, which depends on pauses or underruns. If the real progress is lower than the expected one, a new timeout starts. 21 | 22 | */ 23 | 24 | #include 25 | 26 | // Initialize the event component. 27 | // First function to be called. 28 | // the callback will be called when the event actually occurs. 29 | // The callback is detailled in speak_lib.h . 30 | void event_init(void); 31 | void event_set_callback(t_espeak_callback* cb); 32 | 33 | // Clear any pending event. 34 | // 35 | // Return: EE_OK: operation achieved 36 | // EE_INTERNAL_ERROR. 37 | espeak_ERROR event_clear_all (); 38 | 39 | // Declare a future event 40 | // 41 | // Return: EE_OK: operation achieved 42 | // EE_BUFFER_FULL: the event can not be buffered; 43 | // you may try after a while to call the function again. 44 | // EE_INTERNAL_ERROR. 45 | espeak_ERROR event_declare (espeak_EVENT* event); 46 | 47 | // Terminate the event component. 48 | // Last function to be called. 49 | void event_terminate(); 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /espeak/fifo.h: -------------------------------------------------------------------------------- 1 | #ifndef FIFO_H 2 | #define FIFO_H 3 | 4 | // Helps to add espeak commands in a first-in first-out queue 5 | // and run them asynchronously. 6 | 7 | #include 8 | #include 9 | 10 | // Initialize the fifo component. 11 | // First function to be called. 12 | void fifo_init(); 13 | 14 | // Add an espeak command. 15 | // 16 | // Note: this function fails if too many commands are already buffered. 17 | // In such a case, the calling function could wait and then add again its command. 18 | // 19 | // Return: EE_OK: operation achieved 20 | // EE_BUFFER_FULL: the command can not be buffered; 21 | // you may try after a while to call the function again. 22 | // EE_INTERNAL_ERROR. 23 | espeak_ERROR fifo_add_command (t_espeak_command* c); 24 | 25 | // Add two espeak commands in a single transaction. 26 | // 27 | // Note: this function fails if too many commands are already buffered. 28 | // In such a case, the calling function could wait and then add again these commands. 29 | // 30 | // Return: EE_OK: operation achieved 31 | // EE_BUFFER_FULL: at least one command can not be buffered; 32 | // you may try after a while to call the function again. 33 | // EE_INTERNAL_ERROR. 34 | espeak_ERROR fifo_add_commands (t_espeak_command* c1, t_espeak_command* c2); 35 | 36 | // The current running command must be stopped and the awaiting commands are cleared. 37 | // Return: EE_OK: operation achieved 38 | // EE_INTERNAL_ERROR. 39 | espeak_ERROR fifo_stop (); 40 | 41 | // Is there a running command? 42 | // Returns 1 if yes; 0 otherwise. 43 | int fifo_is_busy (); 44 | 45 | // Terminate the fifo component. 46 | // Last function to be called. 47 | void fifo_terminate(); 48 | 49 | // Indicates if the running command is still enabled. 50 | // 51 | // Note: this function is mainly called by the SynthCallback (speak_lib.cpp) 52 | // It indicates if the actual wave sample can still be played. It is helpful for 53 | // stopping speech as soon as a cancel command is applied. 54 | // 55 | // Returns 1 if yes, or 0 otherwise. 56 | int fifo_is_command_enabled(); 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /espeak/speech.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2005,2006 by Jonathan Duddington * 3 | * jsd@clara.co.uk * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | // Windows command-line version of eSpeak 22 | 23 | #ifndef SPEECH_H 24 | #define SPEECH_H 25 | 26 | 27 | // conditional compilation options 28 | 29 | #define PLATFORM_WINDOWS 30 | //#define __WIN32__ 31 | //#define NEED_WCSTOF 32 | //#define NEED_GETOPT 33 | //#define USE_MBROLA_LIB 34 | 35 | #define PATHSEP '/' 36 | //#define USE_PORTAUDIO 37 | //#define NO_VARIADIC_MACROS 38 | //#define INCLUDE_KLATT 39 | //#define INCLUDE_MBROLA 40 | //#define INCLUDE_SONIC 41 | 42 | // will look for espeak_data directory here, and also in user's home directory 43 | #define PATH_ESPEAK_DATA "/usr/share/espeak-data" 44 | 45 | typedef unsigned short USHORT; 46 | typedef unsigned char UCHAR; 47 | typedef float DOUBLEX; 48 | //#ifdef __WIN64__ 49 | //typedef uint64_t long64; // use this for conversion between pointers and integers 50 | //#else 51 | typedef unsigned int long64; 52 | //#endif 53 | 54 | 55 | 56 | 57 | typedef struct { 58 | const char *mnem; 59 | int value; 60 | } MNEM_TAB; 61 | int LookupMnem(MNEM_TAB *table, const char *string); 62 | 63 | 64 | 65 | #define N_PATH_HOME 230 66 | extern char path_home[N_PATH_HOME]; // this is the espeak-data directory 67 | 68 | extern void strncpy0(char *to,const char *from, int size); 69 | int GetFileLength(const char *filename); 70 | char *Alloc(int size); 71 | void Free(void *ptr); 72 | 73 | #endif // SPEECH_H 74 | -------------------------------------------------------------------------------- /espeak/stdint.h: -------------------------------------------------------------------------------- 1 | 2 | // dummy stdint.h file for Windows 3 | 4 | typedef unsigned int uint32_t; 5 | -------------------------------------------------------------------------------- /espeak/voice.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2005 to 2007 by Jonathan Duddington * 3 | * email: jonsd@users.sourceforge.net * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write see: * 17 | * . * 18 | ***************************************************************************/ 19 | 20 | 21 | 22 | typedef struct { 23 | char v_name[40]; 24 | char language_name[20]; 25 | 26 | int phoneme_tab_ix; // phoneme table number 27 | int pitch_base; // Hz<<12 28 | int pitch_range; // standard = 0x1000 29 | 30 | int speedf1; 31 | int speedf2; 32 | int speedf3; 33 | 34 | int speed_percent; // adjust the WPM speed by this percentage 35 | int flutter; 36 | int roughness; 37 | int echo_delay; 38 | int echo_amp; 39 | int n_harmonic_peaks; // highest formant which is formed from adding harmonics 40 | int peak_shape; // alternative shape for formant peaks (0=standard 1=squarer) 41 | int voicing; // 100% = 64, level of formant-synthesized sound 42 | int formant_factor; // adjust nominal formant frequencies by this because of the voice's pitch (256ths) 43 | int consonant_amp; // amplitude of unvoiced consonants 44 | int consonant_ampv; // amplitude of the noise component of voiced consonants 45 | int samplerate; 46 | int klattv[8]; 47 | 48 | // parameters used by Wavegen 49 | short freq[N_PEAKS]; // 100% = 256 50 | short height[N_PEAKS]; // 100% = 256 51 | short width[N_PEAKS]; // 100% = 256 52 | short freqadd[N_PEAKS]; // Hz 53 | 54 | // copies without temporary adjustments from embedded commands 55 | short freq2[N_PEAKS]; // 100% = 256 56 | short height2[N_PEAKS]; // 100% = 256 57 | short width2[N_PEAKS]; // 100% = 256 58 | 59 | int breath[N_PEAKS]; // amount of breath for each formant. breath[0] indicates whether any are set. 60 | int breathw[N_PEAKS]; // width of each breath formant 61 | 62 | // This table provides the opportunity for tone control. 63 | // Adjustment of harmonic amplitudes, steps of 8Hz 64 | // value of 128 means no change 65 | #define N_TONE_ADJUST 1000 66 | unsigned char tone_adjust[N_TONE_ADJUST]; // 8Hz steps * 1000 = 8kHz 67 | 68 | } voice_t; 69 | 70 | // percentages shown to user, ix=N_PEAKS means ALL peaks 71 | extern USHORT voice_pcnt[N_PEAKS+1][3]; 72 | 73 | extern espeak_VOICE current_voice_selected; 74 | 75 | extern voice_t *voice; 76 | extern int tone_points[12]; 77 | 78 | const char *SelectVoice(espeak_VOICE *voice_select, int *found); 79 | espeak_VOICE *SelectVoiceByName(espeak_VOICE **voices, const char *name); 80 | voice_t *LoadVoice(const char *voice_name, int control); 81 | voice_t *LoadVoiceVariant(const char *voice_name, int variant); 82 | void DoVoiceChange(voice_t *v); 83 | void WVoiceChanged(voice_t *wvoice); 84 | void WavegenSetVoice(voice_t *v); 85 | void ReadTonePoints(char *string, int *tone_pts); 86 | void VoiceReset(int control); 87 | 88 | -------------------------------------------------------------------------------- /espeak/wave.h: -------------------------------------------------------------------------------- 1 | #ifndef WAVE_H 2 | #define WAVE_H 3 | 4 | #ifndef PLATFORM_DOS 5 | #include 6 | #endif 7 | 8 | extern int option_device_number; 9 | 10 | extern int wave_init(int samplerate); 11 | // TBD: the arg could be "alsa", "oss",... 12 | extern void* wave_open(const char* the_api); 13 | 14 | extern size_t wave_write(void* theHandler, char* theMono16BitsWaveBuffer, size_t theSize); 15 | extern int wave_close(void* theHandler); 16 | extern void wave_flush(void* theHandler); 17 | extern int wave_is_busy(void* theHandler); 18 | extern void wave_terminate(); 19 | extern uint32_t wave_get_read_position(void* theHandler); 20 | extern uint32_t wave_get_write_position(void* theHandler); 21 | 22 | // Supply the remaining time in ms before the sample is played 23 | // (or 0 if the event has been already played). 24 | // sample: sample identifier 25 | // time: supplied value in ms 26 | // 27 | // return 0 if ok or -1 otherwise (stream not opened). 28 | extern int wave_get_remaining_time(uint32_t sample, uint32_t* time); 29 | 30 | // set the callback which informs if the output is still enabled. 31 | // Helpful if a new sample is waiting for free space whereas sound must be stopped. 32 | typedef int (t_wave_callback)(void); 33 | extern void wave_set_callback_is_output_enabled(t_wave_callback* cb); 34 | 35 | 36 | // general functions 37 | extern void clock_gettime2(struct timespec *ts); 38 | extern void add_time_in_ms(struct timespec *ts, int time_in_ms); 39 | 40 | // for tests 41 | extern void *wave_test_get_write_buffer(); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /fcsimulator/cpu.h: -------------------------------------------------------------------------------- 1 | #ifndef CPU_H_ 2 | #define CPU_H_ 3 | 4 | #define MEMLENGTH 0x10000 5 | #define IRQ_NORMAL 0 6 | #define IRQ_NMI 1 7 | #define IRQ_RESET 2 8 | #define INS_ADC 0 9 | #define INS_AND 1 10 | #define INS_ASL 2 11 | #define INS_BCC 3 12 | #define INS_BCS 4 13 | #define INS_BEQ 5 14 | #define INS_BIT 6 15 | #define INS_BMI 7 16 | #define INS_BNE 8 17 | #define INS_BPL 9 18 | #define INS_BRK 10 19 | #define INS_BVC 11 20 | #define INS_BVS 12 21 | #define INS_CLC 13 22 | #define INS_CLD 14 23 | #define INS_CLI 15 24 | #define INS_CLV 16 25 | #define INS_CMP 17 26 | #define INS_CPX 18 27 | #define INS_CPY 19 28 | #define INS_DEC 20 29 | #define INS_DEX 21 30 | #define INS_DEY 22 31 | #define INS_EOR 23 32 | #define INS_INC 24 33 | #define INS_INX 25 34 | #define INS_INY 26 35 | #define INS_JMP 27 36 | #define INS_JSR 28 37 | #define INS_LDA 29 38 | #define INS_LDX 30 39 | #define INS_LDY 31 40 | #define INS_LSR 32 41 | #define INS_NOP 33 42 | #define INS_ORA 34 43 | #define INS_PHA 35 44 | #define INS_PHP 36 45 | #define INS_PLA 37 46 | #define INS_PLP 38 47 | #define INS_ROL 39 48 | #define INS_ROR 40 49 | #define INS_RTI 41 50 | #define INS_RTS 42 51 | #define INS_SBC 43 52 | #define INS_SEC 44 53 | #define INS_SED 45 54 | #define INS_SEI 46 55 | #define INS_STA 47 56 | #define INS_STX 48 57 | #define INS_STY 49 58 | #define INS_TAX 50 59 | #define INS_TAY 51 60 | #define INS_TSX 52 61 | #define INS_TXA 53 62 | #define INS_TXS 54 63 | #define INS_TYA 55 64 | #define INS_DUMMY 56 65 | #define ADDR_ZP 0 66 | #define ADDR_REL 1 67 | #define ADDR_IMP 2 68 | #define ADDR_ABS 3 69 | #define ADDR_ACC 4 70 | #define ADDR_IMM 5 71 | #define ADDR_ZPX 6 72 | #define ADDR_ZPY 7 73 | #define ADDR_ABSX 8 74 | #define ADDR_ABSY 9 75 | #define ADDR_PREIDXIND 10 76 | #define ADDR_POSTIDXIND 11 77 | #define ADDR_INDABS 12 78 | 79 | //class JSNES; 80 | 81 | void CPU_CPU(/*JSNES* nes*/); 82 | void CPU_reset(); 83 | int CPU_emulate(); 84 | int CPU_load(int addr); 85 | int CPU_load16bit(int addr); 86 | void CPU_write(int addr, int val); 87 | void CPU_requestIrq(int type); 88 | void CPU_push(int value); 89 | void CPU_stackWrap(); 90 | int CPU_pull(); 91 | int CPU_pageCrossed(int addr1, int addr2); 92 | void CPU_haltCycles(int cycles); 93 | void CPU_doNonMaskableInterrupt(int status); 94 | void CPU_doResetInterrupt(); 95 | void CPU_doIrq(int status); 96 | int CPU_getStatus(); 97 | void CPU_setStatus(int st); 98 | void CPU_initOpData(); 99 | void CPU_setOp(int inst, int op, int addr, int size, int cycles); 100 | 101 | 102 | //extern JSNES* CPU_nes; 103 | extern int CPU_mem[MEMLENGTH]; 104 | extern int CPU_REG_ACC; 105 | extern int CPU_REG_X; 106 | extern int CPU_REG_Y; 107 | extern int CPU_REG_SP; 108 | extern int CPU_REG_PC; 109 | extern int CPU_REG_PC_NEW; 110 | extern int CPU_REG_STATUS; 111 | extern int CPU_F_CARRY; 112 | extern int CPU_F_DECIMAL; 113 | extern int CPU_F_INTERRUPT; 114 | extern int CPU_F_INTERRUPT_NEW; 115 | extern int CPU_F_OVERFLOW; 116 | extern int CPU_F_SIGN; 117 | extern int CPU_F_ZERO; 118 | extern int CPU_F_NOTUSED; 119 | extern int CPU_F_NOTUSED_NEW; 120 | extern int CPU_F_BRK; 121 | extern int CPU_F_BRK_NEW; 122 | extern int CPU_opdata[256]; 123 | extern int CPU_cyclesToHalt; 124 | extern int CPU_crash; 125 | extern int CPU_irqRequested; 126 | extern int CPU_irqType; 127 | 128 | 129 | 130 | 131 | 132 | #endif 133 | -------------------------------------------------------------------------------- /fcsimulator/graphic.h: -------------------------------------------------------------------------------- 1 | #ifndef GRAPHIC_H_ 2 | #define GRAPHIC_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | extern CCamera *g_pCamera; 9 | extern CMaterialPointer* g_pMaterial; 10 | void InitGraphic( float w, float h ); 11 | void BeginRender(); 12 | void EndRender(); 13 | void SetTranslate( float x, float y ); 14 | void SetRotation( float r ); 15 | void SetScale( float x, float y ); 16 | void SetTexture( CTexture* pTexture ); 17 | void SetColor( float r, float g, float b, float a ); 18 | void FinalGraphic(); 19 | 20 | #endif 21 | 22 | -------------------------------------------------------------------------------- /fcsimulator/keyboard.h: -------------------------------------------------------------------------------- 1 | #ifndef KEYBOARD_H_ 2 | #define KEYBOARD_H_ 3 | 4 | #define KEY_A 0 5 | #define KEY_B 1 6 | #define KEY_SELECT 2 7 | #define KEY_START 3 8 | #define KEY_UP 4 9 | #define KEY_DOWN 5 10 | #define KEY_LEFT 6 11 | #define KEY_RIGHT 7 12 | 13 | 14 | void Keyboard_Keyboard(); 15 | int Keyboard_setKey(int key, int value); 16 | void Keyboard_keyDown(int evt); 17 | void Keyboard_keyUp(int evt); 18 | void Keyboard_keyPress(int evt); 19 | 20 | extern int Keyboard_state1[8]; 21 | extern int Keyboard_state2[8]; 22 | 23 | 24 | 25 | #endif 26 | 27 | -------------------------------------------------------------------------------- /fcsimulator/nes.h: -------------------------------------------------------------------------------- 1 | #ifndef NES_H_ 2 | #define NES_H_ 3 | 4 | 5 | 6 | void JSNES_JSNES(); 7 | void JSNES_reset(); 8 | void JSNES_start(); 9 | void JSNES_frame(); 10 | void JSNES_printFps(); 11 | void JSNES_stop(); 12 | void JSNES_reloadRom(); 13 | int JSNES_loadRom(unsigned char* data, int datasize); 14 | void JSNES_resetFps(); 15 | void JSNES_setFramerate(int rate); 16 | void JSNES_OnMouseDown(int x, int y); 17 | void JSNES_OnMouseUp(int x, int y); 18 | void JSNES_OnKeyDown(int k); 19 | void JSNES_OnKeyUp(int k); 20 | void JSNES_release(); 21 | 22 | extern int JSNES_preferredFrameRate; 23 | extern int JSNES_fpsInterval; 24 | extern int JSNES_showDisplay; 25 | extern int JSNES_emulateSound; 26 | extern int JSNES_sampleRate; 27 | extern float JSNES_CPU_FREQ_NTSC; 28 | extern float JSNES_CPU_FREQ_PAL; 29 | 30 | extern int JSNES_frameTime; 31 | extern int JSNES_isRunning; 32 | extern int JSNES_fpsFrameCount; 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /fcsimulator/rom.h: -------------------------------------------------------------------------------- 1 | #ifndef ROM_H_ 2 | #define ROM_H_ 3 | 4 | #include 5 | 6 | #define VERTICAL_MIRRORING 0 7 | #define HORIZONTAL_MIRRORING 1 8 | #define FOURSCREEN_MIRRORING 2 9 | #define SINGLESCREEN_MIRRORING 3 10 | #define SINGLESCREEN_MIRRORING2 4 11 | #define SINGLESCREEN_MIRRORING3 5 12 | #define SINGLESCREEN_MIRRORING4 6 13 | #define CHRROM_MIRRORING 7 14 | 15 | //typedef struct Tile; 16 | //class Mappers0; 17 | //class ROM{ 18 | //public: 19 | void ROM_ROM(); 20 | void ROM_load(unsigned char* data, int datasize); 21 | int ROM_getMirroringType(); 22 | int ROM_mapperSupported(); 23 | void ROM_createMapper(); 24 | 25 | #ifdef _CONTRA_GAME_ 26 | extern int ROM_rom[8][16384]; 27 | extern int** ROM_vrom; 28 | extern Tile** ROM_vromTile/*[8][256]*/; 29 | #elif _SUPERMARIO_GAME_ 30 | extern int ROM_rom[2][16384]; 31 | extern int ROM_vrom[2][4096]; 32 | extern Tile ROM_vromTile[2][256]; 33 | #else 34 | extern int** ROM_rom; 35 | extern int** ROM_vrom; 36 | extern Tile** ROM_vromTile; 37 | #endif 38 | 39 | 40 | extern int ROM_romCount; 41 | extern int ROM_vromCount; 42 | extern int ROM_mirroring; 43 | extern int ROM_batteryRam; 44 | extern int ROM_trainer; 45 | extern int ROM_fourScreen; 46 | extern int ROM_mapperType; 47 | extern int ROM_valid; 48 | //}; 49 | 50 | 51 | #endif 52 | 53 | -------------------------------------------------------------------------------- /fcsimulator/ui.h: -------------------------------------------------------------------------------- 1 | #ifndef UI_H_ 2 | #define UI_H_ 3 | 4 | 5 | void DummyUI_DummyUI(); 6 | void DummyUI_enable(); 7 | void DummyUI_updateStatus(const char* ss); 8 | void DummyUI_writeAudio(); 9 | void DummyUI_writeFrame(int* buffer, int *prevBuffer); 10 | 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /fcsimulator/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef UTILS_H_ 2 | #define UTILS_H_ 3 | 4 | void printfError( const char* ss ); 5 | void printfLog( const char* ss ); 6 | //int cfloor(int n ); 7 | int cmax(int a, int b); 8 | int cmin(int a, int b); 9 | //void copyArrayElements(int *src, int srcPos, int *dest, int destPos, int length); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /include/apps.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/include/apps.h -------------------------------------------------------------------------------- /include/assert.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: assert.h 4 | *Module: grey 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | #ifndef __GRAY_SDK_ASSERT_H___ 15 | #define __GRAY_SDK_ASSERT_H___ 16 | 17 | #include 18 | 19 | #define assert( exp ) if( !(exp) ){___assert___( 0, __FILE__, __LINE__ );} 20 | 21 | //#define assert ___assert___ 22 | EXTERN void ___assert___( bool32 exp, const char* file, int fileno ); 23 | 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /include/cpp.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: cpp.h 4 | *Module: grey 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | #ifndef __GRAY_SDK_CPP_H__ 15 | #define __GRAY_SDK_CPP_H__ 16 | 17 | char *__nw__FUi( int size ); 18 | void _main(); 19 | char __dl__FPv(); 20 | void __pure_virtual_called(); 21 | void __vec_new() 22 | void __vec_delete() 23 | 24 | 25 | #endif 26 | 27 | -------------------------------------------------------------------------------- /include/ctype.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: ctype.h 4 | *Module: grey 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | #ifndef __GRAY_SDK_CTYPE_H___ 15 | #define __GRAY_SDK_CTYPE_H___ 16 | 17 | #include 18 | 19 | #define isalnum ___isalnum___ 20 | #define isalpha ___isalpha___ 21 | #define iscntrl ___iscntrl___ 22 | #define isdigit ___isdigit___ 23 | #define isgraph ___isgraph___ 24 | #define islower ___islower___ 25 | #define isprint ___isprint___ 26 | #define ispunct ___ispunct___ 27 | #define isspace ___isspace___ 28 | #define isupper ___isupper___ 29 | #define isxdigit ___isxdigit___ 30 | #define tolower ___tolower___ 31 | #define toupper ___toupper___ 32 | 33 | 34 | EXTERN int ___isalnum___( int ch ); 35 | EXTERN int ___isalpha___( int ch ); 36 | EXTERN int ___iscntrl___( int ch ); 37 | EXTERN int ___isdigit___( int ch ); 38 | EXTERN int ___isgraph___( int ch ); 39 | EXTERN int ___islower___( int ch ); 40 | EXTERN int ___isprint___( int ch ); 41 | EXTERN int ___ispunct___( int ch ); 42 | EXTERN int ___isspace___( int ch ); 43 | EXTERN int ___isupper___( int ch ); 44 | EXTERN int ___isxdigit___( int ch ); 45 | EXTERN int ___tolower___( int ch ); 46 | EXTERN int ___toupper___( int ch ); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /include/datastream.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: datastream.h 4 | *Module: grey 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | #ifndef __GRAY_SDK_DATASTREAM_H__ 15 | #define __GRAY_SDK_DATASTREAM_H__ 16 | 17 | //#include 18 | // 19 | //typedef uint32 HHTTPHANDLE; 20 | //typedef uint32 HSTREAMHANDLE; 21 | // 22 | //HHTTPHANDLE Stream_GetHttpFile( const char* strFileName, int32 nID ); 23 | //int32 Stream_StopHttpInfo( HHTTPHANDLE hHttpHandle ); 24 | //int32 Stream_GetHttpInfoID( HHTTPHANDLE hHttpHandle ); 25 | // 26 | //HSTREAMHANDLE Stream_GetAssetFile( const char *strFileName ); 27 | //HSTREAMHANDLE Stream_GetHttpStreamObject( HHTTPHANDLE hHttpHandle, bool32 bCopy ); 28 | // 29 | // 30 | //HSTREAMHANDLE Stream_CopyStream( HSTREAMHANDLE hStreamObject ); 31 | //void Stream_Destroy( HSTREAMHANDLE hStreamObject ); 32 | //int32 Stream_GetSize( HSTREAMHANDLE hStreamObject ); 33 | //int32 Stream_GetPos( HSTREAMHANDLE hStreamObject ); 34 | //void Stream_SetPos( HSTREAMHANDLE hStreamObject, int32 nPos ); 35 | //void *Stream_GetCur( HSTREAMHANDLE hStreamObject ); 36 | //int32 Stream_Read( HSTREAMHANDLE hStreamObject, void *pData, int32 nSize ); 37 | // 38 | //HSTREAMHANDLE Stream_Pack_GetAssetFile( const char *strFileName ); 39 | //HSTREAMHANDLE Stream_Pack_GetHttpStreamObject( HHTTPHANDLE hHttpHandle ); 40 | //void Stream_Pack_Destroy( HSTREAMHANDLE hStreamObject ); 41 | //HSTREAMHANDLE Stream_Pack_GetStream( HSTREAMHANDLE hPackStreamObject, const char* strFileName ); 42 | 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /include/debug.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: debug.h 4 | *Module: grey 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | #ifndef __GRAY_SDK_DEBUG_H__ 15 | #define __GRAY_SDK_DEBUG_H__ 16 | 17 | //#include 18 | #if defined( _DEBUG ) 19 | //////#include "../../engine/include/mem/memmgr.h" 20 | 21 | ////void * operator new(unsigned int size, const char *file, int line); 22 | //// 23 | ////void operator delete(void * p); 24 | //// 25 | ////void operator delete[]( void * p ); 26 | //// 27 | ////void operator delete(void * p, const char *file, int line); 28 | //// 29 | ////void operator delete[]( void * p, const char *file, int line ); 30 | 31 | //////// 32 | ////////#define NEW new(__FILE__, __LINE__) 33 | ////////#define SAFEDELETE( p ) if( p ) delete p, p = 0; 34 | ////////#elif defined(_APP_DEBUG_) 35 | //////// 36 | //////////void * operator new( unsigned int size, const char *file, int line ); 37 | ////////// 38 | //////////void * operator new( unsigned int size, void *p); 39 | ////////// 40 | //////////void operator delete(void * p); 41 | ////////// 42 | //////////void operator delete[]( void * p ); 43 | ////////// 44 | //////////void operator delete(void * p, const char *file, int line); 45 | ////////// 46 | //////////void operator delete[]( void * p, const char *file, int line ); 47 | ////////#ifdef NEW 48 | ////////#undef NEW 49 | ////////#endif 50 | //////// 51 | ////////#define NEW new(__FILE__, __LINE__) 52 | //////// 53 | //////// 54 | ////////#ifdef SAFEDELETE 55 | ////////#undef SAFEDELETE 56 | ////////#endif 57 | //////// 58 | ////////#define SAFEDELETE( p ) if( p ) delete p, p = 0; 59 | 60 | //#define NEW new(__FILE__, __LINE__) 61 | //#define SAFEDELETE( p ) if( p ) delete p, p = 0; 62 | 63 | #endif 64 | 65 | 66 | #endif -------------------------------------------------------------------------------- /include/delegate.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: delegate.h 4 | *Module: grey 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | #ifndef __GRAY_SDK_DELEGATE_H__ 15 | #define __GRAY_SDK_DELEGATE_H__ 16 | 17 | //#define DeclareDelegate0( name )\ 18 | //struct{\ 19 | //void* mObject;\ 20 | //void( *mFunc )(void*);\ 21 | //}name; 22 | 23 | //#define DeclareDelegate1( name, a )\ 24 | //struct{\ 25 | //void* mObject;\ 26 | //void( *mFunc )(void*, a);\ 27 | //}name; 28 | 29 | #define DeclareDelegate0( type, name ) typedef void( *_##type##__##name##_Delegate )(void*); 30 | #define DeclareDelegate1( type, name, a ) typedef void( *_##type##__##name##_Delegate )(void*, a); 31 | #define DeclareDelegate2( type, name, a, b ) typedef void( *_##type##__##name##_Delegate )(void*, a, b); 32 | #define DeclareDelegate3( type, name, a, b, c ) typedef void( *_##type##__##name##_Delegate )(void*, a, b, c); 33 | #define DeclareDelegate4( type, name, a, b, c, d ) typedef void( *_##type##__##name##_Delegate )(void*, a, b, c, d); 34 | #define DeclareDelegate5( type, name, a, b, c, d, e ) typedef void( *_##type##__##name##_Delegate )(void*, a, b, c, d, e); 35 | #define DeclareDelegate6( type, name, a, b, c, d, e, f ) typedef void( *_##type##__##name##_Delegate )(void*, a, b, c, d, e, f); 36 | #define DeclareDelegate7( type, name, a, b, c, d, e, f, g ) typedef void( *_##type##__##name##_Delegate )(void*, a, b, c, d, e, f, g); 37 | #define DeclareDelegate8( type, name, a, b, c, d, e, f, g, h ) typedef void( *_##type##__##name##_Delegate )(void*, a, b, c, d, e, f, g, h); 38 | #define DeclareDelegate9( type, name, a, b, c, d, e, f, g, h, i ) typedef void( *_##type##__##name##_Delegate )(void*, a, b, c, d, e, f, g, h, i); 39 | #define DeclareDelegate10( type, name, a, b, c, d, e, f, g, h, i, j ) typedef void( *_##type##__##name##_Delegate )(void*, a, b, c, d, e, f, g, h, i, j); 40 | 41 | #define DefineDelegate( type, name )\ 42 | struct{\ 43 | void* mObject;\ 44 | _##type##__##name##_Delegate mFunc;\ 45 | }name; 46 | 47 | 48 | #define DelegateBind( p, type, name, dp, df ) (p)->name.mObject=dp, (p)->name.mFunc=(_##type##__##name##_Delegate)&df; 49 | 50 | #define DelegateInvoke0( d ) if( d.mFunc && d.mObject ) d.mFunc( d.mObject ); 51 | #define DelegateInvoke1( d, a ) if( d.mFunc && d.mObject ) d.mFunc( d.mObject, a ); 52 | #define DelegateInvoke2( d, a, b ) if( d.mFunc && d.mObject ) d.mFunc( d.mObject, a, b ); 53 | #define DelegateInvoke3( d, a, b, c ) if( d.mFunc && d.mObject ) d.mFunc( d.mObject, a, b, c ); 54 | #define DelegateInvoke4( d, a, b, c, d0 ) if( d.mFunc && d.mObject ) d.mFunc( d.mObject, a, b, c, d0 ); 55 | #define DelegateInvoke5( d, a, b, c, d0, e ) if( d.mFunc && d.mObject ) d.mFunc( d.mObject, a, b, c, d0, e ); 56 | #define DelegateInvoke6( d, a, b, c, d0, e, f ) if( d.mFunc && d.mObject ) d.mFunc( d.mObject, a, b, c, d0, e, f ); 57 | #define DelegateInvoke7( d, a, b, c, d0, e, f, g ) if( d.mFunc && d.mObject ) d.mFunc( d.mObject, a, b, c, d0, e, f, g ); 58 | #define DelegateInvoke8( d, a, b, c, d0, e, f, g, h ) if( d.mFunc && d.mObject ) d.mFunc( d.mObject, a, b, c, d0, e, f, g, h ); 59 | #define DelegateInvoke9( d, a, b, c, d0, e, f, g, h, i ) if( d.mFunc && d.mObject ) d.mFunc( d.mObject, a, b, c, d0, e, f, g, h, i ); 60 | #define DelegateInvoke10( d, a, b, c, d0, e, f, g, h, i, j ) if( d.mFunc && d.mObject ) d.mFunc( d.mObject, a, b, c, d0, e, f, g, h, i, j ); 61 | 62 | #define DelegateClear( p, d ) p->d.mObject=NULL, p->d.mFunc=NULL; 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /include/errno.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: errno.h 4 | *Module: grey 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | #ifndef __GRAY_SDK_ERRNO_H__ 15 | #define __GRAY_SDK_ERRNO_H__ 16 | 17 | extern int errno; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /include/float.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: float.h 4 | *Module: grey 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | #ifndef __GRAY_SDK_FLOAT_H__ 15 | #define __GRAY_SDK_FLOAT_H__ 16 | 17 | #define FLT_DECIMAL_DIG 9 // # of decimal digits of rounding precision 18 | #define FLT_DIG 6 // # of decimal digits of precision 19 | #define FLT_EPSILON 1.192092896e-07F // smallest such that 1.0+FLT_EPSILON != 1.0 20 | #define FLT_HAS_SUBNORM 1 // type does support subnormal numbers 21 | #define FLT_GUARD 0 22 | #define FLT_MANT_DIG 24 // # of bits in mantissa 23 | #define FLT_MAX 3.402823466e+38F // max value 24 | #define FLT_MAX_10_EXP 38 // max decimal exponent 25 | #define FLT_MAX_EXP 128 // max binary exponent 26 | #define FLT_MIN 1.175494351e-38F // min normalized positive value 27 | #define FLT_MIN_10_EXP (-37) // min decimal exponent 28 | #define FLT_MIN_EXP (-125) // min binary exponent 29 | #define FLT_NORMALIZE 0 30 | #define FLT_RADIX 2 // exponent radix 31 | #define FLT_TRUE_MIN 1.401298464e-45F // min positive value 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /include/limits.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: limits.h 4 | *Module: grey 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | #ifndef __GRAY_SDK_LIMITS_H__ 15 | #define __GRAY_SDK_LIMITS_H__ 16 | 17 | //#include 18 | 19 | 20 | #define CHAR_BIT 8 // number of bits in a char 21 | #define SCHAR_MIN (-128) // minimum signed char value 22 | #define SCHAR_MAX 127 // maximum signed char value 23 | #define UCHAR_MAX 0xff // maximum unsigned char value 24 | 25 | #ifndef _CHAR_UNSIGNED 26 | #define CHAR_MIN SCHAR_MIN // mimimum char value 27 | #define CHAR_MAX SCHAR_MAX // maximum char value 28 | #else 29 | #define CHAR_MIN 0 30 | #define CHAR_MAX UCHAR_MAX 31 | #endif 32 | 33 | 34 | #define MB_LEN_MAX 5 // max. # bytes in multibyte char 35 | #define SHRT_MIN (-32768) // minimum (signed) short value 36 | #define SHRT_MAX 32767 // maximum (signed) short value 37 | #define USHRT_MAX 0xffff // maximum unsigned short value 38 | #define INT_MIN (-2147483647 - 1) // minimum (signed) int value 39 | #define INT_MAX 2147483647 // maximum (signed) int value 40 | #define UINT_MAX 0xffffffff // maximum unsigned int value 41 | 42 | 43 | #define FLT_DECIMAL_DIG 9 // # of decimal digits of rounding precision 44 | #define FLT_DIG 6 // # of decimal digits of precision 45 | #define FLT_EPSILON 1.192092896e-07F // smallest such that 1.0+FLT_EPSILON != 1.0 46 | #define FLT_HAS_SUBNORM 1 // type does support subnormal numbers 47 | #define FLT_GUARD 0 48 | #define FLT_MANT_DIG 24 // # of bits in mantissa 49 | #define FLT_MAX 3.402823466e+38F // max value 50 | #define FLT_MAX_10_EXP 38 // max decimal exponent 51 | #define FLT_MAX_EXP 128 // max binary exponent 52 | #define FLT_MIN 1.175494351e-38F // min normalized positive value 53 | #define FLT_MIN_10_EXP (-37) // min decimal exponent 54 | #define FLT_MIN_EXP (-125) // min binary exponent 55 | #define FLT_NORMALIZE 0 56 | #define FLT_RADIX 2 // exponent radix 57 | #define FLT_TRUE_MIN 1.401298464e-45F // min positive value 58 | 59 | 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /include/locale.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: locale.h 4 | *Module: grey 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | #ifndef __GRAY_SDK_LOCALE_H__ 15 | #define __GRAY_SDK_LOCALE_H__ 16 | 17 | #include 18 | 19 | #define localeconv ___localeconv___ 20 | 21 | struct _lconv{ 22 | char *decimal_point; 23 | char *thousands_sep; 24 | char *grouping; 25 | char *int_curr_symbol; 26 | char *currency_symbol; 27 | char *mon_decimal_point; 28 | char *mon_thousands_sep; 29 | char *mon_grouping; 30 | char *positive_sign; 31 | char *negative_sign; 32 | char int_frac_digits; 33 | char frac_digits; 34 | char p_cs_precedes; 35 | char p_sep_by_space; 36 | char n_cs_precedes; 37 | char n_sep_by_space; 38 | char p_sign_posn; 39 | char n_sign_posn; 40 | }; 41 | 42 | 43 | EXTERN struct _lconv *___localeconv___( void ); 44 | 45 | #endif -------------------------------------------------------------------------------- /include/material.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: material.h 4 | *Module: grey 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | #ifndef __GRAY_SDK_MATERIAL_H_ 15 | #define __GRAY_SDK_MATERIAL_H_ 16 | 17 | #include 18 | #include 19 | 20 | typedef uint32 HMATERIALHANDLE; 21 | typedef int32 HMATERIALUNIFORM; 22 | 23 | EXTERN HMATERIALHANDLE Material_Create( const char* strName, const char* strVertexShaderCode, const char* strFragmentShaderCode ); 24 | EXTERN bool32 Material_Release( HMATERIALHANDLE hMaterialHandle ); 25 | EXTERN void Material_Begin( HMATERIALHANDLE hMaterialHandle ); 26 | EXTERN void Material_End( HMATERIALHANDLE hMaterialHandle ); 27 | EXTERN HMATERIALUNIFORM Material_GetUniform( HMATERIALHANDLE hMaterialHandle, const char* strName, int32 nType ); 28 | EXTERN void Material_SetInt( HMATERIALHANDLE hMaterialHandle, HMATERIALUNIFORM hMaterialAttribute, int32 nValue ); 29 | EXTERN void Material_SetFloat( HMATERIALHANDLE hMaterialHandle, HMATERIALUNIFORM hMaterialAttribute, float fValue ); 30 | EXTERN void Material_SetVec2( HMATERIALHANDLE hMaterialHandle, HMATERIALUNIFORM hMaterialAttribute, void* pValue ); 31 | EXTERN void Material_SetVec3( HMATERIALHANDLE hMaterialHandle, HMATERIALUNIFORM hMaterialAttribute, void* pValue ); 32 | EXTERN void Material_SetVec4( HMATERIALHANDLE hMaterialHandle, HMATERIALUNIFORM hMaterialAttribute, void* pValue ); 33 | EXTERN void Material_SetMatrix3( HMATERIALHANDLE hMaterialHandle, HMATERIALUNIFORM hMaterialAttribute, bool32 bTranspose, void* pMatrix ); 34 | EXTERN void Material_SetMatrix4( HMATERIALHANDLE hMaterialHandle, HMATERIALUNIFORM hMaterialAttribute, bool32 bTranspose, void* pMatrix ); 35 | EXTERN void Material_SetMatrix4_1(HMATERIALHANDLE hMaterialHandle, HMATERIALUNIFORM hMaterialAttribute, int32 nCount, bool32 bTranspose, void* pMatrix); 36 | EXTERN void Material_SetTexture( HMATERIALHANDLE hMaterialHandle, HMATERIALUNIFORM hMaterialAttribute, int32 nIndex, HTEXTUREHANDLE hTextureHandle ); 37 | EXTERN void Material_SetVec2_1( HMATERIALHANDLE hMaterialHandle, HMATERIALUNIFORM hMaterialAttribute, float x, float y ); 38 | EXTERN void Material_SetVec3_1( HMATERIALHANDLE hMaterialHandle, HMATERIALUNIFORM hMaterialAttribute, float x, float y, float z ); 39 | EXTERN void Material_SetVec4_1( HMATERIALHANDLE hMaterialHandle, HMATERIALUNIFORM hMaterialAttribute, float x, float y, float z, float w ); 40 | 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /include/setjmp.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: setjmp.h 4 | *Module: grey 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | #ifndef __GRAY_SDK_STJUMP_H__ 15 | #define __GRAY_SDK_STJUMP_H__ 16 | 17 | #include 18 | 19 | #define _JBLEN 16 20 | #define _JBTYPE int 21 | typedef _JBTYPE jmp_buf[_JBLEN]; 22 | 23 | 24 | #define longjmp ___longjmp___ 25 | #define setjmp ___setjmp___ 26 | 27 | 28 | EXTERN void ___longjmp___( jmp_buf envbuf, int status ); 29 | 30 | EXTERN int ___setjmp___( jmp_buf envbuf ); 31 | 32 | #endif -------------------------------------------------------------------------------- /include/signal.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: signal.h 4 | *Module: grey 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | #ifndef __GRAY_SDK_SIGNAL_H__ 15 | #define __GRAY_SDK_SIGNAL_H__ 16 | 17 | 18 | 19 | 20 | 21 | 22 | int ___raise___( int signal ); 23 | 24 | void( *signal( int signal, void( * func ) (int) ) ) (int); 25 | 26 | 27 | #endif -------------------------------------------------------------------------------- /include/sound.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: sound.h 4 | *Module: grey 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __GRAY_SDK_SOUND_H__ 16 | #define __GRAY_SDK_SOUND_H__ 17 | 18 | #include 19 | 20 | typedef uint32 HSOUNDHANDLE; 21 | 22 | EXTERN HSOUNDHANDLE Sound_Play( const char* strFileName, bool32 bLoop ); 23 | EXTERN HSOUNDHANDLE Sound_PlayOgg( void* pData, int32 nDataSize, bool32 bLoop ); 24 | EXTERN HSOUNDHANDLE Sound_PlayByStream( uint32 nHashCode, void* pData, int32 nDataSize, bool32 bLoop ); 25 | EXTERN HSOUNDHANDLE Sound_PlayDynamic( int32 nFrequency, int32 eFormat, int32 aChannel ); 26 | EXTERN void Sound_Stop( HSOUNDHANDLE hSoundHandle ); 27 | EXTERN void Sound_Pause( HSOUNDHANDLE hSoundHandle, bool32 bPause ); 28 | EXTERN int32 Sound_Length( HSOUNDHANDLE hSoundHandle ); 29 | EXTERN int32 Sound_GetPos( HSOUNDHANDLE hSoundHandle ); 30 | EXTERN int32 Sound_SetPos( HSOUNDHANDLE hSoundHandle, int32 nPos ); 31 | EXTERN int32 Sound_GetVolume( HSOUNDHANDLE hSoundHandle ); 32 | EXTERN int32 Sound_SetVolume( HSOUNDHANDLE hSoundHandle, int32 nVolume ); 33 | EXTERN int32 Sound_GetAllVolume(); 34 | EXTERN int32 Sound_SetAllVolume( int32 nVolume ); 35 | EXTERN void Sound_StopAll(); 36 | EXTERN void Sound_UpdateSoundBuffer(HSOUNDHANDLE hSoundHandle, void* pData, int32 nDataSize); 37 | EXTERN int32 Sound_Mp3Decode( void* pInData, int32 nInDataSize, void* pBuff, int32 nBuffSize ); 38 | EXTERN int32 Sound_GetBuffData( HSOUNDHANDLE hSoundHandle, int32 nPos, void* pBuff, int32 nBuffSize ); 39 | EXTERN int32 Sound_GetState( HSOUNDHANDLE hSoundHandle ); 40 | 41 | typedef uint32 HMPEGHANDLE; 42 | 43 | EXTERN HMPEGHANDLE MPEG_CreateWithFileData( void* pFileData, int32 nDataSize, bool32 bVideo, bool32 bAudio ); 44 | EXTERN HMPEGHANDLE MPEG_CreateWithDynamicData( int32 nDataSize, int32 nBuffSize, bool32 bVideo, bool32 bAudio ); 45 | EXTERN HMPEGHANDLE MPEG_CreateWithStream( int32 nBuffSize ); 46 | EXTERN bool32 MPEG_GetInfo( HMPEGHANDLE hMpegHandle, int32 *samplerate, int32 *framerate, float *duration, int32 *width, int32 *height ); 47 | EXTERN bool32 MPEG_Destroy( HMPEGHANDLE hMpegHandle ); 48 | EXTERN bool32 MPEG_Decode( HMPEGHANDLE hMpegHandle, float fDeltaTime, void* pData, int32 nStride ); 49 | EXTERN bool32 MPEG_Ended( HMPEGHANDLE hMpegHandle ); 50 | EXTERN float MPEG_GetTime( HMPEGHANDLE hMpegHandle ); 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /include/stdarg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/include/stdarg.h -------------------------------------------------------------------------------- /include/stddef.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: stddef.h 4 | *Module: grey 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __GRAY_SDK_STDDEF_H__ 16 | #define __GRAY_SDK_STDDEF_H__ 17 | 18 | 19 | 20 | #endif -------------------------------------------------------------------------------- /include/stdlib.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/include/stdlib.h -------------------------------------------------------------------------------- /include/string.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: string.h 4 | *Module: grey 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __GRAY_SDK_STRING_H__ 16 | #define __GRAY_SDK_STRING_H__ 17 | 18 | #include 19 | 20 | #define memchr ___memchr___ 21 | #define memcmp ___memcmp___ 22 | #define memcpy ___memcpy___ 23 | #define memmove ___memmove___ 24 | #define memset ___memset___ 25 | #define strcat ___strcat___ 26 | #define strchr ___strchr___ 27 | #define strcmp ___strcmp___ 28 | #define strcoll ___strcoll___ 29 | #define strcpy ___strcpy___ 30 | #define strcspn ___strcspn___ 31 | #define strerror ___strerror___ 32 | #define strlen ___strlen___ 33 | #define strncat ___strncat___ 34 | #define strncmp ___strncmp___ 35 | #define strncpy ___strncpy___ 36 | #define strpbrk ___strpbrk___ 37 | #define strrchr ___strrchr___ 38 | #define strspn ___strspn___ 39 | #define strstr ___strstr___ 40 | #define strtod ___strtod___ 41 | #define strtok ___strtok___ 42 | #define strtol ___strtol___ 43 | #define strtoul ___strtoul___ 44 | #define strxfrm ___strxfrm___ 45 | #define strncasecmp ___strncasecmp___ 46 | 47 | 48 | EXTERN void * ___memchr___( const void *buffer, int ch, int count ); 49 | EXTERN int ___memcmp___( const void *buffer1, const void *buffer2, int count ); 50 | EXTERN void * ___memcpy___( void *to, const void *from, int count ); 51 | EXTERN void * ___memmove___( void *to, const void *from, int count ); 52 | EXTERN void * ___memset___( void *buffer, int ch, int count ); 53 | EXTERN char * ___strcat___( char *str1, const char *str2 ); 54 | EXTERN char * ___strchr___( const char *str, int ch ); 55 | EXTERN int ___strcmp___( const char *str1, const char *str2 ); 56 | EXTERN int ___strcoll___( const char *str1, const char *str2 ); 57 | EXTERN char * ___strcpy___( char *to, const char *from ); 58 | EXTERN int ___strcspn___( const char *str1, const char *str2 ); 59 | EXTERN char *___strerror___( int num ); 60 | EXTERN int ___strlen___( const char *str ); 61 | EXTERN char *___strncat___( char *str1, const char *str2, int count ); 62 | EXTERN int ___strncmp___( const char *str1, const char *str2, int count ); 63 | EXTERN char *___strncpy___( char *to, const char *from, int count ); 64 | EXTERN char *___strpbrk___( const char *str1, const char *str2 ); 65 | EXTERN char *___strrchr___( const char *str, int ch ); 66 | EXTERN int ___strspn___( const char *str1, const char *str2 ); 67 | EXTERN char *___strstr___( const char *str1, const char *str2 ); 68 | EXTERN double ___strtod___( const char *start, char **end ); 69 | EXTERN char *___strtok___( char *str1, const char *str2 ); 70 | EXTERN long ___strtol___( const char *start, char **end, int base ); 71 | EXTERN unsigned long ___strtoul___( const char *start, char **end, int base ); 72 | EXTERN int ___strxfrm___( char *str1, const char *str2, int num ); 73 | EXTERN int ___strncasecmp___(const char* s1, const char* s2, int count ); 74 | 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /include/texture.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: texture.h 4 | *Module: grey 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __GRAY_SDK_TEXTURE_H__ 16 | #define __GRAY_SDK_TEXTURE_H__ 17 | 18 | #include 19 | 20 | typedef uint32 HTEXTUREHANDLE; 21 | typedef uint32 HSTREAMHANDLE; 22 | 23 | EXTERN HTEXTUREHANDLE Texture_Create_Target( int32 nWidth, int32 nHeight, bool32 bColor, bool32 bDepth, int32 eWrapS, int32 eWrapT, int32 eMagFilter, int32 eMinFilter, bool32 bGenerateMipmaps ); 24 | EXTERN HTEXTUREHANDLE Texture_Create_File( const char* strFileName, int32 eWrapS, int32 eWrapT, int32 eMagFilter, int32 eMinFilter, bool32 bGenerateMipmaps, int32 *pWidth, int32 *pHeight ); 25 | EXTERN HTEXTUREHANDLE Texture_Create_Buffer( int32 nWidth, int32 nHeight, int32 nChannel, int32 eWrapS, int32 eWrapT, int32 eMagFilter, int32 eMinFilter, bool32 bGenerateMipmaps, void* pData, int32 nDataSize ); 26 | EXTERN HTEXTUREHANDLE Texture_CreateTextureFormStream( HSTREAMHANDLE hStreamHandle ); 27 | EXTERN HTEXTUREHANDLE Texture_Create_Pack( HSTREAMHANDLE hStreamHandle ); 28 | EXTERN bool32 Texture_Release( HTEXTUREHANDLE hTextureHandle ); 29 | EXTERN void Texture_Update_Buffer( HTEXTUREHANDLE hTextureHandle, void* pData ); 30 | EXTERN void Texture_SetParame( HTEXTUREHANDLE hTextureHandle, int32 nParame, int32 nValue ); 31 | #ifdef _APP_DEBUG_ 32 | EXTERN void* Texture_GetTextureData( HTEXTUREHANDLE hTextureHandle ); 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /include/time.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: time.h 4 | *Module: grey 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __GRAY_SDK_TIME_H__ 16 | #define __GRAY_SDK_TIME_H__ 17 | 18 | #include 19 | 20 | 21 | #define asctime ___asctime___ 22 | #define clock ___clock___ 23 | #define ctime ___ctime___ 24 | #define difftime ___difftime___ 25 | #define gmtime ___gmtime___ 26 | #define localtime ___localtime___ 27 | #define mktime ___mktime___ 28 | #define strftime ___strftime___ 29 | #define time ___time___ 30 | 31 | #define CLOCKS_PER_SEC (1000) 32 | 33 | 34 | 35 | struct _tm{ 36 | int tm_sec; // seconds after the minute - [0, 60] including leap second 37 | int tm_min; // minutes after the hour - [0, 59] 38 | int tm_hour; // hours since midnight - [0, 23] 39 | int tm_mday; // day of the month - [1, 31] 40 | int tm_mon; // months since January - [0, 11] 41 | int tm_year; // years since 1900 42 | int tm_wday; // days since Sunday - [0, 6] 43 | int tm_yday; // days since January 1 - [0, 365] 44 | int tm_isdst; // daylight savings time flag 45 | }; 46 | 47 | EXTERN char *___asctime___( const struct _tm *ptr ); 48 | EXTERN unsigned int ___clock___( void ); 49 | EXTERN char *___ctime___( const unsigned int *_time ); 50 | EXTERN float ___difftime___( unsigned int time2, unsigned int time1 ); 51 | EXTERN struct _tm *___gmtime___( const unsigned int *_time, struct _tm* stm ); 52 | EXTERN struct _tm *___localtime___( const unsigned int *_time, struct _tm* stm ); 53 | EXTERN unsigned int ___mktime___( struct _tm *_time ); 54 | EXTERN int ___strftime___( char *str, int maxsize, const char *fmt, struct _tm *_time ); 55 | EXTERN unsigned int ___time___( unsigned int *_time ); 56 | EXTERN uint32 ___getperformancecount___(); 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /include/tools.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: tools.h 4 | *Module: grey 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __GRAY_SDK_TOOLS_H__ 16 | #define __GRAY_SDK_TOOLS_H__ 17 | 18 | #include 19 | 20 | 21 | #define LogTrace LogInfo(0, __FILE__, __LINE__ ),LogOut(""); 22 | 23 | typedef uint32 HTTPHANDLE; 24 | typedef uint32 REMOTEFILEHANDLE; 25 | 26 | EXTERN int32 GetAssetFileSize( const char* strFileName ); 27 | EXTERN void* GetAssetFileData( const char* strFileName, int32* nDataSize, void* pDataBuff ); 28 | EXTERN void* GetFileImageData( const char* strFileName, int32* nWidth, int32* nHeight, int32 *nChannel, int32* nDataSize ); 29 | EXTERN bool32 SaveImageFile( const char* strFileName, int32 nWidth, int32 nHeight, int32 nChannel, void* pData ); 30 | 31 | EXTERN int32 APP_GetAllCount( int32* pAppIDBuffer ); 32 | EXTERN int32 APP_GetInfo( int32 nAppID, char* strAppName, char* strTaskName, uint32* pAppIconTextureHandle, char* strDeveloper, char* strDescript ); 33 | EXTERN int32 APP_Startup( byte* pData, int32 nSize ); 34 | EXTERN int32 APP_GetMemoryInfo( int32 nAppID, int32* pIdle, int32* pUsage ); 35 | EXTERN int32 APP_GetCPUInfo( int32* pInstCount, int32* pNetDataSize ); 36 | EXTERN int32 SYSTEM_GetFarData( int32 nFarDataAddress, void* pData, int32 nSize ); 37 | EXTERN char* Format( char *buffer, const char *format, ... ); 38 | EXTERN void LogInfo( int32 nType, const char* strFileName, int32 nFileNo ); 39 | EXTERN void LogOut( const char *format, ... ); 40 | EXTERN void LogMem( void* p, int32 size ); 41 | EXTERN HTTPHANDLE HttpRequest( uint32 ID, const char* strHost, int32 nPort, const char* strAddress ); 42 | EXTERN char** GetFileList( const char* strFindDirName, int32* nCount ); 43 | EXTERN void MakeMD532( void* pData, int32 nSize, char* pMD5Code_ ); 44 | EXTERN void MakeMD516( void* pData, int32 nSize, byte* pMD5Code_ ); 45 | EXTERN int32 ConvertUTF8ToGBK( char* strDest, int32 nDestSize, char* strSrc, int32 nSrcSize ); 46 | EXTERN int32 ConvertGBKToUTF8( char* strDest, int32 nDestSize, char* strSrc, int32 nSrcSize ); 47 | EXTERN int32 UnCompressData( void* pSrc, int32 nSrcData, void* pDestBuff, int32 nDestBuffSize, byte* pProp ); 48 | EXTERN int32 SYSTEM_SetFarData( int32 nFarDataAddress, void* pData, int32 nSize ); 49 | EXTERN REMOTEFILEHANDLE GetRemoteFile( uint32 ID, const char* strURL, void* pBuff, int32 nBuffSize ); 50 | EXTERN int32 DebugSystemCall( const char* strFuncName, const char* strParame0, const char* strParame1, const char* strParame2, const char* strParame3 ); 51 | 52 | EXTERN uint32 ___PrintNativeCallInfo___(); 53 | #endif 54 | -------------------------------------------------------------------------------- /include/ui.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/include/ui.h -------------------------------------------------------------------------------- /include/xml.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: xml.h 4 | *Module: grey 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __GRAY_SDK_XML_H__ 16 | #define __GRAY_SDK_XML_H__ 17 | 18 | #include 19 | 20 | typedef uint32 HXMLDOCUMENTHANDLE; 21 | typedef uint32 HXMLNODEHANDLE; 22 | 23 | EXTERN HXMLDOCUMENTHANDLE XMLDocument_Open( const char* strContent ); 24 | EXTERN HXMLNODEHANDLE XMLDocument_GetFirstNode( HXMLDOCUMENTHANDLE hDocumentHandle ); 25 | EXTERN HXMLNODEHANDLE XMLDocument_GetNode( HXMLDOCUMENTHANDLE hDocumentHandle, const char *strName ); 26 | EXTERN void XMLDocument_Destroy( HXMLDOCUMENTHANDLE hDocumentHandle ); 27 | EXTERN HXMLNODEHANDLE XMLNode_GetFirstNode( HXMLNODEHANDLE hNodeHandle ); 28 | EXTERN HXMLNODEHANDLE XMLNode_GetNextNode( HXMLNODEHANDLE hNodeHandle, const char* strName ); 29 | EXTERN HXMLNODEHANDLE XMLNode_GetNode( HXMLNODEHANDLE hNodeHandle, const char *strName ); 30 | EXTERN int32 XMLNode_GetNodeCount( HXMLNODEHANDLE hNodeHandle, const char *strName ); 31 | EXTERN int32 XMLNode_GetChildCount( HXMLNODEHANDLE hNodeHandle ); 32 | EXTERN char* XMLNode_GetName( HXMLNODEHANDLE hNodeHandle, char* strTextBuff ); 33 | EXTERN char* XMLNode_GetValue( HXMLNODEHANDLE hNodeHandle, char* strTextBuff ); 34 | EXTERN char* XMLNode_GetAttributeValue( HXMLNODEHANDLE hNodeHandle, const char *strName, char* strTextBuff ); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /lib/bigimage.asl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/lib/bigimage.asl -------------------------------------------------------------------------------- /lib/bignumber.asl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/lib/bignumber.asl -------------------------------------------------------------------------------- /lib/espeak.asl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/lib/espeak.asl -------------------------------------------------------------------------------- /lib/fcsimulator.asl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/lib/fcsimulator.asl -------------------------------------------------------------------------------- /lib/lua.asl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/lib/lua.asl -------------------------------------------------------------------------------- /lib/nanopb.asl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/lib/nanopb.asl -------------------------------------------------------------------------------- /lib/standard.asl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/lib/standard.asl -------------------------------------------------------------------------------- /lua/lapi.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lapi.h,v 2.9.1.1 2017/04/19 17:20:42 roberto Exp $ 3 | ** Auxiliary functions from Lua API 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lapi_h 8 | #define lapi_h 9 | 10 | 11 | #include 12 | #include 13 | 14 | #define api_incr_top(L) {L->top++; api_check(L, L->top <= L->ci->top, \ 15 | "stack overflow");} 16 | 17 | #define adjustresults(L,nres) \ 18 | { if ((nres) == LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; } 19 | 20 | #define api_checknelems(L,n) api_check(L, (n) < (L->top - L->ci->func), \ 21 | "not enough elements in the stack") 22 | 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /lua/lcode.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lcode.h,v 1.64.1.1 2017/04/19 17:20:42 roberto Exp $ 3 | ** Code generator for Lua 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lcode_h 8 | #define lcode_h 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | 16 | /* 17 | ** Marks the end of a patch list. It is an invalid value both as an absolute 18 | ** address, and as a list link (would link an element to itself). 19 | */ 20 | #define NO_JUMP (-1) 21 | 22 | 23 | /* 24 | ** grep "ORDER OPR" if you change these enums (ORDER OP) 25 | */ 26 | typedef enum BinOpr { 27 | OPR_ADD, OPR_SUB, OPR_MUL, OPR_MOD, OPR_POW, 28 | OPR_DIV, 29 | OPR_IDIV, 30 | OPR_BAND, OPR_BOR, OPR_BXOR, 31 | OPR_SHL, OPR_SHR, 32 | OPR_CONCAT, 33 | OPR_EQ, OPR_LT, OPR_LE, 34 | OPR_NE, OPR_GT, OPR_GE, 35 | OPR_AND, OPR_OR, 36 | OPR_NOBINOPR 37 | } BinOpr; 38 | 39 | 40 | typedef enum UnOpr { OPR_MINUS, OPR_BNOT, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr; 41 | 42 | 43 | /* get (pointer to) instruction of given 'expdesc' */ 44 | #define getinstruction(fs,e) ((fs)->f->code[(e)->u.info]) 45 | 46 | #define luaK_codeAsBx(fs,o,A,sBx) luaK_codeABx(fs,o,A,(sBx)+MAXARG_sBx) 47 | 48 | #define luaK_setmultret(fs,e) luaK_setreturns(fs, e, LUA_MULTRET) 49 | 50 | #define luaK_jumpto(fs,t) luaK_patchlist(fs, luaK_jump(fs), t) 51 | 52 | LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx); 53 | LUAI_FUNC int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C); 54 | LUAI_FUNC int luaK_codek (FuncState *fs, int reg, int k); 55 | LUAI_FUNC void luaK_fixline (FuncState *fs, int line); 56 | LUAI_FUNC void luaK_nil (FuncState *fs, int from, int n); 57 | LUAI_FUNC void luaK_reserveregs (FuncState *fs, int n); 58 | LUAI_FUNC void luaK_checkstack (FuncState *fs, int n); 59 | LUAI_FUNC int luaK_stringK (FuncState *fs, TString *s); 60 | LUAI_FUNC int luaK_intK (FuncState *fs, lua_Integer n); 61 | LUAI_FUNC void luaK_dischargevars (FuncState *fs, expdesc *e); 62 | LUAI_FUNC int luaK_exp2anyreg (FuncState *fs, expdesc *e); 63 | LUAI_FUNC void luaK_exp2anyregup (FuncState *fs, expdesc *e); 64 | LUAI_FUNC void luaK_exp2nextreg (FuncState *fs, expdesc *e); 65 | LUAI_FUNC void luaK_exp2val (FuncState *fs, expdesc *e); 66 | LUAI_FUNC int luaK_exp2RK (FuncState *fs, expdesc *e); 67 | LUAI_FUNC void luaK_self (FuncState *fs, expdesc *e, expdesc *key); 68 | LUAI_FUNC void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k); 69 | LUAI_FUNC void luaK_goiftrue (FuncState *fs, expdesc *e); 70 | LUAI_FUNC void luaK_goiffalse (FuncState *fs, expdesc *e); 71 | LUAI_FUNC void luaK_storevar (FuncState *fs, expdesc *var, expdesc *e); 72 | LUAI_FUNC void luaK_setreturns (FuncState *fs, expdesc *e, int nresults); 73 | LUAI_FUNC void luaK_setoneret (FuncState *fs, expdesc *e); 74 | LUAI_FUNC int luaK_jump (FuncState *fs); 75 | LUAI_FUNC void luaK_ret (FuncState *fs, int first, int nret); 76 | LUAI_FUNC void luaK_patchlist (FuncState *fs, int list, int target); 77 | LUAI_FUNC void luaK_patchtohere (FuncState *fs, int list); 78 | LUAI_FUNC void luaK_patchclose (FuncState *fs, int list, int level); 79 | LUAI_FUNC void luaK_concat (FuncState *fs, int *l1, int l2); 80 | LUAI_FUNC int luaK_getlabel (FuncState *fs); 81 | LUAI_FUNC void luaK_prefix (FuncState *fs, UnOpr op, expdesc *v, int line); 82 | LUAI_FUNC void luaK_infix (FuncState *fs, BinOpr op, expdesc *v); 83 | LUAI_FUNC void luaK_posfix (FuncState *fs, BinOpr op, expdesc *v1, 84 | expdesc *v2, int line); 85 | LUAI_FUNC void luaK_setlist (FuncState *fs, int base, int nelems, int tostore); 86 | 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /lua/lctype.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lctype.h,v 1.12.1.1 2013/04/12 18:48:47 roberto Exp $ 3 | ** 'ctype' functions for Lua 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lctype_h 8 | #define lctype_h 9 | 10 | #include 11 | 12 | 13 | /* 14 | ** WARNING: the functions defined here do not necessarily correspond 15 | ** to the similar functions in the standard C ctype.h. They are 16 | ** optimized for the specific needs of Lua 17 | */ 18 | 19 | #if !defined(LUA_USE_CTYPE) 20 | 21 | #if 'A' == 65 && '0' == 48 22 | /* ASCII case: can use its own tables; faster and fixed */ 23 | #define LUA_USE_CTYPE 0 24 | #else 25 | /* must use standard C ctype */ 26 | #define LUA_USE_CTYPE 1 27 | #endif 28 | 29 | #endif 30 | 31 | 32 | #if !LUA_USE_CTYPE /* { */ 33 | 34 | #include 35 | 36 | #include 37 | 38 | 39 | #define ALPHABIT 0 40 | #define DIGITBIT 1 41 | #define PRINTBIT 2 42 | #define SPACEBIT 3 43 | #define XDIGITBIT 4 44 | 45 | 46 | #define MASK(B) (1 << (B)) 47 | 48 | 49 | /* 50 | ** add 1 to char to allow index -1 (EOZ) 51 | */ 52 | #define testprop(c,p) (luai_ctype_[(c)+1] & (p)) 53 | 54 | /* 55 | ** 'lalpha' (Lua alphabetic) and 'lalnum' (Lua alphanumeric) both include '_' 56 | */ 57 | #define lislalpha(c) testprop(c, MASK(ALPHABIT)) 58 | #define lislalnum(c) testprop(c, (MASK(ALPHABIT) | MASK(DIGITBIT))) 59 | #define lisdigit(c) testprop(c, MASK(DIGITBIT)) 60 | #define lisspace(c) testprop(c, MASK(SPACEBIT)) 61 | #define lisprint(c) testprop(c, MASK(PRINTBIT)) 62 | #define lisxdigit(c) testprop(c, MASK(XDIGITBIT)) 63 | 64 | /* 65 | ** this 'ltolower' only works for alphabetic characters 66 | */ 67 | #define ltolower(c) ((c) | ('A' ^ 'a')) 68 | 69 | 70 | /* two more entries for 0 and -1 (EOZ) */ 71 | LUAI_DDEC const lu_byte luai_ctype_[UCHAR_MAX + 2]; 72 | 73 | 74 | #else /* }{ */ 75 | 76 | /* 77 | ** use standard C ctypes 78 | */ 79 | 80 | #include 81 | 82 | 83 | #define lislalpha(c) (isalpha(c) || (c) == '_') 84 | #define lislalnum(c) (isalnum(c) || (c) == '_') 85 | #define lisdigit(c) (isdigit(c)) 86 | #define lisspace(c) (isspace(c)) 87 | #define lisprint(c) (isprint(c)) 88 | #define lisxdigit(c) (isxdigit(c)) 89 | 90 | #define ltolower(c) (tolower(c)) 91 | 92 | #endif /* } */ 93 | 94 | #endif 95 | 96 | -------------------------------------------------------------------------------- /lua/ldebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: ldebug.h,v 2.14.1.1 2017/04/19 17:20:42 roberto Exp $ 3 | ** Auxiliary functions from Debug Interface module 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef ldebug_h 8 | #define ldebug_h 9 | 10 | 11 | #include 12 | 13 | 14 | #define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1) 15 | 16 | #define getfuncline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : -1) 17 | 18 | #define resethookcount(L) (L->hookcount = L->basehookcount) 19 | 20 | 21 | LUAI_FUNC l_noret luaG_typeerror (lua_State *L, const TValue *o, 22 | const char *opname); 23 | LUAI_FUNC l_noret luaG_concaterror (lua_State *L, const TValue *p1, 24 | const TValue *p2); 25 | LUAI_FUNC l_noret luaG_opinterror (lua_State *L, const TValue *p1, 26 | const TValue *p2, 27 | const char *msg); 28 | LUAI_FUNC l_noret luaG_tointerror (lua_State *L, const TValue *p1, 29 | const TValue *p2); 30 | LUAI_FUNC l_noret luaG_ordererror (lua_State *L, const TValue *p1, 31 | const TValue *p2); 32 | LUAI_FUNC l_noret luaG_runerror (lua_State *L, const char *fmt, ...); 33 | LUAI_FUNC const char *luaG_addinfo (lua_State *L, const char *msg, 34 | TString *src, int line); 35 | LUAI_FUNC l_noret luaG_errormsg (lua_State *L); 36 | LUAI_FUNC void luaG_traceexec (lua_State *L); 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /lua/ldo.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: ldo.h,v 2.29.1.1 2017/04/19 17:20:42 roberto Exp $ 3 | ** Stack and Call structure of Lua 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef ldo_h 8 | #define ldo_h 9 | 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | 16 | /* 17 | ** Macro to check stack size and grow stack if needed. Parameters 18 | ** 'pre'/'pos' allow the macro to preserve a pointer into the 19 | ** stack across reallocations, doing the work only when needed. 20 | ** 'condmovestack' is used in heavy tests to force a stack reallocation 21 | ** at every check. 22 | */ 23 | #define luaD_checkstackaux(L,n,pre,pos) \ 24 | if (L->stack_last - L->top <= (n)) \ 25 | { pre; luaD_growstack(L, n); pos; } else { condmovestack(L,pre,pos); } 26 | 27 | /* In general, 'pre'/'pos' are empty (nothing to save) */ 28 | #define luaD_checkstack(L,n) luaD_checkstackaux(L,n,(void)0,(void)0) 29 | 30 | 31 | 32 | #define savestack(L,p) ((char *)(p) - (char *)L->stack) 33 | #define restorestack(L,n) ((TValue *)((char *)L->stack + (n))) 34 | 35 | 36 | /* type of protected functions, to be ran by 'runprotected' */ 37 | typedef void (*Pfunc) (lua_State *L, void *ud); 38 | 39 | LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name, 40 | const char *mode); 41 | LUAI_FUNC void luaD_hook (lua_State *L, int event, int line); 42 | LUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults); 43 | LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults); 44 | LUAI_FUNC void luaD_callnoyield (lua_State *L, StkId func, int nResults); 45 | LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u, 46 | ptrdiff_t oldtop, ptrdiff_t ef); 47 | LUAI_FUNC int luaD_poscall (lua_State *L, CallInfo *ci, StkId firstResult, 48 | int nres); 49 | LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize); 50 | LUAI_FUNC void luaD_growstack (lua_State *L, int n); 51 | LUAI_FUNC void luaD_shrinkstack (lua_State *L); 52 | LUAI_FUNC void luaD_inctop (lua_State *L); 53 | 54 | LUAI_FUNC l_noret luaD_throw (lua_State *L, int errcode); 55 | LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud); 56 | 57 | #endif 58 | 59 | -------------------------------------------------------------------------------- /lua/lfunc.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lfunc.h,v 2.15.1.1 2017/04/19 17:39:34 roberto Exp $ 3 | ** Auxiliary functions to manipulate prototypes and closures 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lfunc_h 8 | #define lfunc_h 9 | 10 | 11 | #include 12 | 13 | 14 | #define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \ 15 | cast(int, sizeof(TValue)*((n)-1))) 16 | 17 | #define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \ 18 | cast(int, sizeof(TValue *)*((n)-1))) 19 | 20 | 21 | /* test whether thread is in 'twups' list */ 22 | #define isintwups(L) (L->twups != L) 23 | 24 | 25 | /* 26 | ** maximum number of upvalues in a closure (both C and Lua). (Value 27 | ** must fit in a VM register.) 28 | */ 29 | #define MAXUPVAL 255 30 | 31 | 32 | /* 33 | ** Upvalues for Lua closures 34 | */ 35 | struct UpVal { 36 | TValue *v; /* points to stack or to its own value */ 37 | lu_mem refcount; /* reference counter */ 38 | union { 39 | struct { /* (when open) */ 40 | UpVal *next; /* linked list */ 41 | int touched; /* mark to avoid cycles with dead threads */ 42 | } open; 43 | TValue value; /* the value (when closed) */ 44 | } u; 45 | }; 46 | 47 | #define upisopen(up) ((up)->v != &(up)->u.value) 48 | 49 | 50 | LUAI_FUNC Proto *luaF_newproto (lua_State *L); 51 | LUAI_FUNC CClosure *luaF_newCclosure (lua_State *L, int nelems); 52 | LUAI_FUNC LClosure *luaF_newLclosure (lua_State *L, int nelems); 53 | LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl); 54 | LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); 55 | LUAI_FUNC void luaF_close (lua_State *L, StkId level); 56 | LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); 57 | LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number, 58 | int pc); 59 | 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /lua/llex.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: llex.h,v 1.79.1.1 2017/04/19 17:20:42 roberto Exp $ 3 | ** Lexical Analyzer 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef llex_h 8 | #define llex_h 9 | 10 | #include 11 | #include 12 | 13 | 14 | #define FIRST_RESERVED 257 15 | 16 | 17 | #if !defined(LUA_ENV) 18 | #define LUA_ENV "_ENV" 19 | #endif 20 | 21 | 22 | /* 23 | * WARNING: if you change the order of this enumeration, 24 | * grep "ORDER RESERVED" 25 | */ 26 | enum RESERVED { 27 | /* terminal symbols denoted by reserved words */ 28 | TK_AND = FIRST_RESERVED, TK_BREAK, 29 | TK_DO, TK_ELSE, TK_ELSEIF, TK_END, TK_FALSE, TK_FOR, TK_FUNCTION, 30 | TK_GOTO, TK_IF, TK_IN, TK_LOCAL, TK_NIL, TK_NOT, TK_OR, TK_REPEAT, 31 | TK_RETURN, TK_THEN, TK_TRUE, TK_UNTIL, TK_WHILE, 32 | /* other terminal symbols */ 33 | TK_IDIV, TK_CONCAT, TK_DOTS, TK_EQ, TK_GE, TK_LE, TK_NE, 34 | TK_SHL, TK_SHR, 35 | TK_DBCOLON, TK_EOS, 36 | TK_FLT, TK_INT, TK_NAME, TK_STRING 37 | }; 38 | 39 | /* number of reserved words */ 40 | #define NUM_RESERVED (cast(int, TK_WHILE-FIRST_RESERVED+1)) 41 | 42 | 43 | typedef union { 44 | lua_Number r; 45 | lua_Integer i; 46 | TString *ts; 47 | } SemInfo; /* semantics information */ 48 | 49 | 50 | typedef struct Token { 51 | int token; 52 | SemInfo seminfo; 53 | } Token; 54 | 55 | 56 | /* state of the lexer plus state of the parser when shared by all 57 | functions */ 58 | typedef struct LexState { 59 | int current; /* current character (charint) */ 60 | int linenumber; /* input line counter */ 61 | int lastline; /* line of last token 'consumed' */ 62 | Token t; /* current token */ 63 | Token lookahead; /* look ahead token */ 64 | struct FuncState *fs; /* current function (parser) */ 65 | struct lua_State *L; 66 | ZIO *z; /* input stream */ 67 | Mbuffer *buff; /* buffer for tokens */ 68 | Table *h; /* to avoid collection/reuse strings */ 69 | struct Dyndata *dyd; /* dynamic structures used by the parser */ 70 | TString *source; /* current source name */ 71 | TString *envn; /* environment variable name */ 72 | } LexState; 73 | 74 | 75 | LUAI_FUNC void luaX_init (lua_State *L); 76 | LUAI_FUNC void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, 77 | TString *source, int firstchar); 78 | LUAI_FUNC TString *luaX_newstring (LexState *ls, const char *str, size_t l); 79 | LUAI_FUNC void luaX_next (LexState *ls); 80 | LUAI_FUNC int luaX_lookahead (LexState *ls); 81 | LUAI_FUNC l_noret luaX_syntaxerror (LexState *ls, const char *s); 82 | LUAI_FUNC const char *luaX_token2str (LexState *ls, int token); 83 | 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /lua/lmem.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lmem.h,v 1.43.1.1 2017/04/19 17:20:42 roberto Exp $ 3 | ** Interface to Memory Manager 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lmem_h 8 | #define lmem_h 9 | 10 | 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | 17 | /* 18 | ** This macro reallocs a vector 'b' from 'on' to 'n' elements, where 19 | ** each element has size 'e'. In case of arithmetic overflow of the 20 | ** product 'n'*'e', it raises an error (calling 'luaM_toobig'). Because 21 | ** 'e' is always constant, it avoids the runtime division MAX_SIZET/(e). 22 | ** 23 | ** (The macro is somewhat complex to avoid warnings: The 'sizeof' 24 | ** comparison avoids a runtime comparison when overflow cannot occur. 25 | ** The compiler should be able to optimize the real test by itself, but 26 | ** when it does it, it may give a warning about "comparison is always 27 | ** false due to limited range of data type"; the +1 tricks the compiler, 28 | ** avoiding this warning but also this optimization.) 29 | */ 30 | #define luaM_reallocv(L,b,on,n,e) \ 31 | (((sizeof(n) >= sizeof(size_t) && cast(size_t, (n)) + 1 > MAX_SIZET/(e)) \ 32 | ? luaM_toobig(L) : cast_void(0)) , \ 33 | luaM_realloc_(L, (b), (on)*(e), (n)*(e))) 34 | 35 | /* 36 | ** Arrays of chars do not need any test 37 | */ 38 | #define luaM_reallocvchar(L,b,on,n) \ 39 | cast(char *, luaM_realloc_(L, (b), (on)*sizeof(char), (n)*sizeof(char))) 40 | 41 | #define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0) 42 | #define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0) 43 | #define luaM_freearray(L, b, n) luaM_realloc_(L, (b), (n)*sizeof(*(b)), 0) 44 | 45 | #define luaM_malloc(L,s) luaM_realloc_(L, NULL, 0, (s)) 46 | #define luaM_new(L,t) cast(t *, luaM_malloc(L, sizeof(t))) 47 | #define luaM_newvector(L,n,t) \ 48 | cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t))) 49 | 50 | #define luaM_newobject(L,tag,s) luaM_realloc_(L, NULL, tag, (s)) 51 | 52 | #define luaM_growvector(L,v,nelems,size,t,limit,e) \ 53 | if ((nelems)+1 > (size)) \ 54 | ((v)=cast(t *, luaM_growaux_(L,v,&(size),sizeof(t),limit,e))) 55 | 56 | #define luaM_reallocvector(L, v,oldn,n,t) \ 57 | ((v)=cast(t *, luaM_reallocv(L, v, oldn, n, sizeof(t)))) 58 | 59 | LUAI_FUNC l_noret luaM_toobig (lua_State *L); 60 | 61 | /* not to be called directly */ 62 | LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize, 63 | size_t size); 64 | LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int *size, 65 | size_t size_elem, int limit, 66 | const char *what); 67 | 68 | #endif 69 | 70 | -------------------------------------------------------------------------------- /lua/lprefix.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lprefix.h,v 1.2.1.1 2017/04/19 17:20:42 roberto Exp $ 3 | ** Definitions for Lua code that must come before any other header file 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lprefix_h 8 | #define lprefix_h 9 | 10 | 11 | /* 12 | ** Allows POSIX/XSI stuff 13 | */ 14 | #if !defined(LUA_USE_C89) /* { */ 15 | 16 | #if !defined(_XOPEN_SOURCE) 17 | #define _XOPEN_SOURCE 600 18 | #elif _XOPEN_SOURCE == 0 19 | #undef _XOPEN_SOURCE /* use -D_XOPEN_SOURCE=0 to undefine it */ 20 | #endif 21 | 22 | /* 23 | ** Allows manipulation of large files in gcc and some other compilers 24 | */ 25 | #if !defined(LUA_32BITS) && !defined(_FILE_OFFSET_BITS) 26 | #define _LARGEFILE_SOURCE 1 27 | #define _FILE_OFFSET_BITS 64 28 | #endif 29 | 30 | #endif /* } */ 31 | 32 | 33 | /* 34 | ** Windows stuff 35 | */ 36 | #if defined(_WIN32) /* { */ 37 | 38 | #if !defined(_CRT_SECURE_NO_WARNINGS) 39 | #define _CRT_SECURE_NO_WARNINGS /* avoid warnings about ISO C functions */ 40 | #endif 41 | 42 | #endif /* } */ 43 | 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /lua/lstring.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lstring.h,v 1.61.1.1 2017/04/19 17:20:42 roberto Exp $ 3 | ** String table (keep all strings handled by Lua) 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lstring_h 8 | #define lstring_h 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | 15 | #define sizelstring(l) (sizeof(union UTString) + ((l) + 1) * sizeof(char)) 16 | 17 | #define sizeludata(l) (sizeof(union UUdata) + (l)) 18 | #define sizeudata(u) sizeludata((u)->len) 19 | 20 | #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ 21 | (sizeof(s)/sizeof(char))-1)) 22 | 23 | 24 | /* 25 | ** test whether a string is a reserved word 26 | */ 27 | #define isreserved(s) ((s)->tt == LUA_TSHRSTR && (s)->extra > 0) 28 | 29 | 30 | /* 31 | ** equality for short strings, which are always internalized 32 | */ 33 | #define eqshrstr(a,b) check_exp((a)->tt == LUA_TSHRSTR, (a) == (b)) 34 | 35 | 36 | LUAI_FUNC unsigned int luaS_hash (const char *str, size_t l, unsigned int seed); 37 | LUAI_FUNC unsigned int luaS_hashlongstr (TString *ts); 38 | LUAI_FUNC int luaS_eqlngstr (TString *a, TString *b); 39 | LUAI_FUNC void luaS_resize (lua_State *L, int newsize); 40 | LUAI_FUNC void luaS_clearcache (global_State *g); 41 | LUAI_FUNC void luaS_init (lua_State *L); 42 | LUAI_FUNC void luaS_remove (lua_State *L, TString *ts); 43 | LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s); 44 | LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l); 45 | LUAI_FUNC TString *luaS_new (lua_State *L, const char *str); 46 | LUAI_FUNC TString *luaS_createlngstrobj (lua_State *L, size_t l); 47 | 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /lua/ltable.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: ltable.h,v 2.23.1.2 2018/05/24 19:39:05 roberto Exp $ 3 | ** Lua tables (hash) 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef ltable_h 8 | #define ltable_h 9 | 10 | #include 11 | 12 | 13 | #define gnode(t,i) (&(t)->node[i]) 14 | #define gval(n) (&(n)->i_val) 15 | #define gnext(n) ((n)->i_key.nk.next) 16 | 17 | 18 | /* 'const' to avoid wrong writings that can mess up field 'next' */ 19 | #define gkey(n) cast(const TValue*, (&(n)->i_key.tvk)) 20 | 21 | /* 22 | ** writable version of 'gkey'; allows updates to individual fields, 23 | ** but not to the whole (which has incompatible type) 24 | */ 25 | #define wgkey(n) (&(n)->i_key.nk) 26 | 27 | #define invalidateTMcache(t) ((t)->flags = 0) 28 | 29 | 30 | /* true when 't' is using 'dummynode' as its hash part */ 31 | #define isdummy(t) ((t)->lastfree == NULL) 32 | 33 | 34 | /* allocated size for hash nodes */ 35 | #define allocsizenode(t) (isdummy(t) ? 0 : sizenode(t)) 36 | 37 | 38 | /* returns the key, given the value of a table entry */ 39 | //? 40 | //#define keyfromval(v) \ 41 | // (gkey(cast(Node *, cast(char *, (v)) - offsetof(Node, i_val)))) 42 | 43 | #define keyfromval(v) \ 44 | (gkey(cast(Node *, cast(char *, (v)) - 0))) 45 | 46 | 47 | LUAI_FUNC const TValue *luaH_getint (Table *t, lua_Integer key); 48 | LUAI_FUNC void luaH_setint (lua_State *L, Table *t, lua_Integer key, 49 | TValue *value); 50 | LUAI_FUNC const TValue *luaH_getshortstr (Table *t, TString *key); 51 | LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key); 52 | LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key); 53 | LUAI_FUNC TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key); 54 | LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key); 55 | LUAI_FUNC Table *luaH_new (lua_State *L); 56 | LUAI_FUNC void luaH_resize (lua_State *L, Table *t, unsigned int nasize, 57 | unsigned int nhsize); 58 | LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, unsigned int nasize); 59 | LUAI_FUNC void luaH_free (lua_State *L, Table *t); 60 | LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key); 61 | LUAI_FUNC lua_Unsigned luaH_getn (Table *t); 62 | 63 | 64 | #if defined(LUA_DEBUG) 65 | LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key); 66 | LUAI_FUNC int luaH_isdummy (const Table *t); 67 | #endif 68 | 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /lua/ltm.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: ltm.h,v 2.22.1.1 2017/04/19 17:20:42 roberto Exp $ 3 | ** Tag methods 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef ltm_h 8 | #define ltm_h 9 | 10 | 11 | #include 12 | 13 | 14 | /* 15 | * WARNING: if you change the order of this enumeration, 16 | * grep "ORDER TM" and "ORDER OP" 17 | */ 18 | typedef enum { 19 | TM_INDEX, 20 | TM_NEWINDEX, 21 | TM_GC, 22 | TM_MODE, 23 | TM_LEN, 24 | TM_EQ, /* last tag method with fast access */ 25 | TM_ADD, 26 | TM_SUB, 27 | TM_MUL, 28 | TM_MOD, 29 | TM_POW, 30 | TM_DIV, 31 | TM_IDIV, 32 | TM_BAND, 33 | TM_BOR, 34 | TM_BXOR, 35 | TM_SHL, 36 | TM_SHR, 37 | TM_UNM, 38 | TM_BNOT, 39 | TM_LT, 40 | TM_LE, 41 | TM_CONCAT, 42 | TM_CALL, 43 | TM_N /* number of elements in the enum */ 44 | } TMS; 45 | 46 | 47 | 48 | #define gfasttm(g,et,e) ((et) == NULL ? NULL : \ 49 | ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e])) 50 | 51 | #define fasttm(l,et,e) gfasttm(G(l), et, e) 52 | 53 | #define ttypename(x) luaT_typenames_[(x) + 1] 54 | 55 | LUAI_DDEC const char *const luaT_typenames_[LUA_TOTALTAGS]; 56 | 57 | 58 | LUAI_FUNC const char *luaT_objtypename (lua_State *L, const TValue *o); 59 | 60 | LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename); 61 | LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, 62 | TMS event); 63 | LUAI_FUNC void luaT_init (lua_State *L); 64 | 65 | LUAI_FUNC void luaT_callTM (lua_State *L, const TValue *f, const TValue *p1, 66 | const TValue *p2, TValue *p3, int hasres); 67 | LUAI_FUNC int luaT_callbinTM (lua_State *L, const TValue *p1, const TValue *p2, 68 | StkId res, TMS event); 69 | LUAI_FUNC void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2, 70 | StkId res, TMS event); 71 | LUAI_FUNC int luaT_callorderTM (lua_State *L, const TValue *p1, 72 | const TValue *p2, TMS event); 73 | 74 | 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /lua/lualib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lualib.h,v 1.45.1.1 2017/04/19 17:20:42 roberto Exp $ 3 | ** Lua standard libraries 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #ifndef lualib_h 9 | #define lualib_h 10 | 11 | #include 12 | 13 | 14 | /* version suffix for environment variable names */ 15 | #define LUA_VERSUFFIX "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR 16 | 17 | 18 | LUAMOD_API int (luaopen_base) (lua_State *L); 19 | 20 | #define LUA_COLIBNAME "coroutine" 21 | LUAMOD_API int (luaopen_coroutine) (lua_State *L); 22 | 23 | #define LUA_TABLIBNAME "table" 24 | LUAMOD_API int (luaopen_table) (lua_State *L); 25 | 26 | #define LUA_IOLIBNAME "io" 27 | LUAMOD_API int (luaopen_io) (lua_State *L); 28 | 29 | #define LUA_OSLIBNAME "os" 30 | LUAMOD_API int (luaopen_os) (lua_State *L); 31 | 32 | #define LUA_STRLIBNAME "string" 33 | LUAMOD_API int (luaopen_string) (lua_State *L); 34 | 35 | #define LUA_UTF8LIBNAME "utf8" 36 | LUAMOD_API int (luaopen_utf8) (lua_State *L); 37 | 38 | #define LUA_BITLIBNAME "bit32" 39 | LUAMOD_API int (luaopen_bit32) (lua_State *L); 40 | 41 | #define LUA_MATHLIBNAME "math" 42 | LUAMOD_API int (luaopen_math) (lua_State *L); 43 | 44 | #define LUA_DBLIBNAME "debug" 45 | LUAMOD_API int (luaopen_debug) (lua_State *L); 46 | 47 | #define LUA_LOADLIBNAME "package" 48 | LUAMOD_API int (luaopen_package) (lua_State *L); 49 | 50 | 51 | /* open all previous libraries */ 52 | LUALIB_API void (luaL_openlibs) (lua_State *L); 53 | 54 | 55 | 56 | #if !defined(lua_assert) 57 | #define lua_assert(x) ((void)0) 58 | #endif 59 | 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /lua/lundump.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lundump.h,v 1.45.1.1 2017/04/19 17:20:42 roberto Exp $ 3 | ** load precompiled Lua chunks 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lundump_h 8 | #define lundump_h 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | 15 | /* data to catch conversion errors */ 16 | #define LUAC_DATA "\x19\x93\r\n\x1a\n" 17 | 18 | #define LUAC_INT 0x5678 19 | #define LUAC_NUM cast_num(370.5) 20 | 21 | #define MYINT(s) (s[0]-'0') 22 | #define LUAC_VERSION (MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR)) 23 | #define LUAC_FORMAT 0 /* this is the official format */ 24 | 25 | /* load one chunk; from lundump.c */ 26 | LUAI_FUNC LClosure* luaU_undump (lua_State* L, ZIO* Z, const char* name); 27 | 28 | /* dump one chunk; from ldump.c */ 29 | LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, 30 | void* data, int strip); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /lua/lzio.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lzio.h,v 1.31.1.1 2017/04/19 17:20:42 roberto Exp $ 3 | ** Buffered streams 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #ifndef lzio_h 9 | #define lzio_h 10 | 11 | #include 12 | 13 | #include 14 | 15 | 16 | #define EOZ (-1) /* end of stream */ 17 | 18 | typedef struct Zio ZIO; 19 | 20 | #define zgetc(z) (((z)->n--)>0 ? cast_uchar(*(z)->p++) : luaZ_fill(z)) 21 | 22 | 23 | typedef struct Mbuffer { 24 | char *buffer; 25 | size_t n; 26 | size_t buffsize; 27 | } Mbuffer; 28 | 29 | #define luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0) 30 | 31 | #define luaZ_buffer(buff) ((buff)->buffer) 32 | #define luaZ_sizebuffer(buff) ((buff)->buffsize) 33 | #define luaZ_bufflen(buff) ((buff)->n) 34 | 35 | #define luaZ_buffremove(buff,i) ((buff)->n -= (i)) 36 | #define luaZ_resetbuffer(buff) ((buff)->n = 0) 37 | 38 | 39 | #define luaZ_resizebuffer(L, buff, size) \ 40 | ((buff)->buffer = luaM_reallocvchar(L, (buff)->buffer, \ 41 | (buff)->buffsize, size), \ 42 | (buff)->buffsize = size) 43 | 44 | #define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0) 45 | 46 | 47 | LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, 48 | void *data); 49 | LUAI_FUNC size_t luaZ_read (ZIO* z, void *b, size_t n); /* read next n bytes */ 50 | 51 | 52 | 53 | /* --------- Private Part ------------------ */ 54 | 55 | struct Zio { 56 | size_t n; /* bytes still unread */ 57 | const char *p; /* current position in buffer */ 58 | lua_Reader reader; /* reader function */ 59 | void *data; /* additional data */ 60 | lua_State *L; /* Lua state (for reader) */ 61 | }; 62 | 63 | 64 | LUAI_FUNC int luaZ_fill (ZIO *z); 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /nanopb/pb_common.h: -------------------------------------------------------------------------------- 1 | /* pb_common.h: Common support functions for pb_encode.c and pb_decode.c. 2 | * These functions are rarely needed by applications directly. 3 | */ 4 | 5 | #ifndef PB_COMMON_H_INCLUDED 6 | #define PB_COMMON_H_INCLUDED 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | /* Initialize the field iterator structure to beginning. 15 | * Returns False if the message type is empty. */ 16 | bool8 pb_field_iter_begin(pb_field_iter_t *iter, const pb_msgdesc_t *desc, void *message); 17 | 18 | /* Get a field iterator for extension field. */ 19 | bool8 pb_field_iter_begin_extension(pb_field_iter_t *iter, pb_extension_t *extension); 20 | 21 | /* Same as pb_field_iter_begin(), but for const message pointer. 22 | * Note that the pointers in pb_field_iter_t will be non-const but shouldn't 23 | * be written to when using these functions. */ 24 | bool8 pb_field_iter_begin_const(pb_field_iter_t *iter, const pb_msgdesc_t *desc, const void *message); 25 | bool8 pb_field_iter_begin_extension_const(pb_field_iter_t *iter, const pb_extension_t *extension); 26 | 27 | /* Advance the iterator to the next field. 28 | * Returns False when the iterator wraps back to the first field. */ 29 | bool8 pb_field_iter_next(pb_field_iter_t *iter); 30 | 31 | /* Advance the iterator until it points at a field with the given tag. 32 | * Returns False if no such field exists. */ 33 | bool8 pb_field_iter_find(pb_field_iter_t *iter, uint32 tag); 34 | 35 | /* Find a field with type PB_LTYPE_EXTENSION, or return False if not found. 36 | * There can be only one extension range field per message. */ 37 | bool8 pb_field_iter_find_extension(pb_field_iter_t *iter); 38 | 39 | #ifdef PB_VALIDATE_UTF8 40 | /* Validate UTF-8 text string */ 41 | bool8 pb_validate_utf8(const char *s); 42 | #endif 43 | 44 | #ifdef __cplusplus 45 | } /* extern "C" */ 46 | #endif 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /standard/allocator.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: allocator.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_ALLOCATOR_H__ 16 | #define __STANDARD_ALLOCATOR_H__ 17 | 18 | #include 19 | //#include 20 | //#include 21 | 22 | void* Allocator__allocate( size_t nObjSize, size_t nCount ); 23 | void Allocator__deallocate( void* p, size_t nCount ); 24 | // 25 | //template 26 | //class Allocator{ 27 | //public: 28 | // //static T *allocate(){ 29 | // // return static_cast(malloc( sizeof( T ) )); 30 | // //} 31 | // ////////////static int m_nSize = 0; 32 | // //////////static T *allocate( size_t n ){ 33 | // ////////// T* _ret = NULL; 34 | // ////////// if( n == 0 ) return _ret; 35 | // ////////// size_t _size = sizeof( T ) * n; 36 | // ////////// //m_nSize += _size; 37 | // ////////// _ret = (T*)(malloc( _size )); 38 | // ////////// //AddMem( _ret, _size ); 39 | // ////////// return _ret; 40 | // //////////} 41 | // ////////////static void deallocate( T *ptr ){ 42 | // //////////// free( ptr ); 43 | // //////////// //alloc::deallocate( static_cast(ptr), sizeof( T ) ); 44 | // ////////////} 45 | // //////////static void deallocate( T *ptr, size_t n ){ 46 | // ////////// if( n == 0 ) return; 47 | // ////////// //FreeMem( ptr, sizeof( T ) * n ); 48 | // 49 | // ////////// free( ptr ); 50 | // 51 | // 52 | // ////////// //m_nSize -= _size; 53 | // 54 | // ////////// //alloc::deallocate( static_cast(ptr), sizeof( T )* n ); 55 | // //////////} 56 | // 57 | // //static void construct( T *ptr ){ 58 | // // new(ptr)T(); 59 | // //} 60 | // //static void construct( T *ptr, const T& value ){ 61 | // // new(ptr)T( value ); 62 | // //} 63 | // //static void destroy( T *ptr ){ 64 | // // ptr->~T(); 65 | // //} 66 | // //static void destroy( T *first, T *last ){ 67 | // // for( ; first != last; ++first ){ 68 | // // first->~T(); 69 | // // } 70 | // //} 71 | //}; 72 | 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /standard/applite.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: applite.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_APPLITE_H__ 16 | #define __STANDARD_APPLITE_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | class CAppLite{ 24 | public: 25 | static Ref m_pUIRoot; 26 | static int32 m_nRootWidth; 27 | static int32 m_nRootHeight; 28 | static void __finaly(); 29 | CAppLite(); 30 | virtual ~CAppLite(); 31 | virtual CUIElement* Init( HUIHANDLE hParentHandle, int32 nWidth, int32 nHeight ); 32 | virtual int32 Update( int32 nDelta, float fDelta ); 33 | virtual int32 Render(); 34 | virtual int32 Final(); 35 | 36 | virtual int32 OnSystemCommand( int32 nCmd ); 37 | virtual int32 Event( int32 nParam0, int32 nParam1, int32 nParam2, int32 nParam3, int32 nParam4, int32 nParam5, int32 nParam6, int32 nParam7, int32 nParam8, int32 nParam9 ); 38 | virtual int32 HttpRequestEvent( int32 nParam0, int32 nParam1, int32 nParam2, int32 nParam3 ); 39 | virtual int32 SoundEvent( int32 nParame0, int32 nParame1 ); 40 | virtual int32 NeedData( int32 nParame0, int32 nParame1, int32 nParame2, int32 nParame3 ); 41 | virtual int32 RemoteFileTaskEvent( int32 nParam0, int32 nParam1, int32 nParam2, int32 nParam3 ); 42 | virtual int32 FinalyDebug(); 43 | 44 | }; 45 | 46 | CAppLite* StartApplite(); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /standard/color.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: color.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_COLOR_H__ 16 | #define __STANDARD_COLOR_H__ 17 | 18 | #include 19 | 20 | class CColor { 21 | public: 22 | CColor(); 23 | CColor(float r, float g, float b); 24 | CColor(float r, float g, float b, float a); 25 | CColor(uint32 nColor); 26 | void Set(float r, float g, float b); 27 | void Set(float r, float g, float b, float a); 28 | void Set(uint32 nColor); 29 | float* GetPointer() { return &R; } 30 | 31 | float R, G, B, A; 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /standard/csv.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/standard/csv.h -------------------------------------------------------------------------------- /standard/delegate.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/standard/delegate.h -------------------------------------------------------------------------------- /standard/filewriter.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: filewriter.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_FILEWRITER_H__ 16 | #define __STANDARD_FILEWRITER_H__ 17 | 18 | #include 19 | #include 20 | 21 | class CMemFile{ 22 | public: 23 | CMemFile(); 24 | ~CMemFile(); 25 | void Write(void* p, int32 nSize); 26 | void SetPos(int32 nPos); 27 | int32 GetPos(); 28 | int32 GetSize(); 29 | byte* GetData(); 30 | 31 | private: 32 | vectorm_vData; 33 | int32 m_nPos; 34 | }; 35 | 36 | 37 | 38 | class CFileWriter{ 39 | public: 40 | CFileWriter(); 41 | ~CFileWriter(); 42 | bool32 OpenFile( const char* strFileName ); 43 | bool32 CloseFile(); 44 | bool32 AddText( const char* strText ); 45 | bool32 AddText( const char* strText, int32 nTextLen ); 46 | bool32 AddInt( int32 nValue ); 47 | bool32 AddFloat( float fValue ); 48 | bool32 AddData( void* pData, int32 nSize ); 49 | 50 | private: 51 | _FILE* m_pFP; 52 | }; 53 | 54 | 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /standard/flatmaterial.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: flatmaterial.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_FLATMATERIAL_H__ 16 | #define __STANDARD_FLATMATERIAL_H__ 17 | 18 | #include 19 | #include 20 | 21 | class CFlatMaterial: public CMaterial{ 22 | public: 23 | CFlatMaterial(); 24 | virtual ~CFlatMaterial(); 25 | virtual void Init(); 26 | virtual void Begin(); 27 | virtual void End(); 28 | void RenderText( float x, float y, const char* strText, color32 c, int32 nStyle, color32 bk ); 29 | 30 | private: 31 | 32 | 33 | }; 34 | 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /standard/gc.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: gc.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2021 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | #ifndef __STANDARD_GC_H__ 15 | #define __STANDARD_GC_H__ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | 23 | class CGarbageCollection: public ITask{ 24 | public: 25 | static CGarbageCollection* GetInterface(); 26 | static bool32 AddObject( CRefObject* pRefObj ); 27 | static bool32 RemoveObject( CRefObject* pRefObj ); 28 | public: 29 | CGarbageCollection(); 30 | virtual ~CGarbageCollection(); 31 | virtual int32 UpdateTask( float fDelta ); 32 | bool32 _AddObject( CRefObject* pRefObj ); 33 | bool32 _RemoveObject( CRefObject* pRefObj ); 34 | void Sweep(); 35 | void SweepAll(); 36 | void Debug(); 37 | void ClearAll(); 38 | private: 39 | 40 | list m_vRefObjectEntityList; 41 | }; 42 | 43 | 44 | 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /standard/gui.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/standard/gui.h -------------------------------------------------------------------------------- /standard/horizontallistview.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/standard/horizontallistview.h -------------------------------------------------------------------------------- /standard/hotkey.h: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************* 3 | *Copyright,2018-2028,Longyou 4 | *FileName: hotkey.h 5 | *Module: standard 6 | *Author: DaXiang 7 | *Version: 1.0 8 | *Date: 2020 9 | *Description: 10 | *Others: 11 | *Function List: 12 | *History: 13 | **********************************************************************************/ 14 | 15 | #ifndef __STANDARD_HOTKEY_H__ 16 | #define __STANDARD_HOTKEY_H__ 17 | 18 | #include 19 | 20 | class CHotKeyEvent{ 21 | public: 22 | virtual void OnHotKey( int32 nID ); 23 | }; 24 | 25 | struct SHotKeyItem{ 26 | int32 m_nID; 27 | CUIElement* m_pElement; 28 | int32 m_nKey; 29 | bool32 m_bCtrl; 30 | bool32 m_bShirt; 31 | friend bool operator==( const SHotKeyItem& l, const SHotKeyItem& r ); 32 | }; 33 | 34 | class CHotKey{ 35 | 36 | public: 37 | CHotKey(); 38 | ~CHotKey(); 39 | void Register( CUIElement* pElement, int32 nID, int32 nKey, bool32 bCtrl = False, bool32 bShirt = False ); 40 | void Unregister( int32 nID ); 41 | void OnKeyEvent( CUIElement* pElement, EUIKeyMessage eKeyMessage, int32 nKey ); 42 | bool32 CheckKeyState( int32 nKey ); 43 | void Reset(); 44 | CHotKeyEvent* m_pHotKeyObject; 45 | private: 46 | listm_vHotKeyItemList; 47 | bool32 m_bKeyState[0xff]; 48 | }; 49 | 50 | 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /standard/httprequest.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: httprequest.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_HTTPREQUEST_H__ 16 | #define __STANDARD_HTTPREQUEST_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | class CHttpRequest; 23 | class CHttpRequestEvent{ 24 | public: 25 | virtual void OnComplate( CHttpRequest* pHttpRequest, void* pData, int32 nSize ); 26 | virtual void OnError( CHttpRequest* pHttpRequest, void* pData, int32 nSize ); 27 | virtual void OnProcess( CHttpRequest* pHttpRequest, int32 nCur, int32 nMax ); 28 | }; 29 | 30 | class CHttpRequest: public CRefObject{ 31 | public: 32 | CHttpRequest( const char* strHost, int32 nPort, const char* strAddress ); 33 | virtual ~CHttpRequest(); 34 | uint32 m_nMaskType; 35 | CHttpRequestEvent* OnHttpEventObject; 36 | HTTPHANDLE m_hHttpRequest; 37 | 38 | }; 39 | 40 | 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /standard/interpolator.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/standard/interpolator.h -------------------------------------------------------------------------------- /standard/layout.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: layout.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2021 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_LAYOUT_H__ 16 | #define __STANDARD_LAYOUT_H__ 17 | 18 | #include 19 | #include 20 | 21 | class CLayout: public CPanel{ 22 | public: 23 | CLayout(); 24 | virtual ~CLayout(); 25 | virtual void Init(int32 x, int32 y, int32 w, int32 h); 26 | virtual void BeforeShow(); 27 | virtual void AfterHide(); 28 | }; 29 | 30 | class CLayoutManager{ 31 | public: 32 | static CLayoutManager* GetInterface(); 33 | CLayoutManager(); 34 | virtual ~CLayoutManager(); 35 | void SetParent(CUIElement* pElement, int32 x, int32 y, int32 w, int32 h); 36 | bool32 AddLayout( CLayout* pLayout, int32 nGUID); 37 | bool32 Show( int32 nGUID ); 38 | CLayout* GetLayout( int32 nGUID ); 39 | 40 | private: 41 | map< int32, CLayout*> m_vLayoutList; 42 | CUIElement* m_pParent; 43 | int32 m_vLayoutBound[4]; 44 | CLayout* m_pCurrentLayout; 45 | }; 46 | 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /standard/log.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: log.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_LOG_H__ 16 | #define __STANDARD_LOG_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | enum ELogType{ 23 | ELT_Message, 24 | ELT_Info, 25 | ELT_Error, 26 | ELT_Warning, 27 | ELT_Debug, 28 | ELT_Count, 29 | }; 30 | 31 | //#define ASSERT( c, format, ... ) if( !(c) ) LogOut( ELT_Error, __FILE__, __LINE__, format, __VA_ARGS__, "?","?","?","?","?","?","?","?","?","?","?","?" ), CLog::Assert( false, __FILE__, __LINE__, format, __VA_ARGS__, "?","?","?","?","?","?","?","?","?","?","?","?"); 32 | 33 | #define LOG_MESSAGE LogInfo( ELT_Message, __FILE__, __LINE__ ); LogOut 34 | #define LOG_INFO LogInfo( ELT_Info, __FILE__, __LINE__ ); LogOut 35 | #define LOG_ERROR LogInfo( ELT_Error, __FILE__, __LINE__ ); LogOut 36 | #define LOG_WARNING LogInfo( ELT_Warning, __FILE__, __LINE__ ); LogOut 37 | #define LOG_DEBUG LogInfo( ELT_Debug, __FILE__, __LINE__ ); LogOut 38 | 39 | #define TRACEOUT LogInfo( ELT_Debug, __FILE__, __LINE__ ); LogOut("trace"); 40 | #define TRACEINFO LogInfo( ELT_Debug, __FILE__, __LINE__ ); LogOut 41 | #define TRACEMEM LogInfo( ELT_Debug, __FILE__, __LINE__ ); LogOut("trace mem: "); LogMem 42 | 43 | #define ASSERT( c ) if( !c ){ LogInfo( ELT_Debug, __FILE__, __LINE__ ); LogOut("assert"); assert( 0 ); } 44 | //#define OPENTRACE() CLog::TraceEnable(True ); 45 | //#define CLOSETRACE() CLog::TraceEnable(False ); 46 | 47 | //class CLog{ 48 | //public: 49 | // static void Init( bool32 bLogEnable ); 50 | // static void Final(); 51 | // static void Write( ELogType eType, const char* strFileName, int32 nFileNo, const char* strFormat, ... ); 52 | // static void Assert( bool bCondition, const char* strFileName, int32 nFileNo, const char* strFormat, ... ); 53 | // static void Trace( const char* strFileName, int32 nFileNo ); 54 | // static void TraceInfo( const char* strFormat, ... ); 55 | // static void TraceEnable( bool32 bEnable ); 56 | //}; 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /standard/lymfile.h: -------------------------------------------------------------------------------- 1 | #ifndef __LYMFILE_H__ 2 | #define __LYMFILE_H__ 3 | 4 | #include 5 | #include 6 | 7 | //typedef struct SRGBInfo{ 8 | // byte R, G, B; 9 | //}SRGBInfo; 10 | // 11 | //typedef union SPixelInfo{ 12 | // uint64 m_nInfo; 13 | // struct{ 14 | // uint64 m_nColorIndex: 20; 15 | // uint64 m_nFrameCoords : 20; 16 | // }SICInfo; 17 | //}SPixelInfo; 18 | // 19 | //typedef struct _SPixelInfo{ 20 | // byte m_vData[5]; 21 | //}_SPixelInfo; 22 | // 23 | //#define PIXELINFOSIZE (5) 24 | // 25 | //class CLymFile{ 26 | //public: 27 | // 28 | //public: 29 | // CLymFile(); 30 | // ~CLymFile(); 31 | // bool32 Open( const char* strFileName ); 32 | // SRGBInfo* GetNextFrame( int32 nFrame ); 33 | // SRGBInfo* GetFrame( int32 nFrame ); 34 | // 35 | //public: 36 | // CDataStream m_sFS; 37 | // int32 m_nVersionCode; 38 | // int32 m_nFrameWidth; 39 | // int32 m_nFrameHeight; 40 | // int32 m_nFrameCount; 41 | // int32 m_nColorPalette; 42 | // byte* m_pData; 43 | // 44 | // SRGBInfo** m_ppColorPaletteInfo; 45 | // int32* m_pFrameInfoPosList; 46 | // SRGBInfo* m_pFrameRGBInfoBuff; 47 | // 48 | //}; 49 | 50 | 51 | 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /standard/material.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/standard/material.h -------------------------------------------------------------------------------- /standard/math.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/standard/math.h -------------------------------------------------------------------------------- /standard/matrix3.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: matrix3.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_MATRIX3_H__ 16 | #define __STANDARD_MATRIX3_H__ 17 | 18 | class CMatrix4; 19 | class CMatrix3 { 20 | public: 21 | CMatrix3(); 22 | ~CMatrix3(); 23 | void GetNormalMatrix(CMatrix4* M); 24 | float m[9]; 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /standard/matrix4.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: matrix4.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_MATRIX4_H__ 16 | #define __STANDARD_MATRIX4_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | class CMatrix4{ 24 | public: 25 | static void Multiply( CMatrix4* retM, CMatrix4* leftM, CMatrix4* rightM ); 26 | static void MultiplyVector3( CVector3* retV, CMatrix4* M, CVector3* pPos ); 27 | CMatrix4(); 28 | ~CMatrix4(); 29 | void Set( CMatrix4* M ); 30 | void Set( Matrix4 M ); 31 | void Set( float a, float b, float c, float d, float e, float f, float g, float h, float i, float j, float k, float l, float _m, float n, float o, float p ); 32 | void MakePerspective( float fFov, float fAspect, float fNear, float fFar ); 33 | void MakeOrthographic( float width, float height, float zNearPlane, float zFarPlane ); 34 | void MakeOrthographic( float fLeft, float fRight, float fTop, float fBottom, float fNear, float fFar ); 35 | void MakeFrustum( float fLeft, float fRight, float fBottom, float fTop, float fNear, float fFar ); 36 | void MakeLookAt( CVector3 *pEye, CVector3 *pTarget, CVector3 *pUp ); 37 | void Compose( CVector3* pPos, CQuaternion* pQuaternion, CVector3* pScale ); 38 | void GetRotationQuaternion( CQuaternion* ret ); 39 | void GetInverse( CMatrix4* retM ); 40 | void Identity(); 41 | //float m[ 16 ]; 42 | // union { 43 | // struct { 44 | Matrix4 m; 45 | // }; 46 | // struct { 47 | // float m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15; 48 | // }; 49 | // }; 50 | }; 51 | 52 | 53 | void Matrix4_Set(Matrix4 pMatrix0, Matrix4 pMatrix1); 54 | 55 | void Matric4_IdentityScale(Matrix4 pMatrix, Vector3 pVector); 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /standard/notification.h: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************* 3 | *Copyright,2018-2028,Longyou 4 | *FileName: notification.h 5 | *Module: standard 6 | *Author: DaXiang 7 | *Version: 1.0 8 | *Date: 2021 9 | *Description: 10 | *Others: 11 | *Function List: 12 | *History: 13 | **********************************************************************************/ 14 | 15 | #ifndef __STANDARD_NOTIFICATION_H__ 16 | #define __STANDARD_NOTIFICATION_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | struct SNotificationNode{ 23 | CDelegate3 m_Delegate; 24 | SNotificationNode* m_pNext; 25 | }; 26 | 27 | struct SNotificationItem{ 28 | char m_strName[64]; 29 | SNotificationNode* m_pHead; 30 | }; 31 | 32 | class CNotification{ 33 | public: 34 | static CNotification* GetInterface(); 35 | static void Destroy(); 36 | CNotification(); 37 | ~CNotification(); 38 | void Add( const char* strMessage, CDelegate3 sDelegateObj ); 39 | void Remove( const char* strMessage, CDelegate3 sDelegateObj); 40 | void Clear( const char* strMessage ); 41 | void SendMessage(const char* strMessage, int32 nWParame, int32 nLParame, void* pData ); 42 | 43 | private: 44 | SNotificationItem* GetNotificationItem(const char* strMessage); 45 | void PushBack(SNotificationItem* pItem, SNotificationNode* pNode ); 46 | listm_vNotificationItemList; 47 | }; 48 | 49 | 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /standard/plane.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: plane.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_PLANE_H__ 16 | #define __STANDARD_PLANE_H__ 17 | 18 | #include 19 | #include 20 | 21 | class CPlane { 22 | public: 23 | CPlane(); 24 | //CPlane( CPlane* p ); 25 | CPlane(Vector3 v, float fConstant); 26 | void SetPlane(Vector3 sStartPos, Vector3 sEndPos, Vector3 sOut); 27 | bool32 MultiPlane(Vector3 sPos); 28 | float MultiPlanef(Vector3 sPos); 29 | CPlane* Set(Vector3 v, float fConstant); 30 | CPlane* Normalize(); 31 | CPlane* SetComponents(float x, float y, float z, float w); 32 | CPlane* SetFromNormalAndCoplanarPoint(Vector3 normal, Vector3 point); 33 | CPlane* SetFromCoplanarPoints(Vector3 a, Vector3 b, Vector3 c); 34 | //CPlane* Copy( CPlane* p ); 35 | float DistanceToPoint(Vector3 point); 36 | public: 37 | Vector3 m_tNormal; 38 | float m_fConstant; 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /standard/planematerial.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: planematerial.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_PLANEMATERIAL_H__ 16 | #define __STANDARD_PLANEMATERIAL_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | class CPlaneMaterial: public CMaterial{ 24 | public: 25 | CPlaneMaterial( float fWidth, float fHeight ); 26 | virtual ~CPlaneMaterial(); 27 | virtual void Init(); 28 | virtual void Begin(); 29 | virtual void End(); 30 | virtual void SetDiffuseTexture(CTexture* pTexture); 31 | void RenderText( float x, float y, const char* strText, color32 c, int32 nStyle, color32 bk ); 32 | void SetTexture( CTexture* pTexture ); 33 | void SetPosition( float x, float y, float z ); 34 | void SetColor( float r, float g, float b, float a ); 35 | void SetBright( float v ); 36 | void SetViewSize( float fWidth, float fHeight ); 37 | void SetScale( float x, float y, float z ); 38 | 39 | private: 40 | HMATERIALUNIFORM m_hMapAttributeHandle; 41 | HMATERIALUNIFORM m_hViewSizeAttributeHandle; 42 | HMATERIALUNIFORM m_hTranslateAttributeHandle; 43 | HMATERIALUNIFORM m_hColorAttributeHandle; 44 | HMATERIALUNIFORM m_hBrightAttributeHandle; 45 | HMATERIALUNIFORM m_hScaleAttributeHandle; 46 | CVector3 m_tViewSize; 47 | 48 | }; 49 | 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /standard/popmenu.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: popmenu.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_POPMENU_H__ 16 | #define __STANDARD_POPMENU_H__ 17 | 18 | #include 19 | 20 | #define POPMENUITEMHEIGHT (26) 21 | 22 | struct SPopMenuInfo{ 23 | char m_strCaption[64]; 24 | bool32 m_bEnable; 25 | int32 m_nID; 26 | int32 m_nUserData0; 27 | int32 m_nUserData1; 28 | int32 m_nUserData2; 29 | int32 m_nUserData3; 30 | }; 31 | 32 | 33 | class CPopMenu: public CPanel, public CUIEvent{ 34 | public: 35 | static void SetMenuInfo( SPopMenuInfo* pMenuInfo, const char* strCaption, bool32 bEnable, int32 nID, int32 nCmd ); 36 | static void OpenPopMenu( int32 x, int32 y, CUIEvent* pEventObject, SPopMenuInfo* pMenuInfo, int32 nItemWidth = 100 ); 37 | CPopMenu(); 38 | virtual ~CPopMenu(); 39 | void Init( int32 x, int32 y, SPopMenuInfo* pMenuInfo, int32 nItemWidth ); 40 | 41 | private: 42 | virtual void OnClick( CUIElement *pSelf ); 43 | virtual void OnMouseEvent( CUIElement *pSelf, EUIMouseMessage eMouseMessage, int32 x, int32 y, int32 z, int32 s ); 44 | void Close(); 45 | 46 | CUIEvent* m_pEventObject; 47 | CPanel* m_pMenuPanel; 48 | 49 | }; 50 | 51 | 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /standard/quaternion.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: quaternion.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_QUATERNION_H__ 16 | #define __STANDARD_QUATERNION_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | //#include 22 | class CMatrix4; 23 | class CQuaternion{ 24 | public: 25 | CQuaternion(); 26 | CQuaternion( float x, float y, float z, float w ); 27 | ~CQuaternion(); 28 | //Quaternion GetData(); 29 | void Set( float x, float y, float z, float w ){ 30 | X = x, Y = y, Z = z, W = w; 31 | } 32 | void Set( CQuaternion& q ){ 33 | X = q.X, Y = q.Y, Z = q.Z, W = q.W; 34 | } 35 | void SetEuler( float x, float y, float z ); 36 | void GetEuler( float *x, float *y, float *z ); 37 | CQuaternion* SetFromRotationMatrix( CMatrix4* m ); 38 | CQuaternion& SetFromUnitVectors( CVector3 &vFrom, CVector3 &vTo ); 39 | CQuaternion& Inverse(); 40 | float Dot( CQuaternion& q ); 41 | CQuaternion& Normalize(); 42 | float Length(); 43 | 44 | float X, Y, Z, W; 45 | }; 46 | 47 | 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /standard/quicksort.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1991-2018 Free Software Foundation, Inc. 2 | This file is part of the GNU C Library. 3 | Written by Douglas C. Schmidt (schmidt@ics.uci.edu). 4 | The GNU C Library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | The GNU C Library is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | Lesser General Public License for more details. 12 | You should have received a copy of the GNU Lesser General Public 13 | License along with the GNU C Library; if not, see 14 | . */ 15 | 16 | /* If you consider tuning this algorithm, you should consult first: 17 | Engineering a sort function; Jon Bentley and M. Douglas McIlroy; 18 | Software - Practice and Experience; Vol. 23 (11), 1249-1265, 1993. */ 19 | 20 | //#include 21 | #ifndef __QUICKSORT_H__ 22 | #define __QUICKSORT_H__ 23 | 24 | typedef int(*__compar_d_fn_t)(const void*, const void*, void*); 25 | 26 | #define _qsort _quicksort 27 | 28 | void _quicksort(void* const pbase, size_t total_elems, size_t size, __compar_d_fn_t cmp, void* arg); 29 | 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /standard/raycaster.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: raycaster.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | #ifndef __STANDARD_RAYCASTER_H__ 15 | #define __STANDARD_RAYCASTER_H__ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | 23 | class CRaycaster { 24 | public: 25 | CRaycaster(); 26 | ~CRaycaster(); 27 | void SetRay(Vector3 origin, Vector3 direction, float fNear, float fFar); 28 | float Intersect( Matrix4 pWorldMatrix, void *pVert, int32 stride, int32 nVert, Vector3 pRet ); 29 | float Intersect( Matrix4 pWorldMatrix, void *pVert, int32 stride, void* pIndex, int32 nIndexElementSize, int32 nIndex, Vector3 pRet ); 30 | 31 | Vector3 m_sOrigin; 32 | Vector3 m_sDirection; 33 | float m_fNear; 34 | float m_fFar; 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /standard/reference.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/standard/reference.h -------------------------------------------------------------------------------- /standard/remotefiletask.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: remotefiletask.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_REMOTEFILETASK_H__ 16 | #define __STANDARD_REMOTEFILETASK_H__ 17 | 18 | #include 19 | #include 20 | 21 | class CRemoteFileTask; 22 | class CRemoteFileTaskEvent{ 23 | public: 24 | virtual void OnComplate( CRemoteFileTask* pRemoteFileTask, void* pData, int32 nSize ); 25 | virtual void OnError( CRemoteFileTask* pRemoteFileTask, void* pData, int32 nSize ); 26 | virtual void OnProcess( CRemoteFileTask* pRemoteFileTask, int32 nCur, int32 nMax ); 27 | }; 28 | 29 | class CRemoteFileTask{ 30 | public: 31 | CRemoteFileTask( const char* strURL ); 32 | CRemoteFileTask( const char* strURL, void* pBuff, int32 nBuffSize ); 33 | virtual ~CRemoteFileTask(); 34 | int32 m_nMaskType; 35 | CRemoteFileTaskEvent* OnRemoteFileTaskObject; 36 | REMOTEFILEHANDLE m_hRemoteFileTaskHandle; 37 | int32 m_nID; 38 | void* m_pUserData0; 39 | void* m_pUserData1; 40 | void* m_pUserData2; 41 | void* m_pUserData3; 42 | 43 | }; 44 | 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /standard/renderbuffer.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: renderbuffer.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_RENDERBUFFER_H__ 16 | #define __STANDARD_RENDERBUFFER_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | 24 | void Vertex_Set( TV3C1 *pVert, float x, float y, float z, color32 c ); 25 | void Vertex_Set( TV3C1T2 *pVert, float x, float y, float z, color32 c, float u, float v ); 26 | void Vertex_Set(TV3C4FT2 *pVert, float x, float y, float z, float r, float g, float b, float a, float u, float v); 27 | 28 | 29 | 30 | class CVertexBuffer; 31 | class CIndexBuffer: public CRefObject{ 32 | public: 33 | CIndexBuffer( void* pIndexData, int32 nCount, bool32 bDynamic, int32 nElementDataSize ); 34 | ~CIndexBuffer(); 35 | void UpdateBuffer( void* pIndexData, int32 nCount ); 36 | 37 | public: 38 | HINDEXBUFFERHANDLE m_hIndexBufferHandle; 39 | }; 40 | 41 | class CVertexBuffer: public CRefObject{ 42 | public: 43 | CVertexBuffer( _EVERTEXTYPE eVertexType, void* pVertexData, int32 nVertexCount, bool32 bDynamic ); 44 | ~CVertexBuffer(); 45 | void UpdateBuffer( void* pVertexData, int32 nCount ); 46 | void Render( _EPRIMITIVETYPE ePrimitiveType ); 47 | void Render( _EPRIMITIVETYPE ePrimitiveType, CIndexBuffer* pIndexBuffer ); 48 | 49 | public: 50 | HVERTEXBUFFERHANDLE m_hVertexBufferHandle; 51 | }; 52 | 53 | 54 | class CRenderDataBuffer: public CRefObject{ 55 | public: 56 | CRenderDataBuffer(); 57 | ~CRenderDataBuffer(); 58 | void Render( _EPRIMITIVETYPE ePrimitiveType ); 59 | void Reset(); 60 | bool32 Vaild(); 61 | 62 | bool32 CanUpdateVertex(void* pData, int32 nDataSize); 63 | int32 GetVertexCount(); 64 | bool32 SetVertexData( TV3C1T2* pData, int32 nCount ); 65 | bool32 SetVertexData( TV3C4FT2* pData, int32 nCount ); 66 | TV3C1T2* GetVertexV3C1T2(); 67 | TV3C4FT2* GetVertexV3C4FT2(); 68 | bool32 UpdateVertexData(); 69 | bool32 AddVertexData( TV3C1T2* pData, int32 nCount ); 70 | bool32 AddVertexData( TV3C4FT2* pData, int32 nCount ); 71 | 72 | 73 | int32 GetIndexCount(); 74 | bool32 SetIndexData( uint16* pData, int32 nCount ); 75 | bool32 SetIndexData( int32* pData, int32 nCount ); 76 | uint16* GetIndexUint16(); 77 | int32* GetIndexInt32(); 78 | bool32 UpdateIndexData(); 79 | bool32 AddIndexData( uint16* pData, int32 nCount ); 80 | bool32 AddIndexData( int32* pData, int32 nCount ); 81 | 82 | public: 83 | CVertexBuffer* m_pVertexBuffer; 84 | CIndexBuffer* m_pIndexBuffer; 85 | 86 | _EVERTEXTYPE m_eVertexType; 87 | vectorm_vVertexData; 88 | int32 m_nVertexCount; 89 | 90 | bool32 m_bIndexIsInt32; 91 | vectorm_vIndexData; 92 | int32 m_nIndexCount; 93 | }; 94 | 95 | 96 | #endif 97 | -------------------------------------------------------------------------------- /standard/resourcemanager.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: resourcemanager.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2021 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | #ifndef __STANDARD_RESOURCEMANAGER_H__ 15 | #define __STANDARD_RESOURCEMANAGER_H__ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | class CMaterial; 23 | class CIndexBuffer; 24 | class CVertexBuffer; 25 | class CRenderDataBuffer; 26 | 27 | struct SResourceItem{ 28 | Ref m_sItemsData; 29 | int32 m_nRefCount; 30 | }; 31 | 32 | class CResourceManager{ 33 | private: 34 | 35 | public: 36 | static CResourceManager* GetInterface(); 37 | static void Destroy(); 38 | CResourceManager(); 39 | ~CResourceManager(); 40 | void Clear(); 41 | int32 RemoveObject( CRefObject* pObj ); 42 | int32 RemoveObject( uint32 nGUID ); 43 | CTexture* GetTexture( const char* strFileName, ETextureWrapModes eWrapS = RepeatWrapping, ETextureWrapModes eWrapT = RepeatWrapping, ETextureFilters eMagFilter = LinearFilter, ETextureFilters eMinFilter = LinearFilter, bool32 bGenerateMipmaps = False ); 44 | uint32 AddObject( CRefObject* pObj ); 45 | CRefObject* GetRefObject( uint32 nGUID ); 46 | //template 47 | //T* GetObject( uint32 nGUID ); 48 | 49 | private: 50 | mapm_vResourceList; 51 | uint32 m_nResourceGUID; 52 | }; 53 | 54 | #define RESOURCE_ADD( p )CResourceManager::GetInterface()->AddObject( p ); 55 | #define RESOURCE_GETTEXTURE( file )CResourceManager::GetInterface()->GetTexture( file ); 56 | #define RESOURCE_REMOVE( p )CResourceManager::GetInterface()->RemoveObject( p ); p = NULL; 57 | 58 | 59 | //template 60 | //T* CResourceManager::GetObject( uint32 nGUID ){ 61 | // T* _pObject = (T*)GetRefObject( nGUID ); 62 | // return _pObject; 63 | //} 64 | 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /standard/safedata.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/standard/safedata.h -------------------------------------------------------------------------------- /standard/scrolledpanel.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: scrolledpanel.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2021 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_SCROLLEDPANEL_H__ 16 | #define __STANDARD_SCROLLEDPANEL_H__ 17 | 18 | #include 19 | #include 20 | 21 | class CScrollBar: public CPanel, public CUIEvent{ 22 | public: 23 | CScrollBar( int32 x, int32 y, int32 width, int32 height ); 24 | virtual ~CScrollBar(); 25 | void SetScrollLength( int32 nLength ); 26 | void SetScrollValue( int32 nValue ); 27 | CDelegate3OnScrolled; 28 | 29 | private: 30 | virtual void OnClick(CUIElement* pSelf); 31 | virtual void OnMouseEvent(CUIElement* pSelf, EUIMouseMessage eMouseMessage, int32 x, int32 y, int32 z, int32 s); 32 | void UpdateSliderSize(); 33 | int32 m_vBound[4]; 34 | int32 m_nScorllLength; 35 | int32 m_nScrollValue; 36 | int32 m_nScrollStep; 37 | CButton* m_pUpBtn; 38 | CButton* m_pDownBtn; 39 | CPanel* m_pSliderBtn; 40 | 41 | }; 42 | 43 | class CScrolledPanel: public CTranslatePanel, public CUIEvent, public IDelegateInterface{ 44 | public: 45 | CScrolledPanel(int32 x, int32 y, int32 width, int32 height); 46 | virtual ~CScrolledPanel(); 47 | virtual void AddElement(CUIElement* pElement); 48 | void SetContainerSize(int32 nContainerWidth, int32 nContainerHeight); 49 | private: 50 | virtual void OnMouseEvent(CUIElement* pSelf, EUIMouseMessage eMouseMessage, int32 x, int32 y, int32 z, int32 s); 51 | void MoveComponentOffset(CUIElement* p, int32 x, int32 y); 52 | void OnScrollValue(CScrollBar* pSelf, int32 nValue, int32 nOffset ); 53 | CPanel* m_pRootNode; 54 | CScrollBar* m_pScrollBar; 55 | 56 | float m_fMoveOffsetY; 57 | }; 58 | 59 | 60 | #endif 61 | 62 | -------------------------------------------------------------------------------- /standard/spherical.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/standard/spherical.h -------------------------------------------------------------------------------- /standard/stream.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: system.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | #ifndef __STANDARD_STREAM_H__ 15 | #define __STANDARD_STREAM_H__ 16 | 17 | #include 18 | 19 | class CStream{ 20 | public: 21 | CStream(); 22 | virtual ~CStream(); 23 | void SetPos( int32 n ){ m_nPos = n; } 24 | void Skip( int32 n ){ m_nPos += n; } 25 | int32 GetSize(){ return m_nSize; } 26 | int32 GetPos(){ return m_nPos; } 27 | byte* GetCur(){ return m_pData + m_nPos; } 28 | byte* GetData(){ return m_pData; } 29 | bool32 Eof(); 30 | bool32 Read( object32 pBuf, int32 nSize ); 31 | int32 ReadString0( char* v ); 32 | int32 ReadString1( char* v ); 33 | CStream& operator >> ( int8 &v ); 34 | CStream& operator >> ( uint8 &v ); 35 | CStream& operator >> ( int16 &v ); 36 | CStream& operator >> ( uint16 &v ); 37 | CStream& operator >> ( int32 &v ); 38 | CStream& operator >> ( uint32 &v ); 39 | //CStream& operator >> ( bool32 &v ); 40 | CStream& operator >> ( float &v ); 41 | // CStream& operator >> ( bool &v ); 42 | //CStream& operator >> ( char* &v ); 43 | 44 | bool32 Write( object32 pBuf, int32 nSize ); 45 | int32 WriteString0( char* v ); 46 | int32 WriteString1( char* v ); 47 | CStream& operator << ( int8 &v ); 48 | CStream& operator << ( uint8 &v ); 49 | CStream& operator << ( int16 &v ); 50 | CStream& operator << ( uint16 &v ); 51 | CStream& operator << ( int32 &v ); 52 | CStream& operator << ( uint32 &v ); 53 | //CStream& operator << ( bool32 &v ); 54 | CStream& operator << ( float &v ); 55 | // CStream& operator << ( bool &v ); 56 | //CStream& operator << ( char* &v ); 57 | 58 | protected: 59 | int32 m_nSize; 60 | int32 m_nPos; 61 | byte* m_pData; 62 | 63 | }; 64 | 65 | class CDataStream: public CStream{ 66 | public: 67 | CDataStream(); 68 | CDataStream( int32 nSize ); 69 | CDataStream( void* pData, int32 nSize, bool32 bCopy ); 70 | virtual ~CDataStream(); 71 | void SetData( void* pData, int32 nSize, bool32 bCopy ); 72 | 73 | protected: 74 | bool32 m_bCopyMemory; 75 | }; 76 | 77 | class CFileStream: public CStream{ 78 | public: 79 | CFileStream( const char* strFileName ); 80 | virtual ~CFileStream(); 81 | void Close(); 82 | protected: 83 | char m_strFileName[256]; 84 | 85 | }; 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /standard/string.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/standard/string.h -------------------------------------------------------------------------------- /standard/system.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: system.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_SYSTEM_H__ 16 | #define __STANDARD_SYSTEM_H__ 17 | 18 | #include 19 | #include 20 | 21 | void *__vec_new( void *op, int number, int size, void *f ); 22 | void __vec_delete( void *op, int n, int sz, void *f, int del, int x ); 23 | 24 | int Base64Encode( const byte *bindata, int binlength, char *base64 ); 25 | int Base64Decode( const char *base64, byte *bindata ); 26 | uint32 HashString( const char* strText ); 27 | bool StrIsInteger( const char* sStr ); 28 | bool StrIsPositiveInteger( const char* sStr ); 29 | bool StrIsNumber( const char* sStr ); 30 | bool SafeStrToInteger( const char* sStr, int32 *pValue ); 31 | bool SafeStrToPositiveInteger( const char* sStr, int32 *pValue ); 32 | bool SafeStrToNumber( const char* sStr, float *pValue ); 33 | color32 StrToColor32( const char* s ); 34 | int32 StrToInt( const char* s ); 35 | bool StrToInt2( const char* s, const char* s0, int32* n0, int32* n1 ); 36 | bool StrToInt3( const char* s, const char* s0, int32* n0, int32* n1, int32* n2 ); 37 | bool StrToInt4( const char* s, const char* s0, int32* n0, int32* n1, int32* n2, int32* n3 ); 38 | float StrToFloat( const char* s ); 39 | bool StrToFloat2( const char* s, const char* s0, float* f0, float* f1 ); 40 | bool StrToFloat3( const char* s, const char* s0, float* f0, float* f1, float* f2 ); 41 | bool StrToFloat4( const char* s, const char* s0, float* f0, float* f1, float* f2, float* f3 ); 42 | uint32 ReverseUint32( char a, char b, char c, char d ); 43 | char* NewString( const char* strRes ); 44 | int32 GetToken( char* strText, char* strBuff ); 45 | 46 | //file="subdir1/subdir2/myImage.jpg" 47 | void GetPathToFileName( const char* strFilePathName, char* strResult ); //return subdir1_subdir2_myImage.jpg 48 | void GetFileName( const char* strFilePathName, char* strResult ); //ret myImage.jpg 49 | void GetFileNamePath( const char* strFilePathName, char* strResult ); //ret subdir1/subdir2 50 | void GetFileNameFile( const char* strFilePathName, char* strResult ); //ret myImage 51 | void GetFileNameType( const char* strFilePathName, char* strResult ); //ret jpg 52 | 53 | uint32 GetFileExt(const char* strFileName); 54 | 55 | 56 | 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /standard/tabpanel.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: tabpanel.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2021 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | #ifndef __STANDARD_TABLEPANEL_H__ 15 | #define __STANDARD_TABLEPANEL_H__ 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | struct STabPage{ 22 | CButton* m_pButton; 23 | CScrollView* m_pPanel; 24 | }; 25 | 26 | class CTabPanel: public CTranslatePanel, public CUIEvent{ 27 | public: 28 | CTabPanel( int32 x, int32 y, int32 width, int32 height, char** ppCaption, int32 nButtonWidth, int32 nButtonHeight ); 29 | virtual ~CTabPanel(); 30 | CScrollView* GetTabPage( int32 nIndex ); 31 | int32 GetPageCount(); 32 | bool32 SetPage(int32 nIndex); 33 | CDelegate2 OnTabPageChange; 34 | 35 | private: 36 | virtual void OnClick(CUIElement* pSelf); 37 | 38 | vectorm_vTabPageList; 39 | }; 40 | 41 | 42 | #endif 43 | 44 | -------------------------------------------------------------------------------- /standard/task.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: task.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_TASK_H__ 16 | #define __STANDARD_TASK_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | class ITask{ 23 | public: 24 | ITask(); 25 | virtual ~ITask(); 26 | virtual int32 UpdateTask( float fDelta ); 27 | virtual int32 Stop(); 28 | virtual void OnMouseEvent( EUIMouseMessage eMouseMessage, int32 x, int32 y ); 29 | virtual void OnKeyEvent( EUIKeyMessage eKeyMessage, int32 nKey ); 30 | void SetActive( bool32 v ); 31 | uint32 pt1; 32 | uint32 m_tCoroTimer; 33 | bool32 m_bActive; 34 | }; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /standard/taskmanager.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: taskmanager.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_TASKMANAGER_H__ 16 | #define __STANDARD_TASKMANAGER_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | class ITask; 23 | class CTaskManager{ 24 | public: 25 | static CTaskManager* GetInterface(); 26 | static void AddTask( ITask *pTask ); 27 | CTaskManager(); 28 | ~CTaskManager(); 29 | void _AddTask( ITask *pTask ); 30 | void _RemoveTask( ITask* pTask ); 31 | void Update( float fDelta ); 32 | void OnMouseEvent( EUIMouseMessage eMouseMessage, int32 x, int32 y ); 33 | void OnKeyEvent( EUIKeyMessage eKeyMessage, int32 nKey ); 34 | 35 | private: 36 | void Clear(); 37 | list m_vTaskList; 38 | }; 39 | 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /standard/texture.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: texture.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_TEXTURE_H__ 16 | #define __STANDARD_TEXTURE_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | //#define NEAREST (9728) 23 | //#define LINEAR (9729) 24 | //#define NEAREST_MIPMAP_NEAREST (9984) 25 | //#define LINEAR_MIPMAP_NEAREST (9985) 26 | //#define NEAREST_MIPMAP_LINEAR (9986) 27 | //#define LINEAR_MIPMAP_LINEAR (9987) 28 | // 29 | //#define TEXTURE_MAG_FILTER (10240) 30 | //#define TEXTURE_MIN_FILTER (10241) 31 | //#define TEXTURE_WRAP_S (10242) 32 | //#define TEXTURE_WRAP_T (10243) 33 | // 34 | //#define CLAMP (10496) 35 | //#define REPEAT (10497) 36 | //#define MIRRORED_REPEAT (33648) 37 | 38 | // Wrapping modes 39 | enum ETextureWrapModes{ 40 | RepeatWrapping, 41 | ClampToEdgeWrapping, 42 | MirroredRepeatWrapping, 43 | }; 44 | 45 | // Filters 46 | enum ETextureFilters{ 47 | NearestFilter, 48 | NearestMipMapNearestFilter, 49 | NearestMipMapLinearFilter, 50 | LinearFilter, 51 | LinearMipMapNearestFilter, 52 | LinearMipMapLinearFilter, 53 | }; 54 | 55 | class CTexture: public CRefObject{ 56 | public: 57 | CTexture(); 58 | virtual ~CTexture(); 59 | int32 GetWidth(); 60 | int32 GetHeight(); 61 | void SetParame( int32 nParame, int32 nValue ); 62 | void* GetTextureData(); 63 | 64 | HTEXTUREHANDLE m_hTextureHandle; 65 | int32 m_nWidth; 66 | int32 m_nHeight; 67 | }; 68 | 69 | 70 | 71 | 72 | #endif 73 | 74 | -------------------------------------------------------------------------------- /standard/texturebuffer.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: texturebuffer.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_TEXTUREBUFFER_H__ 16 | #define __STANDARD_TEXTUREBUFFER_H__ 17 | 18 | #include 19 | #include 20 | 21 | class CTextureBuffer: public CTexture{ 22 | public: 23 | CTextureBuffer( int32 nWidth, int32 nHeight, int32 nChannel, void* pPixelData, ETextureWrapModes eWrapS = RepeatWrapping, ETextureWrapModes eWrapT = RepeatWrapping, ETextureFilters eMagFilter = LinearFilter, ETextureFilters eMinFilter = LinearFilter, bool32 bGenerateMipmaps = False ); 24 | virtual ~CTextureBuffer(); 25 | virtual void Update( void* pPixelData ); 26 | 27 | }; 28 | 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /standard/texturefile.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: texturefile.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_TEXTUREFILE_H__ 16 | #define __STANDARD_TEXTUREFILE_H__ 17 | 18 | #include 19 | #include 20 | 21 | class CTextureFile: public CTexture{ 22 | public: 23 | CTextureFile( const char* strFileName, ETextureWrapModes eWrapS = RepeatWrapping, ETextureWrapModes eWrapT = RepeatWrapping, ETextureFilters eMagFilter = LinearFilter, ETextureFilters eMinFilter = LinearFilter, bool32 bGenerateMipmaps = False ); 24 | //CTextureFile( CStream* pStream ); 25 | virtual ~CTextureFile(); 26 | public: 27 | char m_strFileName[128]; 28 | }; 29 | 30 | void SaveToTga( const char* strFileName, void* pData, int32 nWidth, int32 nHeight, int32 nChannel ); 31 | 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /standard/texturepack.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: texturepack.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_TEXTUREPACK_H__ 16 | #define __STANDARD_TEXTUREPACK_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | class CTexturePack: public CTexture { 24 | public: 25 | CTexturePack( const char* strFileName, ETextureWrapModes eWrapS = RepeatWrapping, ETextureWrapModes eWrapT = RepeatWrapping, ETextureFilters eMagFilter = LinearFilter, ETextureFilters eMinFilter = LinearFilter, bool32 bGenerateMipmaps = False ); 26 | virtual ~CTexturePack(); 27 | virtual void SetParame(int32 nParame, int32 nValue); 28 | CTexture* GetTexture(int32 nFrame); 29 | void Init(void* pData); 30 | 31 | int32 m_nBlendType; 32 | bool32 m_bTranslate; 33 | float m_fTranslateX; 34 | float m_fTranslateY; 35 | bool32 m_bRotation; 36 | float m_fRotAngle; 37 | bool32 m_bScale; 38 | int32 m_fScaleFunc; 39 | float m_vScaleArg[4]; 40 | bool32 m_bAlpha; 41 | int32 m_fAlphaFunc; 42 | float m_vAlphaArg[4]; 43 | int32 m_nFrame; 44 | float m_fFrameSpeed; 45 | vector m_vTextureFrame; 46 | }; 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /standard/texturetarget.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: texturetarget.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_TEXTURETARGET_H__ 16 | #define __STANDARD_TEXTURETARGET_H__ 17 | 18 | #include 19 | #include 20 | 21 | 22 | class CTextureTarget: public CTexture{ 23 | public: 24 | CTextureTarget( int32 nWidth, int32 nHeight, bool32 bColor, bool32 bDepth, ETextureWrapModes eWrapS = RepeatWrapping, ETextureWrapModes eWrapT = RepeatWrapping, ETextureFilters eMagFilter = LinearFilter, ETextureFilters eMinFilter = LinearFilter, bool32 bGenerateMipmaps = False ); 25 | virtual ~CTextureTarget(); 26 | void BeginRender( int32 nViewportWidth, int32 nViewportHeight ); 27 | void EndRender(); 28 | void Clear(); 29 | 30 | }; 31 | 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /standard/toast.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: toast.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_TOAST_H__ 16 | #define __STANDARD_TOAST_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | class CToast: public CTranslateNode{ 23 | public: 24 | class CToastTask: public ITask{ 25 | public: 26 | CToastTask( CToast* pToast ); 27 | virtual ~CToastTask(); 28 | virtual int32 UpdateTask( float fDelta ); 29 | 30 | private: 31 | CToast* m_pToast; 32 | }; 33 | 34 | public: 35 | CToast( float x, float y ); 36 | virtual ~CToast(); 37 | void Close(); 38 | virtual int32 UpdateToast( float fDelta ); 39 | 40 | protected: 41 | void UpdatePos( float x, float y ); 42 | float m_fX, m_fY; 43 | 44 | }; 45 | 46 | class CMessageToast: public CToast{ 47 | public: 48 | CMessageToast( int32 x, int32 y, const char* strText ); 49 | virtual ~CMessageToast(); 50 | // virtual int32 UpdateTask( float fDelta ); 51 | virtual int32 UpdateToast( float fDelta ); 52 | private: 53 | void UpdatePos( float fDelta ); 54 | CLable* m_pTextLB; 55 | float m_fSpeed; 56 | float m_fTime; 57 | }; 58 | 59 | 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /standard/trace.h: -------------------------------------------------------------------------------- 1 | #ifndef __STANDARD_TRACE_H__ 2 | #define __STANDARD_TRACE_H__ 3 | 4 | 5 | #if defined(_APP_DEBUG_ ) && !defined(__NOTRACE__) 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | struct STrackInfo{ 12 | char m_strFuncName[48]; 13 | byte m_vParameData[128]; 14 | int32 m_nAddress; 15 | }; 16 | 17 | struct STrackFuncInfo{ 18 | char m_strFuncName[48]; 19 | uint32 m_nHashCode; 20 | uint32 m_nCallCount; 21 | uint32 m_nCallRunTime; 22 | }; 23 | 24 | class CGreyTrace{ 25 | public: 26 | static void Destroy(); 27 | static void OutTrackState(); 28 | static uint32 __HashString( const char* strText ); 29 | static list* m_vTrackInfo; 30 | static map* m_vTrackFuncInfo; 31 | static bool32 m_bGreyTraceLocked; 32 | CGreyTrace( const char* strFuncName ); 33 | ~CGreyTrace(); 34 | private: 35 | uint32 m_nHashCode; 36 | uint32 m_nCallTime; 37 | }; 38 | 39 | 40 | #define TRACE CGreyTrace ___trace___info___( __FUNCTION__ ) 41 | #define TRACESTR( s ) CGreyTrace ___trace___info___( s ) 42 | #define TRACKOUT CGreyTrace::OutTrackState() 43 | #define TRACEDESTROY CGreyTrace::Destroy(); 44 | 45 | #define TRACEENABLE 1 46 | 47 | #else 48 | 49 | #define TRACE 50 | #define TRACESTR( s ) 51 | #define SETTRACE( v ) 52 | #define TRACKOUT 53 | #define TRACEDESTROY 54 | 55 | #define TRACEENABLE 0 56 | 57 | #endif 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /standard/translatematerial.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: translatematerial.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_TRANSLATEMATERIAL_H__ 16 | #define __STANDARD_TRANSLATEMATERIAL_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | //BeginClass( CTranslateMatieral ) 23 | //#define CTranslateMatieral__Data \ 24 | //CMatieral__Data \ 25 | //HMATERIALUNIFORM m_nUniformProjectionViewMatrix;\ 26 | //HMATERIALUNIFORM m_nUniformModelMatrix;\ 27 | //HMATERIALUNIFORM m_nUniformPosition;\ 28 | //HMATERIALUNIFORM m_nUniformRotation;\ 29 | //HMATERIALUNIFORM m_nUniformScale;\ 30 | //HMATERIALUNIFORM m_nUniformDiffuseColor;\ 31 | //HMATERIALUNIFORM m_nUniformDiffuseMap; 32 | //#define CTranslateMatieral__Func \ 33 | //CMatieral__Func \ 34 | //MemberFunc( CTranslateMatieral, Init )\ 35 | //MemberFunc( CTranslateMatieral, SetProjViewMatrix )\ 36 | //MemberFunc( CTranslateMatieral, SetModelMatrix )\ 37 | //MemberFunc( CTranslateMatieral, SetTranslate )\ 38 | //MemberFunc( CTranslateMatieral, SetRotation )\ 39 | //MemberFunc( CTranslateMatieral, SetScale )\ 40 | //MemberFunc( CTranslateMatieral, SetTexture )\ 41 | //MemberFunc( CTranslateMatieral, SetColor ) 42 | //DeclareFunc0( CTranslateMatieral, Init, bool32 ) 43 | //DeclareFunc1( CTranslateMatieral, SetProjViewMatrix, bool32, Matrix4 ) 44 | //DeclareFunc1( CTranslateMatieral, SetModelMatrix, bool32, Matrix4 ) 45 | //DeclareFunc2( CTranslateMatieral, SetTranslate, bool32, float, float ) 46 | //DeclareFunc1( CTranslateMatieral, SetRotation, bool32, float ) 47 | //DeclareFunc2( CTranslateMatieral, SetScale, bool32, float, float ) 48 | //DeclareFunc1( CTranslateMatieral, SetTexture, bool32, HTEXTUREHANDLE ) 49 | //DeclareFunc4( CTranslateMatieral, SetColor, bool32, float, float, float, float ) 50 | //EndClass( CTranslateMatieral ) 51 | 52 | 53 | //// 54 | //// 55 | ////DeclareClass( CTranslateMatieral ) 56 | ////DeclareFunc0( CTranslateMatieral, Init, bool32 ) 57 | ////DeclareFunc0( CTranslateMatieral, Begin, bool32 ) 58 | ////DeclareFunc0( CTranslateMatieral, End, bool32 ) 59 | ////DeclareFunc1( CTranslateMatieral, SetProjViewMatrix, bool32, Matrix4 ) 60 | ////DeclareFunc1( CTranslateMatieral, SetModelMatrix, bool32, Matrix4 ) 61 | ////DeclareFunc2( CTranslateMatieral, SetTranslate, bool32, float, float ) 62 | ////DeclareFunc1( CTranslateMatieral, SetRotation, bool32, float ) 63 | ////DeclareFunc2( CTranslateMatieral, SetScale, bool32, float, float ) 64 | ////DeclareFunc1( CTranslateMatieral, SetTexture, bool32, HTEXTUREHANDLE ) 65 | ////DeclareFunc4( CTranslateMatieral, SetColor, bool32, float, float, float, float ) 66 | //// 67 | //// 68 | //////--------------------------------------------------------------------- 69 | ////ClassBegin( CTranslateMatieral, CMatierlaObj ) 70 | ////HMATERIALUNIFORM m_nUniformProjectionViewMatrix; 71 | ////HMATERIALUNIFORM m_nUniformModelMatrix; 72 | ////HMATERIALUNIFORM m_nUniformPosition; 73 | ////HMATERIALUNIFORM m_nUniformRotation; 74 | ////HMATERIALUNIFORM m_nUniformScale; 75 | ////HMATERIALUNIFORM m_nUniformDiffuseColor; 76 | ////HMATERIALUNIFORM m_nUniformDiffuseMap; 77 | ////DefineMember( CTranslateMatieral, Init ) 78 | ////DefineMember( CTranslateMatieral, Begin ) 79 | ////DefineMember( CTranslateMatieral, End ) 80 | ////DefineMember( CTranslateMatieral, SetProjViewMatrix ) 81 | ////DefineMember( CTranslateMatieral, SetModelMatrix ) 82 | ////DefineMember( CTranslateMatieral, SetTranslate ) 83 | ////DefineMember( CTranslateMatieral, SetRotation ) 84 | ////DefineMember( CTranslateMatieral, SetScale ) 85 | ////DefineMember( CTranslateMatieral, SetTexture ) 86 | ////DefineMember( CTranslateMatieral, SetColor ) 87 | ////ClassEnd( CTranslateMatieral, CMatierlaObj ) 88 | 89 | 90 | #endif 91 | 92 | -------------------------------------------------------------------------------- /standard/treeview.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: treeview.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2021 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_TREEVIEW_H__ 16 | #define __STANDARD_TREEVIEW_H__ 17 | 18 | #include 19 | 20 | class CTreeView: public CListView{ 21 | public: 22 | CTreeView(int32 x, int32 y, int32 width, int32 height); 23 | virtual ~CTreeView(); 24 | 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /standard/vector2.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: vector2.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_VECTOR2_H__ 16 | #define __STANDARD_VECTOR2_H__ 17 | 18 | #include 19 | 20 | class CVector2 { 21 | public: 22 | CVector2(); 23 | CVector2(float x, float y); 24 | ~CVector2(); 25 | float* GetData(); 26 | void Set(float x, float y) { 27 | m[0] = x, m[1] = y; 28 | } 29 | void Set(CVector2 &v) { 30 | m[0] = v.m[0], m[1] = v.m[1]; 31 | } 32 | CVector2& SubVectors(CVector2 &a, CVector2 &b); 33 | CVector2& MultiplyScalar(float s); 34 | 35 | float m[2]; 36 | }; 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /standard/vector4.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: vector4.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_VECTOR4_H__ 16 | #define __STANDARD_VECTOR4_H__ 17 | 18 | #include 19 | 20 | class CVector4 { 21 | public: 22 | CVector4(); 23 | CVector4(float x, float y, float z, float w); 24 | ~CVector4(); 25 | float* GetData(); 26 | void Set(float x, float y, float z, float w) { 27 | X = x, Y = y, Z = z, W = w; 28 | } 29 | //union { 30 | // float m[4]; 31 | // struct { 32 | float X, Y, Z, W; 33 | // }; 34 | //}; 35 | }; 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /standard/wordfilter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grey-platform/gdk/cc3c1060f0e4d241003c37019fd495a7545157c1/standard/wordfilter.h -------------------------------------------------------------------------------- /standard/xml.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | *Copyright,2018-2028,Longyou 3 | *FileName: xml.h 4 | *Module: standard 5 | *Author: DaXiang 6 | *Version: 1.0 7 | *Date: 2020 8 | *Description: 9 | *Others: 10 | *Function List: 11 | *History: 12 | **********************************************************************************/ 13 | 14 | 15 | #ifndef __STANDARD_XML_H__ 16 | #define __STANDARD_XML_H__ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | class CXML{ 23 | public: 24 | CXML( const char* strText ); 25 | virtual ~CXML(); 26 | void Close(); 27 | HXMLNODEHANDLE GetFirstNode(); 28 | HXMLNODEHANDLE GetNode( const char* strName ); 29 | HXMLNODEHANDLE GetFirstNode( HXMLNODEHANDLE hXMLNodeHandle ); 30 | HXMLNODEHANDLE GetNode( HXMLNODEHANDLE hXMLNodeHandle, const char* strName ); 31 | HXMLNODEHANDLE GetNextNode( HXMLNODEHANDLE hXMLNodeHandle ); 32 | HXMLNODEHANDLE GetNextNode( HXMLNODEHANDLE hXMLNodeHandle, const char* strName ); 33 | int32 GetNodeCount( HXMLNODEHANDLE hNodeHandle, const char* strName ); 34 | int32 GetChildCount( HXMLNODEHANDLE hNodeHandle ); 35 | const char* GetName( HXMLNODEHANDLE hNodeHandle, char* strBuff ); 36 | 37 | const char* GetValue( HXMLNODEHANDLE hNodeHandle, char* strBuff ); 38 | int32 GetValueInt32( HXMLNODEHANDLE hNodeHandle, int32 nDefaultValue = 0 ); 39 | float GetValueFloat( HXMLNODEHANDLE hNodeHandle, float fDefaultValue = 0.0f ); 40 | int32 GetValueInt32List( HXMLNODEHANDLE hNodeHandle, list* _pInt32List ); 41 | 42 | const char* GetNodeValue( HXMLNODEHANDLE hNodeHandle, const char* strNodeName, char* strBuff ); 43 | int32 GetNodeValueInt32( HXMLNODEHANDLE hNodeHandle, const char* strNodeName, int32 nDefaultValue = 0 ); 44 | float GetNodeValueFloat( HXMLNODEHANDLE hNodeHandle, const char* strNodeName, float fDefaultValue = 0.0f ); 45 | 46 | 47 | const char* GetAttributeValue( HXMLNODEHANDLE hNodeHandle, const char* strName, char* strBuff ); 48 | int32 GetAttributeValueInt32( HXMLNODEHANDLE hNodeHandle, const char* strName, int32 nDefaultValue = 0 ); 49 | float GetAttributeValueFloat( HXMLNODEHANDLE hNodeHandle, const char* strName, float fDefaultValue = 0.0f ); 50 | uint32 GetAttributeValueReverseUint32( HXMLNODEHANDLE hNodeHandle, const char* strAttriName ); 51 | int32 GetAttributeValueInt32List( HXMLNODEHANDLE hNodeHandle, const char* strName, list* _pInt32List ); 52 | 53 | private: 54 | HXMLDOCUMENTHANDLE m_hXMLDocmentHandle; 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /tcgraphic/graphic.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | https://codebus.cn/ -------------------------------------------------------------------------------- /添加环境变量.bat: -------------------------------------------------------------------------------- 1 | set AddPath=%~dp0 2 | setx /M GDK_PATH %AddPath% --------------------------------------------------------------------------------