X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_game.pas;h=48b713c6a645f0a2fd997e839636f9bfcbf933ba;hb=dc37333a08186fc9d9ceffb8b7a0b49534fcf5ee;hp=a0f3090746d54008a174c4864b6513d0b10ab19b;hpb=3af68bc5a306b013ddb2a04c24543b6ec6e288af;p=d2df-sdl.git diff --git a/src/game/g_game.pas b/src/game/g_game.pas index a0f3090..48b713c 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -439,7 +439,7 @@ uses {$IFDEF ENABLE_HOLMES} g_holmes, {$ENDIF} - e_res, g_window, g_menu, r_render, r_textures, r_animations, + e_res, g_window, g_menu, r_render, r_textures, r_animations, r_gfx, r_map, e_input, e_log, g_console, r_console, g_items, g_map, g_panel, g_playermodel, g_gfx, g_options, Math, g_triggers, g_monsters, e_sound, CONFIG, @@ -1439,12 +1439,6 @@ begin end; procedure g_Game_Init(); -var - SR: TSearchRec; - knownFiles: array of AnsiString = nil; - found: Boolean; - wext, s: AnsiString; - f: Integer; begin gExit := 0; gMapToDelete := ''; @@ -1466,43 +1460,7 @@ begin g_Game_SetLoadingText(Format('Doom 2D: Forever %s', [GAME_VERSION]), 0, False); g_Game_SetLoadingText('', 0, False); - g_Game_SetLoadingText(_lc[I_LOAD_MODELS], 0, False); - // load models from all possible wad types, in all known directories - // this does a loosy job (linear search, ooph!), but meh - for wext in wadExtensions do - begin - for f := High(ModelDirs) downto Low(ModelDirs) do - begin - if (FindFirst(ModelDirs[f]+DirectorySeparator+'*'+wext, faAnyFile, SR) = 0) then - begin - repeat - found := false; - for s in knownFiles do - begin - if (strEquCI1251(forceFilenameExt(SR.Name, ''), forceFilenameExt(ExtractFileName(s), ''))) then - begin - found := true; - break; - end; - end; - if not found then - begin - SetLength(knownFiles, length(knownFiles)+1); - knownFiles[High(knownFiles)] := ModelDirs[f]+DirectorySeparator+SR.Name; - end; - until (FindNext(SR) <> 0); - end; - FindClose(SR); - end; - end; - - if (length(knownFiles) = 0) then raise Exception.Create('no player models found!'); - - if (length(knownFiles) = 1) then e_LogWriteln('1 player model found.', TMsgType.Notify) else e_LogWritefln('%d player models found.', [Integer(length(knownFiles))], TMsgType.Notify); - for s in knownFiles do - begin - if not g_PlayerModel_Load(s) then e_LogWritefln('Error loading model "%s"', [s], TMsgType.Warning); - end; +// g_Game_SetLoadingText(_lc[I_LOAD_MODELS], 0, False); gGameOn := false; gPauseMain := false; @@ -2234,6 +2192,7 @@ begin g_Weapon_Update(); g_Monsters_Update(); g_GFX_Update(); + r_GFX_Update; g_Player_UpdateAll(); g_Player_UpdatePhysicalObjects(); @@ -2513,7 +2472,6 @@ begin end; end; - g_Frames_CreateWAD(nil, 'FRAMES_TELEPORT', GameWAD+':TEXTURES\TELEPORT', 64, 64, 10, False); g_Frames_CreateWAD(nil, 'FRAMES_PUNCH', GameWAD+':WEAPONS\PUNCH', 64, 64, 4, False); g_Frames_CreateWAD(nil, 'FRAMES_PUNCH_UP', GameWAD+':WEAPONS\PUNCH_UP', 64, 64, 4, False); g_Frames_CreateWAD(nil, 'FRAMES_PUNCH_DN', GameWAD+':WEAPONS\PUNCH_DN', 64, 64, 4, False); @@ -2656,7 +2614,6 @@ begin g_Texture_Delete('TEXTURE_PLAYER_BLUEFLAG_D'); g_Texture_Delete('TEXTURE_PLAYER_TALKBUBBLE'); g_Texture_Delete('TEXTURE_PLAYER_INVULPENTA'); - g_Frames_DeleteByName('FRAMES_TELEPORT'); g_Frames_DeleteByName('FRAMES_PUNCH'); g_Frames_DeleteByName('FRAMES_PUNCH_UP'); g_Frames_DeleteByName('FRAMES_PUNCH_DN'); @@ -3515,6 +3472,7 @@ begin begin //result := g_Map_Load(gGameSettings.WAD + ':\' + ResName); result := g_Map_Load(NewWAD+':\'+ResName); + r_Map_LoadTextures; end; if Result then begin