… | |
… | |
35 | /*****************************************************************************/ |
35 | /*****************************************************************************/ |
36 | #include <plugin_common.h> |
36 | #include <plugin_common.h> |
37 | |
37 | |
38 | static f_plug_api cfapiSystem_register_global_event = NULL; |
38 | static f_plug_api cfapiSystem_register_global_event = NULL; |
39 | static f_plug_api cfapiSystem_unregister_global_event = NULL; |
39 | static f_plug_api cfapiSystem_unregister_global_event = NULL; |
40 | static f_plug_api cfapiSystem_strdup_local = NULL; |
|
|
41 | static f_plug_api cfapiSystem_find_animation = NULL; |
40 | static f_plug_api cfapiSystem_find_animation = NULL; |
42 | |
41 | |
43 | static f_plug_api cfapiMap_create_path = NULL; |
42 | static f_plug_api cfapiMap_create_path = NULL; |
44 | |
43 | |
45 | static f_plug_api cfapiObject_get_property = NULL; |
44 | static f_plug_api cfapiObject_get_property = NULL; |
… | |
… | |
110 | } } |
109 | } } |
111 | |
110 | |
112 | int cf_init_plugin( f_plug_api getHooks ) |
111 | int cf_init_plugin( f_plug_api getHooks ) |
113 | { |
112 | { |
114 | int z; |
113 | int z; |
115 | GET_HOOK( cfapiSystem_strdup_local, "cfapi_system_strdup_local", z ); |
|
|
116 | GET_HOOK( cfapiSystem_register_global_event, "cfapi_system_register_global_event", z ); |
114 | GET_HOOK( cfapiSystem_register_global_event, "cfapi_system_register_global_event", z ); |
117 | GET_HOOK( cfapiSystem_unregister_global_event, "cfapi_system_unregister_global_event", z ); |
115 | GET_HOOK( cfapiSystem_unregister_global_event, "cfapi_system_unregister_global_event", z ); |
118 | GET_HOOK( cfapiSystem_find_animation, "cfapi_system_find_animation", z ); |
116 | GET_HOOK( cfapiSystem_find_animation, "cfapi_system_find_animation", z ); |
119 | GET_HOOK( cfapiObject_get_property, "cfapi_object_get_property", z ); |
117 | GET_HOOK( cfapiObject_get_property, "cfapi_object_get_property", z ); |
120 | GET_HOOK( cfapiObject_set_property, "cfapi_object_set_property", z ); |
118 | GET_HOOK( cfapiObject_set_property, "cfapi_object_set_property", z ); |
… | |
… | |
691 | void cf_object_pickup( object* op, object* what) |
689 | void cf_object_pickup( object* op, object* what) |
692 | { |
690 | { |
693 | int val; |
691 | int val; |
694 | cfapiObject_pickup(&val, op, what); |
692 | cfapiObject_pickup(&val, op, what); |
695 | } |
693 | } |
696 | char* cf_strdup_local(char* txt) |
694 | char* cf_strdup(char* txt) |
697 | { |
695 | { |
698 | int val; |
696 | int val; |
699 | return (char*)cfapiSystem_strdup_local(&val, txt); |
697 | return (char*)strdup(txt); |
700 | } |
698 | } |
701 | int cf_map_get_flags( maptile* map, maptile** nmap, sint16 x, sint16 y, sint16* nx, sint16* ny ) |
699 | int cf_map_get_flags( maptile* map, maptile** nmap, sint16 x, sint16 y, sint16* nx, sint16* ny ) |
702 | { |
700 | { |
703 | int val; |
701 | int val; |
704 | return *( int* )cfapiMap_get_flags(&val, map, nmap, x, y, nx, ny); |
702 | return *( int* )cfapiMap_get_flags(&val, map, nmap, x, y, nx, ny); |
… | |
… | |
826 | const char* cf_region_get_message(region* reg) |
824 | const char* cf_region_get_message(region* reg) |
827 | { |
825 | { |
828 | int val; |
826 | int val; |
829 | return (const char*) cfapiRegion_get_property(&val, reg, CFAPI_REGION_PROP_MESSAGE); |
827 | return (const char*) cfapiRegion_get_property(&val, reg, CFAPI_REGION_PROP_MESSAGE); |
830 | } |
828 | } |
831 | |
|
|
832 | #ifdef WIN32 |
|
|
833 | int gettimeofday(struct timeval *time_Info, struct timezone *timezone_Info) |
|
|
834 | { |
|
|
835 | /* Get the time, if they want it */ |
|
|
836 | if (time_Info != NULL) { |
|
|
837 | time_Info->tv_sec = time(NULL); |
|
|
838 | time_Info->tv_usec = timeGetTime()*1000; |
|
|
839 | } |
|
|
840 | /* Get the timezone, if they want it */ |
|
|
841 | if (timezone_Info != NULL) { |
|
|
842 | _tzset(); |
|
|
843 | timezone_Info->tz_minuteswest = _timezone; |
|
|
844 | timezone_Info->tz_dsttime = _daylight; |
|
|
845 | } |
|
|
846 | /* And return */ |
|
|
847 | return 0; |
|
|
848 | } |
|
|
849 | #endif |
|
|