|
koocake
|
 |
« on: May 04, 2006, 02:42:36 am » |
|
Hi there,
Up until now I have just had ambient lighting for my map.
I tried doing: csRef<iLight> light = engine->CreateLight("DynLight", csVector3(-19, 120, 34), 300, csColor(1, 1, 1)); if(!light) { app->ReportError("Failed to create light!"); } levelsector->GetLights()->Add(light);
This works fine on an untextured map (where textures get replaced with the checkerboard) , but causes a segfault when I use the textured map.
It is the
levelsector->GetLights()->Add(light);
line that causes the segfault. Valgrind debugger gives me the following:
==28337== Process terminating with default action of signal 11 (SIGSEGV) ==28337== Access not within mapped region at address 0x0 ==28337== at 0x260C0E1B: CastShadows_Front2Back(csKDTree*, void*, unsigned, unsigned&) (in /home/kate/csinstall/lib/crystalspace/frustvis.so) ==28337== by 0x158E90EE: csKDTree::Front2Back(csVector3 const&, bool (*)(csKDTree*, void*, unsigned, unsigned&), void*, unsigned, unsigned) (in /home/kate/csinstall/lib/crystalspace/engine.so) ==28337== by 0x158E9175: csKDTree::Front2Back(csVector3 const&, bool (*)(csKDTree*, void*, unsigned, unsigned&), void*, unsigned, unsigned) (in /home/kate/csinstall/lib/crystalspace/engine.so) ==28337== by 0x158E9125: csKDTree::Front2Back(csVector3 const&, bool (*)(csKDTree*, void*, unsigned, unsigned&), void*, unsigned, unsigned) (in /home/kate/csinstall/lib/crystalspace/engine.so) ==28337== by 0x158E9125: csKDTree::Front2Back(csVector3 const&, bool (*)(csKDTree*, void*, unsigned, unsigned&), void*, unsigned, unsigned) (in /home/kate/csinstall/lib/crystalspace/engine.so) ==28337== by 0x158E9125: csKDTree::Front2Back(csVector3 const&, bool (*)(csKDTree*, void*, unsigned, unsigned&), void*, unsigned, unsigned) (in /home/kate/csinstall/lib/crystalspace/engine.so) ==28337== by 0x158E9125: csKDTree::Front2Back(csVector3 const&, bool (*)(csKDTree*, void*, unsigned, unsigned&), void*, unsigned, unsigned) (in /home/kate/csinstall/lib/crystalspace/engine.so) ==28337== by 0x158E9125: csKDTree::Front2Back(csVector3 const&, bool (*)(csKDTree*, void*, unsigned, unsigned&), void*, unsigned, unsigned) (in /home/kate/csinstall/lib/crystalspace/engine.so) ==28337== by 0x260C570A: csFrustumVis::CastShadows(iFrustumView*) (in /home/kate/csinstall/lib/crystalspace/frustvis.so) ==28337== by 0x158ACEB3: csSector::RealCheckFrustum(iFrustumView*) (in /home/kate/csinstall/lib/crystalspace/engine.so) ==28337== by 0x1584FBCD: csLight::CalculateLighting() (in /home/kate/csinstall/lib/crystalspace/engine.so) ==28337== by 0x158391B9: csEngine::ShineLights(iRegion*, iProgressMeter*) (in /home/kate/csinstall/lib/crystalspace/engine.so)
It looks like a null pointer problem at : CastShadows_Front2Back(csKDTree*, void*, unsigned, unsigned&) (in /home/kate/csinstall/lib/crystalspace/frustvis.so)
any ideas what is causing this. Im assuming it is something to do with the textures but what? Could missing/wrongly applied textures cause the problem?
regards,
Kate Mallichan
|