/*
** Command & Conquer Renegade(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see .
*/
#define WIN32_LEAN_AND_MEAN
#include
#include
#include
#include
#include
#include "winblows.h"
HINSTANCE Global_instance;
LPSTR Global_commandline;
int Global_commandshow;
/*
* WinMain - initialization, message loop
*/
int PASCAL WinMain( HINSTANCE instance, HINSTANCE, char *command_line, int command_show)
{
//////MSG msg;
Global_instance = instance;
Global_commandline = command_line;
Global_commandshow = command_show;
int argc;
char *argv[64];
char path_to_exe[512];
GetModuleFileName(instance,(char *)&path_to_exe,512);
argc=1;
argv[0]=path_to_exe;
int command_scan=0;
char command_char;
do
{
/*
** Scan for non-space character on command line
*/
do
{
command_char = *( command_line+command_scan++ );
} while ( command_char==' ' );
if ( command_char!=0 && command_char != 13 )
{
argv[argc++]=command_line+command_scan-1;
/*
** Scan for space character on command line
*/
do
{
command_char = *( command_line+command_scan++ );
} while ( command_char!=' ' && command_char != 0 && command_char!=13);
*( command_line+command_scan-1 ) = 0;
}
} while ( command_char != 0 && command_char != 13 && argc<20 );
#ifdef MULTIPLAYERDEMO
/*
** Force some command line arguments for console mode demo server.
*/
/*
** If the user didn't specify a server.ini then add the default to the command line.
*/
char temp[256];
bool found = false;
for (int i=1 ; i