// // EV_SpecialForStaticInitName // // Some static init specials have symbolic names. This will // return the bound special for such a name if one exists. // int EV_SpecialForStaticInitName(const char *name) { struct staticname_t { int staticFn; const char *name; }; static staticname_t namedStatics[] = { { EV_STATIC_POLYOBJ_START_LINE, "Polyobj_StartLine" }, { EV_STATIC_POLYOBJ_EXPLICIT_LINE, "Polyobj_ExplicitLine" }, { EV_STATIC_SCROLL_LEFT_PARAM, "Scroll_Texture_Left" }, { EV_STATIC_SCROLL_RIGHT_PARAM, "Scroll_Texture_Right" }, { EV_STATIC_SCROLL_UP_PARAM, "Scroll_Texture_Up" }, { EV_STATIC_SCROLL_DOWN_PARAM, "Scroll_Texture_Down" }, { EV_STATIC_PORTAL_HORIZON_LINE, "Line_Horizon" }, { EV_STATIC_LINE_SET_IDENTIFICATION, "Line_SetIdentification" }, }; // There aren't enough of these to warrant a hash table. Yet. for(size_t i = 0; i < earrlen(namedStatics); i++) { if(!strcasecmp(namedStatics[i].name, name)) return EV_SpecialForStaticInit(namedStatics[i].staticFn); } return 0; }
// // EV_SpecialForStaticInitName // // Some static init specials have symbolic names. This will // return the bound special for such a name if one exists. // int EV_SpecialForStaticInitName(const char *name) { struct staticname_t { int staticFn; const char *name; }; static staticname_t namedStatics[] = { { EV_STATIC_3DMIDTEX_ATTACH_PARAM, "Sector_Attach3dMidtex" }, { EV_STATIC_INIT_PARAM, "Static_Init" }, { EV_STATIC_PORTAL_LINE_PARAM, "Line_SetPortal" }, { EV_STATIC_SLOPE_PARAM, "Plane_Align" }, { EV_STATIC_POLYOBJ_START_LINE, "Polyobj_StartLine" }, { EV_STATIC_POLYOBJ_EXPLICIT_LINE, "Polyobj_ExplicitLine" }, { EV_STATIC_PUSHPULL_CONTROL_PARAM, "PointPush_SetForce" }, { EV_STATIC_SCROLL_BY_OFFSETS, "Scroll_Texture_Offsets" }, { EV_STATIC_SCROLL_CEILING_PARAM, "Scroll_Ceiling" }, { EV_STATIC_SCROLL_FLOOR_PARAM, "Scroll_Floor" }, { EV_STATIC_SCROLL_LEFT_PARAM, "Scroll_Texture_Left" }, { EV_STATIC_SCROLL_WALL_PARAM, "Scroll_Texture_Model" }, { EV_STATIC_SCROLL_RIGHT_PARAM, "Scroll_Texture_Right" }, { EV_STATIC_SCROLL_UP_PARAM, "Scroll_Texture_Up" }, { EV_STATIC_SCROLL_DOWN_PARAM, "Scroll_Texture_Down" }, { EV_STATIC_CURRENT_CONTROL_PARAM, "Sector_SetCurrent" }, { EV_STATIC_FRICTION_TRANSFER, "Sector_SetFriction" }, { EV_STATIC_PORTAL_SECTOR_PARAM, "Sector_SetPortal" }, { EV_STATIC_WIND_CONTROL_PARAM, "Sector_SetWind" }, { EV_STATIC_PORTAL_HORIZON_LINE, "Line_Horizon" }, { EV_STATIC_LINE_SET_IDENTIFICATION, "Line_SetIdentification" }, { EV_STATIC_LIGHT_TRANSFER_FLOOR, "Transfer_FloorLight" }, { EV_STATIC_LIGHT_TRANSFER_CEILING, "Transfer_CeilingLight" }, { EV_STATIC_TRANSFER_HEIGHTS, "Transfer_Heights" }, }; // There aren't enough of these to warrant a hash table. Yet. for(size_t i = 0; i < earrlen(namedStatics); i++) { if(!strcasecmp(namedStatics[i].name, name)) return EV_SpecialForStaticInit(namedStatics[i].staticFn); } return 0; }