Archived

This topic is now archived and is closed to further replies.

FooFighter

Delphi 6 Compiler Problem

Recommended Posts

Hello, I used to use DelphiX on Delphi 4 Standard but recently I bought Delphi 6 Enterprise and then I followed the great turbo tutorial to convert it to work with D6. Since here, evrthing ok. My game has a fade routine made using the DirectDraw Surface''s GammaControl, this routine was compiled succesfully on the Delphi 4''s compiler. But when I first tried to compile the game on Delphi 6, I got unexpected compiler errors in one of the game''s units: [Error] functions.pas(106): Types of actual and formal var parameters must be identical [Error] functions.pas(107): Types of actual and formal var parameters must be identical [Error] functions.pas(115): Incompatible types: ''DirectDraw.TDDGammaRamp'' and ''DirectX.TDDGammaRamp'' [Error] functions.pas(122): Incompatible types: ''DirectDraw.TDDGammaRamp'' and ''DirectX.TDDGammaRamp'' [Error] functions.pas(129): Incompatible types: ''DirectDraw.TDDGammaRamp'' and ''DirectX.TDDGammaRamp'' [Error] functions.pas(134): Incompatible types: ''DirectDraw.TDDGammaRamp'' and ''DirectX.TDDGammaRamp'' these errors did not happen in Delphi 4. Here is the FADE procedure: (The lines of the errors are under comments) procedure Fade(Intensidade : Integer); var DDGammaRamp : TDDGammaRamp; DDGammaOld : TDDGammaRamp; FGammaControl : IDirectDrawGammaControl; backloop : integer; begin //Form1.DXDraw1.Primary.QueryInteface(IDD_IDirectDrawGammaControl,FGammaControl); Form1.DXDraw1.Primary.GammaControl._AddRef(); {Line 106} Form1.DXDraw1.Primary.GammaControl.GetGammaRamp(0,DDGammaOld); // {Line 107} Form1.DXDraw1.Primary.GammaControl.GetGammaRamp(0,DDGammaRamp); // for backloop := 0 to 256 do begin if DDGammaRamp.Red[backloop] > 0 then begin DDGammaRamp.Red[backloop] := Intensidade; {Line 115} Form1.DXDraw1.Primary.GammaControl.SetGammaRamp(0,DDGammaRamp); end; Sleep(1); if DDGammaRamp.Green[backloop] > 0 then begin DDGammaRamp.Green[backloop] := Intensidade; {Line 122} Form1.DXDraw1.Primary.GammaControl.SetGammaRamp(DDSGR_CALIBRATE,DDGammaRamp); end; Sleep(1); if DDGammaRamp.Blue[backloop] > 0 then begin DDGammaRamp.Blue[backloop] := Intensidade; {Line 129} Form1.DXDraw1.Primary.GammaControl.SetGammaRamp(DDSGR_CALIBRATE,DDGammaRamp); end; Sleep(1); end; {Line 134} Form1.DXDraw1.Primary.GammaControl.SetGammaRamp(0,DDGammaOld); FOrm1.DXDraw1.Primary.GammaCOntrol._Release; end; I would like to continue the development of my game on Delphi 6 Enterprise as it is a better product with more resources but I can''t continue without knowing why these errors are happening! Marcelo.

Share this post


Link to post
Share on other sites
At a guess it may be a question of switching around some of the units in the uses sectionof the delphix files. I had something similiar happen with SXmedia and that was the suggested fix.

Share this post


Link to post
Share on other sites
Well, Thank you for the answer but -> Could you please explain it more becouse I did not understand well what you said. Are you saying that changing the order of the units in the uses section would fix the problem? How!? And if so, Change what section in what file?

Does anyone knows any other way or why this problem is happening? What changes in Delphi 6''s compiler makes it?

Thanks,

FooFighter.

Share this post


Link to post
Share on other sites