From cdc0cb1ffa3a0f31092c0c9e4e1b123c62979793 Mon Sep 17 00:00:00 2001 From: Stefan Dresselhaus Date: Thu, 5 Feb 2015 14:05:09 +0100 Subject: [PATCH] minor bug in parser, -O2 faster than -O3 --- raytrace.cabal | 2 +- scenes/cube/cube.sce | 4 ++-- scenes/molecule/molecule.sce | 1 + src/Scene/Parser.hs | 2 ++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/raytrace.cabal b/raytrace.cabal index 4ceba2c..df98a35 100644 --- a/raytrace.cabal +++ b/raytrace.cabal @@ -76,6 +76,6 @@ executable raytrace -- Base language which the package is written in. default-language: Haskell2010 - ghc-options: -Odph -rtsopts -threaded -fno-liberate-case -funfolding-use-threshold1000 -funfolding-keeness-factor1000 -optlo-O3 -fllvm -eventlog + ghc-options: -Odph -rtsopts -threaded -fno-liberate-case -funfolding-use-threshold1000 -funfolding-keeness-factor1000 -optlo-O2 -eventlog -fllvm -- ghc-options: -Odph -fno-liberate-case -funfolding-use-threshold1000 -funfolding-keeness-factor1000 -optlo-O3 -fllvm -prof -auto-all diff --git a/scenes/cube/cube.sce b/scenes/cube/cube.sce index 99bf355..57f23b4 100644 --- a/scenes/cube/cube.sce +++ b/scenes/cube/cube.sce @@ -15,5 +15,5 @@ light -1 10 -1 1.0 0.2 0.2 light 10 0 5 0.2 0.2 1.0 # mesh: filename, FLAT/SMOOTH, material -mesh cube.off FLAT 0.5 0.5 0.5 0.5 0.5 0.5 0.0 0.0 0.0 0.0 0.0 -#mesh cube.off PHONG 0.5 0.5 0.5 0.5 0.5 0.5 0.0 0.0 0.0 0.0 0.0 +#mesh cube.off FLAT 0.5 0.5 0.5 0.5 0.5 0.5 0.0 0.0 0.0 0.0 0.0 +mesh cube.off PHONG 0.5 0.5 0.5 0.5 0.5 0.5 0.0 0.0 0.0 0.0 0.0 diff --git a/scenes/molecule/molecule.sce b/scenes/molecule/molecule.sce index 01e6cb3..e05751a 100644 --- a/scenes/molecule/molecule.sce +++ b/scenes/molecule/molecule.sce @@ -1618,3 +1618,4 @@ sphere 0.841523 0.32472 -0.173257 0.04532 1 1 1 1 1 1 1.0 1.0 1.0 100.0 0.0 sphere 0.911467 0.263689 -0.210797 0.04532 1 1 1 1 1 1 1.0 1.0 1.0 100.0 0.0 sphere 0.861124 0.246127 -0.250717 0.04532 1 1 1 1 1 1 1.0 1.0 1.0 100.0 0.0 sphere 0.880989 0.309651 -0.248073 0.04532 1 1 1 1 1 1 1.0 1.0 1.0 100.0 0.0 + diff --git a/src/Scene/Parser.hs b/src/Scene/Parser.hs index 3e02357..f70bdef 100644 --- a/src/Scene/Parser.hs +++ b/src/Scene/Parser.hs @@ -127,6 +127,7 @@ parsePlane = do c <- parseVector n <- parseVector m <- parseMaterial + skipSpace return $ OpP Plane { planeCenter = c , planeNormal = normalize n @@ -139,6 +140,7 @@ parseSphere = do skipSpace r <- double m <- parseMaterial + skipSpace return $ OpS Sphere { sphereCenter = p , sphereRadius = (fromRational . toRational) r