2D Run-and-gun shooter inspired by One Man's Doomsday, Counter-Strike, and Metal Slug.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

36 行
859 B

  1. #include "IZ_config.h"
  2. void IZ_ConfigGetDefaultPath(const char* config_path, size_t string_size) {
  3. #ifdef IZ_DEBUG
  4. const char* config_path_dir = SDL_GetBasePath();
  5. #else
  6. const char* config_path_dir = SDL_GetPrefPath("Modal Studios", IZ_APP_NAME);
  7. #endif
  8. memcpy_s(config_path, string_size, config_path_dir, 128);
  9. strcat_s(config_path, string_size, "config-game.ini");
  10. }
  11. const char* IZ_ConfigGetCommandlineOption(u8 argc, const char* argv[], const char* val) {
  12. size_t n = strlen(val);
  13. int c = argc;
  14. while (--c > 0) {
  15. if (!strncmp(argv[c], val, n)) {
  16. if (!*(argv[c] + n) && c < argc - 1) {
  17. /* coverity treats unchecked argv as "tainted" */
  18. if (!argv[c + 1] || strlen(argv[c + 1]) > 1024)
  19. return NULL;
  20. return argv[c + 1];
  21. }
  22. if (argv[c][n] == '=')
  23. return &argv[c][n + 1];
  24. return argv[c] + n;
  25. }
  26. }
  27. return NULL;
  28. }