#######################################################################################################################* *-----------------------------------------------------Configuration-------------------------------------------------------* *#########################################################################################################################*/
| 740 | *-----------------------------------------------------Configuration-------------------------------------------------------* |
| 741 | *#########################################################################################################################*/ |
| 742 | int Platform_GetCommandLineArgs(int argc, STRING_REF char** argv, cc_string* args) { |
| 743 | LPWSTR cmdLine = GetCommandLineW(); |
| 744 | char cmdLineUtf8[1024]; |
| 745 | cc_string cmdArgs; |
| 746 | int i; |
| 747 | |
| 748 | if (gameHasArgs) return GetGameArgs(args); |
| 749 | |
| 750 | WideCharToMultiByte(CP_UTF8, 0, cmdLine, -1, cmdLineUtf8, 1024, NULL, NULL); |
| 751 | cmdArgs = String_FromReadonly(cmdLineUtf8); |
| 752 | |
| 753 | Platform_NextArg(&cmdArgs); |
| 754 | |
| 755 | for (i = 0; i < GAME_MAX_CMDARGS; i++) { |
| 756 | args[i] = Platform_NextArg(&cmdArgs); |
| 757 | if (!args[i].length) break; |
| 758 | } |
| 759 | return i; |
| 760 | } |
| 761 | |
| 762 | static cc_string Platform_NextArg(STRING_REF cc_string* args) { |
| 763 | cc_string arg; |
nothing calls this directly
no test coverage detected