hedgewars/hwengine.dpr
changeset 55 e09f7c952a40
parent 54 839fd258ae6f
child 56 a29135563e94
equal deleted inserted replaced
54:839fd258ae6f 55:e09f7c952a40
   155 end;
   155 end;
   156 
   156 
   157 ////////////////////
   157 ////////////////////
   158 procedure GetParams;
   158 procedure GetParams;
   159 var c: integer;
   159 var c: integer;
   160     s: string;
       
   161 {$IFDEF DEBUGFILE}
   160 {$IFDEF DEBUGFILE}
   162     i: integer;
   161     i: integer;
   163 begin
   162 begin
   164 for i:= 0 to ParamCount do
   163 for i:= 0 to ParamCount do
   165     AddFileLog(inttostr(i) + ': ' + ParamStr(i));
   164     AddFileLog(inttostr(i) + ': ' + ParamStr(i));
   168 {$ENDIF}
   167 {$ENDIF}
   169 if ParamCount=6 then
   168 if ParamCount=6 then
   170    begin
   169    begin
   171    val(ParamStr(1), cScreenWidth, c);
   170    val(ParamStr(1), cScreenWidth, c);
   172    val(ParamStr(2), cScreenHeight, c);
   171    val(ParamStr(2), cScreenHeight, c);
   173    // "/mapname" is map, "avematan" is theme
   172    val(ParamStr(3), cBits, c);
   174    s:= ParamStr(3);
       
   175    if (Length(s) > 0) and (s[1] = '/') then Pathz[ptMapCurrent]:= Pathz[ptMaps] + s
       
   176                                        else Pathz[ptThemeCurrent]:= Pathz[ptThemes] + '/' + ParamStr(3);
       
   177    val(ParamStr(4), ipcPort, c);
   173    val(ParamStr(4), ipcPort, c);
   178    SetRandomParams(ParamStr(5), rndfillstr);
   174    cFullScreen:= ParamStr(5) = '1';
   179    cFullScreen:= ParamStr(6)[1] = '1'
   175    isSoundEnabled:= ParamStr(6) = '1';
   180    end else OutError(errmsgShouldntRun, true);
   176    end else OutError(errmsgShouldntRun, true);
   181 end;
   177 end;
   182 
   178 
   183 procedure ShowMainWindow;
   179 procedure ShowMainWindow;
   184 var flags: Longword;
   180 var flags: Longword;
   222 
   218 
   223 StoreInit;
   219 StoreInit;
   224 
   220 
   225 isDeveloperMode:= false;
   221 isDeveloperMode:= false;
   226 
   222 
       
   223 TryDo(InitStepsFlags = cifAllInited,
       
   224       'Some parameters not set (flags = ' + inttostr(InitStepsFlags) + ')',
       
   225       true);
       
   226 
   227 MainLoop
   227 MainLoop
   228 
   228 
   229 end.
   229 end.