Chris West (Faux) wrote:

> mkdir -p /view3dscene-3.15.0/debian/tmp/usr/lib/view3dscene/3.15.0
> fpc -k"-z relro" -dRELEASE -Mobjfpc -Sh -Ci -Sm -Sc -Sg -Si -O2 -Xs
> -FU/view3dscene-3.15.0/debian/tmp/usr/lib/view3dscene/3.15.0
> -FE/view3dscene-3.15.0/debian/tmp/usr/bin
> -Fu/usr/lib/x86_64-linux-gnu/fp-units-2.6.4/castle-game-engine-5.2.0/
> view3dscene.lpr
...
> v3dsceneraytrace.pas(135,26) Error: Identifier not found "TImageFormat"

Reason: view3dscene source code of version 3.15.0 is not compatible with
Castle Game Engine version 5.2.0. I removed the identifier TImageFormat
from the public interface of CastleImages unit. The view3dscene sources
in SVN are of course adjusted since a long time, but there hasn't been a
view3dscene release since some time.

IOW, it's my fault, I broke Castle Game Engine API in 5.2.0.

I'm attaching a minimal patch that, when applied to view3dscene 3.15.0
sources, makes them compile with Castle Game Engine 5.2.0:) Tested with
FPC 2.6.4.

The need for this patch will disappear with next view3dscene release.

Regards,
Michalis
diff -ur view3dscene-original/v3dscenelightseditor.pas view3dscene/v3dscenelightseditor.pas
--- view3dscene-original/v3dscenelightseditor.pas	2014-12-30 03:51:05.000000000 +0100
+++ view3dscene/v3dscenelightseditor.pas	2015-11-28 00:15:34.319771551 +0100
@@ -312,10 +312,10 @@
   inherited;
   BackgroundOpacityFocused := 0.3;
   BackgroundOpacityNotFocused := 0.2;
-  PositionRelativeMenuX := prLow;
-  PositionRelativeMenuY := prHigh;
-  PositionRelativeScreenX := prLow;
-  PositionRelativeScreenY := prHigh;
+  PositionRelativeMenuX := hpLeft;
+  PositionRelativeMenuY := vpTop;
+  PositionRelativeScreenX := hpLeft;
+  PositionRelativeScreenY := vpTop;
   Position[0] := 20;
   Position[1] := - WindowMarginTop - 20;
 end;
diff -ur view3dscene-original/v3dsceneraytrace.pas view3dscene/v3dsceneraytrace.pas
--- view3dscene-original/v3dsceneraytrace.pas	2014-12-30 03:51:05.000000000 +0100
+++ view3dscene/v3dsceneraytrace.pas	2015-11-28 00:14:42.390563004 +0100
@@ -132,28 +132,11 @@
 var
   D: PCallData;
   SaveURL: string;
-  ImgFormat: TImageFormat;
 begin
   D := PCallData(Window.UserData);
-
   SaveURL := ApplicationName + '_rt.png';
-  if Window.FileDialog('Save image', SaveURL, false,
-    SaveImage_FileFilters) then
-  begin
-    { Determine ImgFormat exactly the same like SaveImage() does. }
-    if MimeTypeToImageFormat(URIMimeType(SaveURL), false, true, ImgFormat) and
-      (ImgFormat = ifRGBE) then
-      MessageOK(Window,
-        'Note: When saving raytraced image from view3dscene to ' +
-        'RGBE file format, you will *not* get image with perfect ' +
-        'RGB+Exponent precision. ' +
-        'That''s because image is already stored in memory in RGB ' +
-        '(8 bits per component) format (this was required to quickly display ' +
-        'image in OpenGL) so any precision (beyond 8-bits) is already lost. ' +
-        'Use rayhunter if you want to have RGBE image with precise colors.');
-
+  if Window.FileDialog('Save image', SaveURL, false, SaveImage_FileFilters) then
     SaveImage(D^.Image, SaveURL);
-  end;
 end;
 
 procedure EventEscape;

Reply via email to