DEADSOFTWARE

render: separate player model logic and drawing
[d2df-sdl.git] / src / game / g_gui.pas
index 0c7f12659e2584350039ce93d1ec01da7f8556c5..7329f52a8cc2df7c39bf01193bcdb8849d554442 100644 (file)
@@ -552,7 +552,7 @@ implementation
 uses
   {$INCLUDE ../nogl/noGLuses.inc}
   g_textures, g_sound, SysUtils, e_res,
-  g_game, Math, StrUtils, g_player, g_options,
+  g_game, Math, StrUtils, g_player, g_options, r_playermodel,
   g_map, g_weapons, xdynrec, wadreader;
 
 
@@ -2226,21 +2226,25 @@ begin
           else
             FIndex := 0;
 
+          g_Sound_PlayEx(SCROLL_ADDSOUND);
+
           if @FOnChangeEvent <> nil then
             FOnChangeEvent(Self);
         end;
 
-    IK_LEFT, IK_KPLEFT, VK_LEFT,
-    JOY0_LEFT, JOY1_LEFT, JOY2_LEFT, JOY3_LEFT:
-      begin
-        if FIndex > 0 then
-          Dec(FIndex)
-        else
-          FIndex := High(FItems);
+      IK_LEFT, IK_KPLEFT, VK_LEFT,
+      JOY0_LEFT, JOY1_LEFT, JOY2_LEFT, JOY3_LEFT:
+        begin
+          if FIndex > 0 then
+            Dec(FIndex)
+          else
+            FIndex := High(FItems);
 
-        if @FOnChangeEvent <> nil then
-          FOnChangeEvent(Self);
-      end;
+          g_Sound_PlayEx(SCROLL_SUBSOUND);
+
+          if @FOnChangeEvent <> nil then
+            FOnChangeEvent(Self);
+        end;
     end;
   end;
 end;
@@ -2690,7 +2694,8 @@ begin
 
   DrawBox(FX, FY, 4, 4);
 
-  if FModel <> nil then FModel.Draw(FX+4, FY+4);
+  if FModel <> nil then
+    r_PlayerModel_Draw(FModel, FX+4, FY+4);
 end;
 
 procedure TGUIModelView.NextAnim();