Crystal Space
Welcome, Guest. Please login or register.
March 28, 2015, 08:15:14 pm

Login with username, password and session length
Search:     Advanced search
9035 Posts in 2050 Topics by 9714 Members
Latest Member: Ronamonay
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  lighting causing segfault only with textured level
« previous next »
Pages: [1] Print
Author Topic: lighting causing segfault only with textured level  (Read 1241 times)
koocake
Jr. Member
**
Posts: 54


View Profile
« 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
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #1 on: May 04, 2006, 07:12:55 am »

Is there some way that I can reproduce this? i.e. can you send me the map and some code that shows the problem? Or maybe loading the map in walktest also demonstrates the problem?

Greetings,
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 4.685 seconds with 15 queries.