Changeset 41 for trunk


Ignore:
Timestamp:
Dec 18, 2016, 12:49:59 PM (7 years ago)
Author:
chronos
Message:
  • Modified: Avoid loading images from files by putting them to hidden form as component.
Location:
trunk
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/BigMetro.lpi

    r36 r41  
    1717      <StringTable ProductVersion=""/>
    1818    </VersionInfo>
    19     <BuildModes Count="2">
     19    <BuildModes Count="4">
    2020      <Item1 Name="Debug" Default="True"/>
    2121      <Item2 Name="Release">
     
    2727          <SearchPaths>
    2828            <IncludeFiles Value="$(ProjOutDir)"/>
     29            <OtherUnitFiles Value="Forms"/>
    2930            <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
    3031          </SearchPaths>
     
    5556        </CompilerOptions>
    5657      </Item2>
     58      <Item3 Name="Windows 32-bit">
     59        <CompilerOptions>
     60          <Version Value="11"/>
     61          <Target>
     62            <Filename Value="lib/$(TargetCPU)-$(TargetOS)/BigMetro"/>
     63          </Target>
     64          <SearchPaths>
     65            <IncludeFiles Value="$(ProjOutDir)"/>
     66            <OtherUnitFiles Value="Forms"/>
     67            <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
     68          </SearchPaths>
     69          <Parsing>
     70            <SyntaxOptions>
     71              <SyntaxMode Value="Delphi"/>
     72              <CStyleOperator Value="False"/>
     73              <AllowLabel Value="False"/>
     74              <CPPInline Value="False"/>
     75            </SyntaxOptions>
     76          </Parsing>
     77          <CodeGeneration>
     78            <SmartLinkUnit Value="True"/>
     79            <TargetCPU Value="i386"/>
     80            <TargetOS Value="win32"/>
     81            <Optimizations>
     82              <OptimizationLevel Value="3"/>
     83            </Optimizations>
     84          </CodeGeneration>
     85          <Linking>
     86            <Debugging>
     87              <GenerateDebugInfo Value="False"/>
     88            </Debugging>
     89            <Options>
     90              <Win32>
     91                <GraphicApplication Value="True"/>
     92              </Win32>
     93            </Options>
     94          </Linking>
     95        </CompilerOptions>
     96      </Item3>
     97      <Item4 Name="Windows 64-bit">
     98        <CompilerOptions>
     99          <Version Value="11"/>
     100          <Target>
     101            <Filename Value="lib/$(TargetCPU)-$(TargetOS)/BigMetro"/>
     102          </Target>
     103          <SearchPaths>
     104            <IncludeFiles Value="$(ProjOutDir)"/>
     105            <OtherUnitFiles Value="Forms"/>
     106            <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
     107          </SearchPaths>
     108          <Parsing>
     109            <SyntaxOptions>
     110              <SyntaxMode Value="Delphi"/>
     111              <CStyleOperator Value="False"/>
     112              <AllowLabel Value="False"/>
     113              <CPPInline Value="False"/>
     114            </SyntaxOptions>
     115          </Parsing>
     116          <CodeGeneration>
     117            <SmartLinkUnit Value="True"/>
     118            <TargetCPU Value="x86_64"/>
     119            <TargetOS Value="win64"/>
     120            <Optimizations>
     121              <OptimizationLevel Value="3"/>
     122            </Optimizations>
     123          </CodeGeneration>
     124          <Linking>
     125            <Debugging>
     126              <GenerateDebugInfo Value="False"/>
     127            </Debugging>
     128            <Options>
     129              <Win32>
     130                <GraphicApplication Value="True"/>
     131              </Win32>
     132            </Options>
     133          </Linking>
     134        </CompilerOptions>
     135      </Item4>
    57136    </BuildModes>
    58137    <PublishOptions>
     
    69148      </Item1>
    70149    </RequiredPackages>
    71     <Units Count="6">
     150    <Units Count="7">
    72151      <Unit0>
    73152        <Filename Value="BigMetro.lpr"/>
     
    97176        <IsPartOfProject Value="True"/>
    98177      </Unit5>
     178      <Unit6>
     179        <Filename Value="Forms/UFormImages.pas"/>
     180        <IsPartOfProject Value="True"/>
     181        <ComponentName Value="FormImages"/>
     182        <HasResources Value="True"/>
     183        <ResourceBaseClass Value="Form"/>
     184      </Unit6>
    99185    </Units>
    100186  </ProjectOptions>
     
    106192    <SearchPaths>
    107193      <IncludeFiles Value="$(ProjOutDir)"/>
     194      <OtherUnitFiles Value="Forms"/>
    108195      <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
    109196    </SearchPaths>
  • trunk/BigMetro.lpr

    r39 r41  
    88  {$ENDIF}
    99  Interfaces, // this includes the LCL widgetset
    10   Forms, SysUtils, UFormMain, UEngine, UGeometric, UTrack, UMetaCanvas
    11   { you can add units after this };
     10  Forms, SysUtils, UFormMain, UEngine, UGeometric, UTrack, UMetaCanvas,
     11UFormImages;
    1212
    1313{$R *.res}
     
    2828  Application.Initialize;
    2929  Application.CreateForm(TFormMain, FormMain);
     30  Application.CreateForm(TFormImages, FormImages);
    3031  Application.Run;
    3132end.
  • trunk/UEngine.pas

    r37 r41  
    274274    LastNewShapeTime: TDateTime;
    275275    LastTickTime: TDateTime;
    276     ImagePassenger: TImage;
    277     ImageLocomotive: TImage;
    278276    FTime: TDateTime;
    279277    FLastTime: TDateTime;
     
    310308    State: TGameState;
    311309    RedrawPending: Boolean;
     310    ImagePassenger: TImage;
     311    ImageLocomotive: TImage;
    312312    procedure MouseMove(Position: TPoint);
    313313    procedure MouseUp(Button: TMouseButton; Position: TPoint);
     
    22182218  ImagePassenger := TImage.Create(nil);
    22192219  ImageLocomotive := TImage.Create(nil);
    2220   if FileExists(ImagePassengerName) then
    2221     ImagePassenger.Picture.LoadFromFile(ImagePassengerName);
    2222   if FileExists(ImageLocomotiveName) then
    2223     ImageLocomotive.Picture.LoadFromFile(ImageLocomotiveName);
     2220  //if FileExists(ImagePassengerName) then
     2221  //  ImagePassenger.Picture.LoadFromFile(ImagePassengerName);
     2222  //if FileExists(ImageLocomotiveName) then
     2223  //  ImageLocomotive.Picture.LoadFromFile(ImageLocomotiveName);
    22242224  MetaCanvas := TMetaCanvas.Create;
    22252225end;
  • trunk/UFormMain.lfm

    r30 r41  
    1111  OnKeyPress = FormKeyPress
    1212  OnShow = FormShow
    13   LCLVersion = '1.5'
     13  LCLVersion = '1.6.2.0'
    1414  WindowState = wsMaximized
    1515  object PaintBox1: TPaintBox
  • trunk/UFormMain.pas

    r35 r41  
    4646{$R *.lfm}
    4747
     48uses
     49  UFormImages;
     50
    4851{ TFormMain }
    4952
     
    7073begin
    7174  Randomize;
     75  Engine.ImagePassenger.Picture.Assign(FormImages.ImagePassenger.Picture);
     76  Engine.ImageLocomotive.Picture.Assign(FormImages.ImageLocomotive.Picture);
    7277  Engine.Map.Size := Point(PaintBox1.Width, PaintBox1.Height);
    7378  Engine.View.DestRect := Rect(0, 0, PaintBox1.Width, PaintBox1.Height);
Note: See TracChangeset for help on using the changeset viewer.