anchurcn / GoldsrcFramework

A framework between goldsrc engine and your mod code(formerly the HLSDK). Provides mathlib, enhanced engine APIs, additional game APIs, some new systems and new dev styles. Simplify you game development.
MIT License
1 stars 0 forks source link

[CodeGen] Generate goldsrc engine defination. #7

Open anchurcn opened 5 months ago

anchurcn commented 5 months ago

Problems

  1. The struct with direct function pointer declaration field yields empty struct in AstCpp compilation. eg:
    typedef struct r_studio_interface_s
    {
    int version;
    int (*StudioDrawModel)(int flags);
    int (*StudioDrawPlayer)(int flags, struct entity_state_s* pplayer);
    } r_studio_interface_t;

    yields empty struct (ast representation): struct r_studio_interface_s{ }

  2. The struct with typedef function pointer declaration field yields zero parameter function type of the fields. eg:
    // Pointers to the exported engine functions themselves
    typedef struct cl_enginefuncs_s
    {
    pfnEngSrc_pfnSPR_Load_t pfnSPR_Load;
    pfnEngSrc_pfnSPR_Frames_t pfnSPR_Frames;
    pfnEngSrc_pfnSPR_Height_t pfnSPR_Height;
    pfnEngSrc_pfnSPR_Width_t pfnSPR_Width;
       //...
    }

    yields struct cl_enginefuncs_s{ void(*)() pfnSPR_Load; ... } but actual type of pfnSPR_Load is typedef HSPRITE (*pfnEngSrc_pfnSPR_Load_t)(const char* szPicName);