Skip to content
This repository was archived by the owner on Aug 21, 2024. It is now read-only.

Draft: Compatibility with FPC 3.2.0 and MacOS #3

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions 3rd_party/opengl/vcmi.glcocoanscontext.pas
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function CreateOpenGLContextAttrList(DoubleBuffered: boolean;
NSScreenFix = objccategory external (NSScreen)
function backingScaleFactor: CGFloat ; message 'backingScaleFactor';
end;
TDummyNoWarnObjCNotUsed = objc.BOOL;
TDummyNoWarnObjCNotUsed = ObjCBOOL;
TDummyNoWarnObjCBaseNotUsed = objcbase.NSInteger;

{ TCocoaOpenGLView }
Expand Down Expand Up @@ -197,7 +197,7 @@ function LOpenGLCreateContext(AWinControl: TWinControl;
Result:=0;
p := nil;
if (AParams.WndParent <> 0) then
p := CocoaUtils.GetNSObjectView(NSObject(AParams.WndParent));
p := NSObject(AParams.WndParent).lclContentView();
if Assigned(p) then
LCLToNSRect(types.Bounds(AParams.X, AParams.Y, AParams.Width, AParams.Height),
p.frame.size.height, ns)
Expand Down Expand Up @@ -507,20 +507,20 @@ procedure TCocoaOpenGLView.scrollWheel(event: NSEvent);

procedure TCocoaOpenGLView.keyDown(event: NSEvent);
begin
if not Assigned(callback) or not callback.KeyEvent(event) then
inherited keyDown(event);
// if not Assigned(callback) or not callback.KeyEvent(event) then
// inherited keyDown(event);
end;

procedure TCocoaOpenGLView.keyUp(event: NSEvent);
begin
if not Assigned(callback) or not callback.KeyEvent(event) then
inherited keyUp(event);
// if not Assigned(callback) or not callback.KeyEvent(event) then
// inherited keyUp(event);
end;

procedure TCocoaOpenGLView.flagsChanged(event: NSEvent);
begin
if not Assigned(callback) or not callback.KeyEvent(event) then
inherited flagsChanged(event);
// if not Assigned(callback) or not callback.KeyEvent(event) then
// inherited flagsChanged(event);
end;

procedure TCocoaOpenGLView.resetCursorRects;
Expand Down
2 changes: 1 addition & 1 deletion editor_classes.pas
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ procedure TObjectMap.Deref(Item: Pointer);
begin
Finalize(TKey(Item^));

TData(Pointer(PByte(Item)+KeySize)^).Free;
// TData(Pointer(PByte(Item)+KeySize)^).Free;
end;

{ TPrimarySkills }
Expand Down
2 changes: 1 addition & 1 deletion editor_graphics.pas
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface
fpjson;

type
TSprites = specialize gvector.TVector<TGLSprite>;
TSprites = specialize TVector<TGLSprite>;
TGraphicsLoadMode = (LoadFisrt, LoadRest, LoadComplete);
TGraphicsLoadFlag = (None, First, Complete);

Expand Down
6 changes: 3 additions & 3 deletions lists_manager.pas
Original file line number Diff line number Diff line change
Expand Up @@ -517,11 +517,11 @@ THeroPortraitInfos = class(specialize TGArrayCollection<THeroPortraitInfo>)
TListsManager = class (TFSConsumer)
private
type
TSlotMap = specialize gmap.TMap<AnsiString, Integer, TStringCompare>;
TSlotMap = specialize TMap<AnsiString, Integer, TStringCompare>;

TLessInteger = specialize gutil.TLess<Integer>;
TLessInteger = specialize TLess<Integer>;

TBuildingCnv = specialize gmap.TMap<Integer, Integer, TLessInteger>;
TBuildingCnv = specialize TMap<Integer, Integer, TLessInteger>;

PResolveRequest = ^TResolveRequest;
TResolveRequest = record
Expand Down
2 changes: 2 additions & 0 deletions vcmi_json.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1422,8 +1422,10 @@ procedure TModdedConfigs.Load(AProgess: IProgressCallback;
APaths: TModdedConfigPaths; ALoader: IResourceLoader; ADest: TJSONObject);
begin
Preload(AProgess, APaths, ALoader);
{
ExtractPatches;
ApplyPatches;
}
CombineTo(ADest);
end;

Expand Down
5 changes: 3 additions & 2 deletions vcmieditor.lpi
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="11"/>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<Flags>
<SaveClosedFiles Value="False"/>
<MainUnitHasUsesSectionForAllUnits Value="False"/>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<AutoCreateForms Value="False"/>
<Title Value="VCMI Editor"/>
<UseAppBundle Value="False"/>
Expand Down Expand Up @@ -887,6 +887,7 @@
</CodeGeneration>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
<UseHeaptrc Value="True"/>
</Debugging>
<Options>
Expand Down
3 changes: 1 addition & 2 deletions zlib_stream.pas
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,7 @@ function TZlibInputStream.Seek(const Offset: Int64; Origin: TSeekOrigin): Int64;
end;

DecompressTill(new_position);

FPosition := Min(new_position, FDecompressedSize);
FPosition := MinValue(PInteger(new_position), FDecompressedSize);
Result := FPosition;
end;

Expand Down