hedgewars/hwengine.pas
branchphysfslayer
changeset 8025 07862ab415c8
parent 8019 b216953c2617
child 8057 93e16240f178
equal deleted inserted replaced
8022:10b3b93c1f56 8025:07862ab415c8
   342     AddFileLog('UserPrefix: "' + UserPathPrefix +'"');
   342     AddFileLog('UserPrefix: "' + UserPathPrefix +'"');
   343     
   343     
   344     for i:= 0 to ParamCount do
   344     for i:= 0 to ParamCount do
   345         AddFileLog(inttostr(i) + ': ' + ParamStr(i));
   345         AddFileLog(inttostr(i) + ': ' + ParamStr(i));
   346 
   346 
   347     for p:= Succ(Low(TPathType)) to High(TPathType) do
       
   348         if (p <> ptMapCurrent) and (p <> ptData) then
       
   349             UserPathz[p]:= UserPathPrefix + '/Data/' + Pathz[p];
       
   350 
       
   351     UserPathz[ptData]:= UserPathPrefix + '/Data';
       
   352 
       
   353     for p:= Succ(Low(TPathType)) to High(TPathType) do
       
   354         if p <> ptMapCurrent then
       
   355             Pathz[p]:= PathPrefix + '/' + Pathz[p];
       
   356 
       
   357     WriteToConsole('Init SDL... ');
   347     WriteToConsole('Init SDL... ');
   358     SDLTry(SDL_Init(SDL_INIT_VIDEO or SDL_INIT_NOPARACHUTE) >= 0, true);
   348     SDLTry(SDL_Init(SDL_INIT_VIDEO or SDL_INIT_NOPARACHUTE) >= 0, true);
   359     WriteLnToConsole(msgOK);
   349     WriteLnToConsole(msgOK);
   360 
   350 
   361     SDL_EnableUNICODE(1);
   351     SDL_EnableUNICODE(1);
   380 
   370 
   381     ControllerInit(); // has to happen before InitKbdKeyTable to map keys
   371     ControllerInit(); // has to happen before InitKbdKeyTable to map keys
   382     InitKbdKeyTable();
   372     InitKbdKeyTable();
   383     AddProgress();
   373     AddProgress();
   384 
   374 
   385     LoadLocale(UserPathz[ptLocale] + '/en.txt');  // Do an initial load with english
   375     LoadLocale(cPathz[ptLocale] + '/en.txt');  // Do an initial load with english
   386     LoadLocale(Pathz[ptLocale] + '/en.txt');  // Do an initial load with english
       
   387     if cLocaleFName <> 'en.txt' then
   376     if cLocaleFName <> 'en.txt' then
   388         begin
   377         begin
   389         // Try two letter locale first before trying specific locale overrides
   378         // Try two letter locale first before trying specific locale overrides
   390         if (Length(cLocale) > 3) and (Copy(cLocale,1,2) <> 'en') then
   379         if (Length(cLocale) > 3) and (Copy(cLocale, 1, 2) <> 'en') then
   391             begin
   380             begin
   392             LoadLocale(UserPathz[ptLocale] + '/' + Copy(cLocale,1,2)+'.txt');
   381             LoadLocale(cPathz[ptLocale] + '/' + Copy(cLocale, 1, 2) + '.txt')
   393             LoadLocale(Pathz[ptLocale] + '/' + Copy(cLocale,1,2)+'.txt')
       
   394             end;
   382             end;
   395         LoadLocale(UserPathz[ptLocale] + '/' + cLocaleFName);
   383         LoadLocale(cPathz[ptLocale] + '/' + cLocaleFName)
   396         LoadLocale(Pathz[ptLocale] + '/' + cLocaleFName)
       
   397         end
   384         end
   398     else cLocale := 'en';
   385     else cLocale := 'en';
   399 
   386 
   400     WriteLnToConsole(msgGettingConfig);
   387     WriteLnToConsole(msgGettingConfig);
   401 
   388