154 end; |
154 end; |
155 |
155 |
156 //////////////////// |
156 //////////////////// |
157 procedure GetParams; |
157 procedure GetParams; |
158 var c: integer; |
158 var c: integer; |
|
159 s: string; |
159 {$IFDEF DEBUGFILE} |
160 {$IFDEF DEBUGFILE} |
160 i: integer; |
161 i: integer; |
161 begin |
162 begin |
162 for i:= 0 to ParamCount do |
163 for i:= 0 to ParamCount do |
163 AddFileLog(inttostr(i) + ': ' + ParamStr(i)); |
164 AddFileLog(inttostr(i) + ': ' + ParamStr(i)); |
164 {$ELSE} |
165 {$ELSE} |
165 begin |
166 begin |
166 {$ENDIF} |
167 {$ENDIF} |
167 if ParamCount=6 then |
168 if ParamCount=6 then |
168 begin |
169 begin |
169 //TODO: сделать передачу через IPC |
|
170 val(ParamStr(1), cScreenWidth, c); |
170 val(ParamStr(1), cScreenWidth, c); |
171 val(ParamStr(2), cScreenHeight, c); |
171 val(ParamStr(2), cScreenHeight, c); |
172 Pathz[ptThemeCurrent]:= Pathz[ptThemes] + ParamStr(3)+'/'; |
172 // "/mapname" is map, "avematan" is theme |
|
173 s:= ParamStr(3); |
|
174 if (Length(s) > 0) and (s[1] = '/') then Pathz[ptMapCurrent]:= Pathz[ptMaps] + s |
|
175 else Pathz[ptThemeCurrent]:= Pathz[ptThemes] + '/' + ParamStr(3); |
173 val(ParamStr(4), ipcPort, c); |
176 val(ParamStr(4), ipcPort, c); |
174 SetRandomParams(ParamStr(5), rndfillstr); |
177 SetRandomParams(ParamStr(5), rndfillstr); |
175 cFullScreen:= ParamStr(6)[1] = '1' |
178 cFullScreen:= ParamStr(6)[1] = '1' |
176 end else OutError(errmsgShouldntRun, true); |
179 end else OutError(errmsgShouldntRun, true); |
177 end; |
180 end; |
188 SDL_ShowCursor(0); |
191 SDL_ShowCursor(0); |
189 end; |
192 end; |
190 //////////////////////////////////////////////////////////////////////////////// |
193 //////////////////////////////////////////////////////////////////////////////// |
191 /////////////////////////////// m a i n //////////////////////////////////////// |
194 /////////////////////////////// m a i n //////////////////////////////////////// |
192 //////////////////////////////////////////////////////////////////////////////// |
195 //////////////////////////////////////////////////////////////////////////////// |
193 {$INCLUDE revision.inc} |
196 |
194 |
197 begin |
195 begin |
198 WriteLnToConsole('HedgeWars 0.1 alpha'); |
196 WriteLnToConsole('HedgeWars 0.1, svn '+cRevision); |
|
197 WriteLnToConsole(' -= by unC0Rr =- '); |
199 WriteLnToConsole(' -= by unC0Rr =- '); |
198 GetParams; |
200 GetParams; |
199 Randomize; |
201 Randomize; |
200 |
202 |
201 WriteToConsole('Init SDL... '); |
203 WriteToConsole('Init SDL... '); |