Skip to content

Commit

Permalink
fixed some compilation hints and warning (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeveloppeurPascal committed Jan 14, 2025
1 parent 3066d66 commit be90a54
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///
/// Delphi Game Engine
///
/// Copyright 2021-2024 Patrick Prémartin under AGPL 3.0 license.
/// Copyright 2021-2025 Patrick Prémartin under AGPL 3.0 license.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Expand All @@ -22,8 +22,19 @@
/// user interface with the keyboard or a game controller, it's the good place.
///
/// ***************************************************************************
/// File last update : 30/07/2024 14:23:12
/// Signature : 5cd3f7aeafd6d30f8ffa5d529f137d889b7a7c96
///
/// Author(s) :
/// Patrick PREMARTIN
///
/// Site :
/// https://delphigameengine.developpeur-pascal.fr
///
/// Project site :
/// https://github.com/DeveloppeurPascal/Delphi-Game-Engine
///
/// ***************************************************************************
/// File last update : 2025-01-14T16:57:08.000+01:00
/// Signature : 1410a4fc9c96f0b6ac7646153d057737e61d5c98
/// ***************************************************************************
/// </summary>

Expand Down Expand Up @@ -166,7 +177,6 @@ procedure TForm3.Init;

procedure TForm3.RefreshContentLayout;
var
img: TImage;
i: Integer;
begin
case cbDirection.ItemIndex of
Expand Down
8 changes: 6 additions & 2 deletions src/Gamolf.FMX.HelpBar.pas
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
/// https://github.com/DeveloppeurPascal/Delphi-Game-Engine
///
/// ***************************************************************************
/// File last update : 2025-01-12T18:38:34.000+01:00
/// Signature : e0ebea03f3d0df30949f4a78b4322bc5e17c05f4
/// File last update : 2025-01-14T17:09:22.226+01:00
/// Signature : 8207efb25058fdf71f7ef6c624763c14f88b296e
/// ***************************************************************************
/// </summary>

Expand Down Expand Up @@ -102,7 +102,9 @@ TDGEFMXHelpBar = class(TFMXObject)
procedure SetIconKeyBitmapListIndex(const Value: word);
procedure SetBackgroundPadding(const Value: TBounds);
procedure SetHeight(const Value: single);
{$IFNDEF IDE}
procedure FormResize(Sender: TObject);
{$ENDIF}
protected
lGlobal: TLayout;
lHelpBar: TLayout;
Expand Down Expand Up @@ -462,10 +464,12 @@ destructor TDGEFMXHelpBar.Destroy;
inherited;
end;

{$IFNDEF IDE}
procedure TDGEFMXHelpBar.FormResize(Sender: TObject);
begin
RefreshHelpBar;
end;
{$ENDIF}

procedure TDGEFMXHelpBar.GamepadDetected(const GamepadID: integer);
begin
Expand Down
5 changes: 2 additions & 3 deletions src/Gamolf.FMX.MusicLoop.pas
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
/// https://github.com/DeveloppeurPascal/Delphi-Game-Engine
///
/// ***************************************************************************
/// File last update : 2025-01-13T20:04:58.000+01:00
/// Signature : 9109a47297052b28a1aee1b671256ec20f2a6935
/// File last update : 2025-01-14T16:59:50.000+01:00
/// Signature : 5b27248cf34100907ee09fda9986e76f7d373a3e
/// ***************************************************************************
/// </summary>

Expand Down Expand Up @@ -467,7 +467,6 @@ function TSoundList.Add(Filename: string): integer;

function TSoundList.Add(SoundID: integer; Filename: string): boolean;
begin
result := false;
if Filename.IsEmpty or (not tfile.Exists(Filename)) then
raise exception.Create('File "' + Filename + '" not found ! (SoundID=' +
SoundID.ToString + ')');
Expand Down
18 changes: 14 additions & 4 deletions src/Gamolf.RTL.GamepadDetected.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///
/// Delphi Game Engine
///
/// Copyright 2021-2024 Patrick Prémartin under AGPL 3.0 license.
/// Copyright 2021-2025 Patrick Prémartin under AGPL 3.0 license.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Expand All @@ -22,8 +22,19 @@
/// user interface with the keyboard or a game controller, it's the good place.
///
/// ***************************************************************************
/// File last update : 31/07/2024 11:34:14
/// Signature : 6e2caf13fefc2c5bf84c94c59f3c309fea9f62c8
///
/// Author(s) :
/// Patrick PREMARTIN
///
/// Site :
/// https://delphigameengine.developpeur-pascal.fr
///
/// Project site :
/// https://github.com/DeveloppeurPascal/Delphi-Game-Engine
///
/// ***************************************************************************
/// File last update : 2025-01-14T16:57:50.000+01:00
/// Signature : 2e51eda9c5ef778a3f696d7d7fffd0a11709da72
/// ***************************************************************************
/// </summary>

Expand Down Expand Up @@ -506,7 +517,6 @@ procedure TDGEGamepadDetected.FinishedAnimation(Sender: TObject);
procedure TDGEGamepadDetected.RefreshContentLayout;
{$IFDEF FRAMEWORK_FMX}
var
img: TImage;
i: integer;
{$ENDIF}
begin
Expand Down
26 changes: 20 additions & 6 deletions src/Gamolf.RTL.Joystick.DirectInput.Win.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///
/// Delphi Game Engine
///
/// Copyright 2021-2024 Patrick Prémartin under AGPL 3.0 license.
/// Copyright 2021-2025 Patrick Prémartin under AGPL 3.0 license.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Expand All @@ -22,8 +22,19 @@
/// user interface with the keyboard or a game controller, it's the good place.
///
/// ***************************************************************************
/// File last update : 26/07/2024 14:44:28
/// Signature : 12f2fafa0440d01cf111b02e869fceff00bcb86f
///
/// Author(s) :
/// Patrick PREMARTIN
///
/// Site :
/// https://delphigameengine.developpeur-pascal.fr
///
/// Project site :
/// https://github.com/DeveloppeurPascal/Delphi-Game-Engine
///
/// ***************************************************************************
/// File last update : 2025-01-14T16:55:36.000+01:00
/// Signature : 00dc0d496a21eda04ca2984e3d10d930b88eb24e
/// ***************************************************************************
/// </summary>

Expand Down Expand Up @@ -195,8 +206,9 @@ procedure TGamolfJoystickWinDirectInputService.getInfo(JoystickID: TJoystickID;
case ErrNum of
MMSYSERR_NOERROR:
begin
// Transtypage en LongWord ajouté pour éliminer un avertissement du compilateur
if (length(Joystick.Axes) < 6) or
(length(Joystick.Buttons) < FTabDevCaps[JoystickID]
(longword(length(Joystick.Buttons)) < FTabDevCaps[JoystickID]
.JoyCapsW.wNumButtons) then
initJoystick(Joystick);

Expand Down Expand Up @@ -264,8 +276,9 @@ procedure TGamolfJoystickWinDirectInputService.getInfo(JoystickID: TJoystickID;
end;

// simulation du clic sur gachette de gauche (quand ce n'est pas pris en charge par DirectInput)
// Transtypage en LongWord ajouté pour éliminer un avertissement du compilateur
if (FTabDevCaps[JoystickID].JoyCapsW.wNumButtons <
ord(TJoystickButtons.LeftTrigger)) and
longword(ord(TJoystickButtons.LeftTrigger))) and
(Joystick.Axes[ord(tjoystickaxes.LeftTrigger)] > 0.3) then
begin
Joystick.Buttons[ord(TJoystickButtons.LeftTrigger)] := true;
Expand All @@ -276,8 +289,9 @@ procedure TGamolfJoystickWinDirectInputService.getInfo(JoystickID: TJoystickID;
end;

// simulation du clic sur gachette de droite (quand ce n'est pas pris en charge par DirectInput)
// Transtypage en LongWord ajouté pour éliminer un avertissement du compilateur
if (FTabDevCaps[JoystickID].JoyCapsW.wNumButtons <
ord(TJoystickButtons.righttrigger)) and
longword(ord(TJoystickButtons.righttrigger))) and
(Joystick.Axes[ord(tjoystickaxes.righttrigger)] > 0.3) then
begin
Joystick.Buttons[ord(TJoystickButtons.righttrigger)] := true;
Expand Down
19 changes: 16 additions & 3 deletions src/Gamolf.RTL.Joystick.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///
/// Delphi Game Engine
///
/// Copyright 2021-2024 Patrick Prémartin under AGPL 3.0 license.
/// Copyright 2021-2025 Patrick Prémartin under AGPL 3.0 license.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Expand All @@ -22,8 +22,19 @@
/// user interface with the keyboard or a game controller, it's the good place.
///
/// ***************************************************************************
/// File last update : 31/07/2024 11:23:12
/// Signature : f2fdf34bbb41c0e469cf69c8bc3c801a11ded352
///
/// Author(s) :
/// Patrick PREMARTIN
///
/// Site :
/// https://delphigameengine.developpeur-pascal.fr
///
/// Project site :
/// https://github.com/DeveloppeurPascal/Delphi-Game-Engine
///
/// ***************************************************************************
/// File last update : 2025-01-14T16:49:54.000+01:00
/// Signature : 0a3039bc6cbb6f9bc6e520f43aaf3a70a9506728
/// ***************************************************************************
/// </summary>

Expand Down Expand Up @@ -451,8 +462,10 @@ TGamepadDevicesManager = class(TInterfacedObject)
procedure SetEnabled(const Value: boolean);
protected
constructor Create;
{$HINTS OFF}
destructor Destroy; override;
procedure Execute;
{$HINTS ON}
procedure RegisterGamePadDevice(const Gamepad: TGamepadDevice);
procedure UnRegisterGamePadDevice(const Gamepad: TGamepadDevice);
procedure RegisterGamePadManager(const Manager: TDGEGamepadManager);
Expand Down
19 changes: 14 additions & 5 deletions src/Gamolf.RTL.Scores.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///
/// Delphi Game Engine
///
/// Copyright 2021-2024 Patrick Prémartin under AGPL 3.0 license.
/// Copyright 2021-2025 Patrick Prémartin under AGPL 3.0 license.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Expand All @@ -22,8 +22,19 @@
/// user interface with the keyboard or a game controller, it's the good place.
///
/// ***************************************************************************
/// File last update : 28/05/2024 12:18:52
/// Signature : 16c2aaba21d99eeaac5eebaec9cea62b62f1c9a4
///
/// Author(s) :
/// Patrick PREMARTIN
///
/// Site :
/// https://delphigameengine.developpeur-pascal.fr
///
/// Project site :
/// https://github.com/DeveloppeurPascal/Delphi-Game-Engine
///
/// ***************************************************************************
/// File last update : 2025-01-14T17:02:42.000+01:00
/// Signature : bb7c2bb623901dfaff2d2466e5ecf4fb7dc07824
/// ***************************************************************************
/// </summary>

Expand Down Expand Up @@ -445,7 +456,6 @@ procedure TScoreList<T>.SortByPseudoAsc;
s2 := b as TScore
else
raise exception.Create('Wrong type for B.');
result := 0;
result := string.compare(s1.Pseudo, s2.Pseudo, true);
if result = 0 then
if s1.Level < s2.Level then
Expand Down Expand Up @@ -475,7 +485,6 @@ procedure TScoreList<T>.SortByPseudoDesc;
s2 := b as TScore
else
raise exception.Create('Wrong type for B.');
result := 0;
result := string.compare(s1.Pseudo, s2.Pseudo, true);
if result = 0 then
if s1.Level < s2.Level then
Expand Down
20 changes: 15 additions & 5 deletions src/u_scores.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
///
/// Delphi Game Engine
///
/// Copyright 2021-2024 Patrick Prémartin under AGPL 3.0 license.
/// Copyright 2021-2025 Patrick Prémartin under AGPL 3.0 license.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Expand All @@ -22,8 +22,19 @@
/// user interface with the keyboard or a game controller, it's the good place.
///
/// ***************************************************************************
/// File last update : 28/05/2024 12:18:52
/// Signature : 4584291ebbd92f74ced71663dfde565f0b1528f0
///
/// Author(s) :
/// Patrick PREMARTIN
///
/// Site :
/// https://delphigameengine.developpeur-pascal.fr
///
/// Project site :
/// https://github.com/DeveloppeurPascal/Delphi-Game-Engine
///
/// ***************************************************************************
/// File last update : 2025-01-14T17:02:40.000+01:00
/// Signature : 77a99c61de1977aa011010178fa83c9a19e2651c
/// ***************************************************************************
/// </summary>

Expand Down Expand Up @@ -121,7 +132,6 @@ function score_liste_get: TScoreListe;
function score_add(pseudo: string; points: cardinal;
niveau: cardinal = 0): boolean;
begin
result := false;
if (not assigned(score_liste)) then
score_load;
result := score_liste.Add(pseudo, points, niveau, false);
Expand Down Expand Up @@ -166,7 +176,7 @@ initialization
nom_editeur := CCompanyName;
nom_logiciel := CSoftwareName;

{$MESSAGE WARN 'deprecated unit, use Gamolf.RTLVersion.Scores'}
{$MESSAGE WARN 'deprecated unit, use Gamolf.RTL.Scores version'}

finalization

Expand Down

0 comments on commit be90a54

Please sign in to comment.