Crystal Space
Welcome, Guest. Please login or register.
September 23, 2014, 03:36:14 pm

Login with username, password and session length
Search:     Advanced search
9018 Posts in 2051 Topics by 8504 Members
Latest Member: Colleencoffey
* Home Help Search Login Register
  Show Posts
Pages: 1 ... 4 5 [6]
76  Crystal Space Development / Support / Re: Create Sprite2D from Code on: July 31, 2009, 04:05:11 pm
Here is some sample code which should do the trick:

Code:
  // create the factory:
  csRef<iMeshFactoryWrapper> fact = engine->CreateMeshFactory("crystalspace.mesh.object.sprite.2d", "lineFact");
  csRef<iGeneralFactoryState> factState = scfQueryInterface<iGeneralFactoryState> (fact->GetMeshObjectFactory ());
  fact->GetMeshObjectFactory()->SetMaterialWrapper(myMaterial);

  // create the mesh
  csRef<iMeshWrapper> mesh = engine->CreateMeshWrapper (fact, "line");
  csRef<iSprite2DState> state = scfQueryInterface<iSprite2DState> (mesh->GetMeshObject());

  // create vertices.
  iColoredVertices* v = state->GetVertices();
  v->SetSize(4);
  v->Get(0).pos.x = -1;
  v->Get(0).pos.y = 1;
  v->Get(0).u = 0;
  v->Get(0).v = 0;
  v->Get(1).pos.x = 1;
  v->Get(1).pos.y = 1;
  v->Get(1).u = 1;
  v->Get(1).v = 0;
  v->Get(2).pos.x = 1;
  v->Get(2).pos.y = -1;
  v->Get(2).u = 1;
  v->Get(2).v = 1;
  v->Get(3).pos.x = -1;
  v->Get(3).pos.y = -1;
  v->Get(3).u = 0;
  v->Get(3).v = 1;

  v->Get(0).color_init.Set(1, 1, 1);
  v->Get(1).color_init.Set(1, 1, 1);
  v->Get(2).color_init.Set(1, 1, 1);
  v->Get(3).color_init.Set(1, 1, 1);

  // position the mesh
  iMovable* movable = mesh->GetMovable();
  movable->SetSector(room);
  movable->SetPosition(csVector3 (1, 1, 1));
  movable->UpdateMove();
77  Associate Projects / CEL Discussion / Re: Nettest Troubles on: March 19, 2009, 03:51:23 pm
The network plugin needs an external library which is currently not in the CS library packages, that's why the network plugin is not compiled on your machine and you got these error messages.

The library needed is HawkNL. You can download it from http://www.hawksoft.com/download/, either the release 168 or 17b1 should be OK.

I personally could not manage to have the cel configure script detect if HawkNL was installed or not. In order to make it work, I hacked it with something like (as I remember):
- install the HawkNL .h and .dll/.so somewhere where it is visible when you compile and run nettest
- modify the cel/plugins/network/tcp/Jamfile file by removing the line "if $(HAWKNL.AVAILABLE) = "yes""
- compile and run

Note that the network plugin is still a work in progress. It is still missing some API changes and mostly an abstraction layer so that it works smoothly and easily with cel applications. I am the guy who wrote this plugin and I still want to work on it, but could not manage to find some time to do it. But it still something I really want to do...
78  Crystal Space Project Development / Bug Reports / Re: could not load plugin 'crystalspace.window.x.extf86vm' on: November 08, 2005, 05:32:04 pm
Alright, perfect!

I re-compiled everything with gcc 4.02 and everything works great now.
For the history, I also tried with gcc 2.95 but it leads to the same segfaults.

Thanks a lot Eric!
79  Crystal Space Project Development / Bug Reports / Re: could not load plugin 'crystalspace.window.x.extf86vm' on: November 07, 2005, 04:30:43 pm
Thanks a lot Eric for your comments.

The lack of the xextf86vm plugin is no more a problem, I simply missed to install the libxxf86vm-dev package, and I'm really sorry about that.

I was also effectively using gcc 4.0.1, and I'm still very sorry about that.
So I tried with gcc-3.3 but the problem persists and all applications except g2dtest appears to raise a segfault.

To change the compiler, I installed the version 3.3.6 by using apt-get, then used "export CC=gcc-3.3" to change the compiler to be used, then "configure" and "jam" on a new cvs checkout. The config.log file confirms that gcc-3.3 is used:

configure:1620: checking for gcc
configure:1646: result: gcc-3.3
configure:1890: checking for C compiler version
configure:1893: gcc-3.3 --version </dev/null >&5
gcc-3.3 (GCC) 3.3.6 (Debian 1:3.3.6-7)

I tried to see the backtrace on various applications, all of them were generating a segfault in the csEngine::ShineLights method, while walktest was crashing during csLoader::ParseSector.
Here are some backtraces:

walktest
--------
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1210898208 (LWP 8506)]
0xb6d7d3ef in ~csRef (this=0xb6faf91d) at ref.h:184
184         CSREF_TRACK_DECREF (obj, this);
(gdb) bt full
#0  0xb6d7d3ef in ~csRef (this=0xb6faf91d) at ref.h:184
No locals.
#1  0xb6d740dd in csLoader::ParseSector (this=0xd8000000,
    ldr_context=0x2b6faf9, node=0xc0000000, ssource=0x2b6faf9)
    at plugins/csparser/csloader.cpp:5027
        meshname = 0x4008177a <Address 0x4008177a out of bounds>
        mesh = {obj = 0xe8000000}
        child = {obj = 0x2000000}
        value = 0x2b6faf9 <Address 0x2b6faf9 out of bounds>
        id = 3892314132
        do_culler = 120
        culplugname = 0x2b6faf9 <Address 0x2b6faf9 out of bounds>
        sector = (class iSector *) 0x60000000
        secname = 0x2000000 <Address 0x2000000 out of bounds>
        culler_params = {obj = 0x2b6faf9}
        it = {obj = 0x40000000}
Previous frame inner to this frame (corrupt stack?)


pathtut
-------
0xb6fa0c68 in csEngine::ShineLights (this=0x8148668, region=0x0, meter=0x0)
    at plugins/engine/3d/engine.cpp:1465
1465        if (s->GetMovable ()->GetSectors ()->GetCount () <= 0 &&
(gdb) bt full
#0  0xb6fa0c68 in csEngine::ShineLights (this=0x8148668, region=0x0, meter=0x0)
    at plugins/engine/3d/engine.cpp:1465
        s = (class iMeshWrapper *) 0x85312f8
        current = {lm_version = 3, normal_light_level = 128, ambient_red = 20,
  ambient_green = 20, ambient_blue = 20, cosinus_factor = 0, lightmap_size = 0}
        reason = 0xb709d574 "no 'lm_precalc_info' found in cache"
        num_meshes = 1
        failed_meshes = {count = 0, capacity = 0, threshold = 16, root = 0x0}
        light_count = 3
        failed = 0
        max_failed_meshes = 4
        start = 3070368477
        cm = (class iCacheManager *) 0x85307e4
        data = {obj = 0x0}
        lit = {obj = 0x8530a6c}
        stop = 3220901160
        do_relight = true
        l = (class iLight *) 0x85313cc
        sn = 0
#1  0xb6f9983f in csEngine::Prepare (this=0x8148668, meter=0x0)
    at plugins/engine/3d/engine.cpp:1177
No locals.
#2  0x0804bf41 in PathTut::Initialize (this=0x8133df0, argc=1, argv=0xbffb1044)
---Type <return> to continue, or q <return> to quit---
    at apps/tutorial/pathtut/pathtut.cpp:236
        walls = {obj = 0x85312f8}
        walls_state = {obj = 0x8530b30}
        ll = (class iLightList *) 0x852f9a8
        txtmgr = (class iTextureManager *) 0x0
        m = {m11 = 0, m12 = -2.70834316e-05, m13 = -2.99482199e-05,
  m21 = 9.80908925e-45, m22 = -2.7361617e-05, m23 = 1.40129846e-45,
  m31 = -2.72453763e-05, m32 = 1.40129846e-45, m33 = -2.70834316e-05}
        spstate = {obj = 0x80f2810}
        txt = (class iTextureWrapper *) 0x813707c
        tm = (class iMaterialWrapper *) 0x852f770
        ws = {obj = 0x8530ef8}
        light = {obj = 0x85321f0}
        g2d = (class iGraphics2D *) 0x30
        imeshfact = {obj = 0xbffb0ed0}
#3  0x0804c595 in main (argc=1, argv=0xbffb1044)
    at apps/tutorial/pathtut/pathtut.cpp:385
        object_reg = (class iObjectRegistry *) 0x813707c


simple1
-------
0xb6f97c68 in csEngine::ShineLights (this=0x8146620, region=0x0, meter=0x0)
    at plugins/engine/3d/engine.cpp:1465
1465        if (s->GetMovable ()->GetSectors ()->GetCount () <= 0 &&
(gdb) bt full
#0  0xb6f97c68 in csEngine::ShineLights (this=0x8146620, region=0x0, meter=0x0)
    at plugins/engine/3d/engine.cpp:1465
        s = (class iMeshWrapper *) 0x852f490
        current = {lm_version = 3, normal_light_level = 128, ambient_red = 20,
  ambient_green = 20, ambient_blue = 20, cosinus_factor = 0, lightmap_size = 0}
        reason = 0xb7094574 "no 'lm_precalc_info' found in cache"
        num_meshes = 1
        failed_meshes = {count = 0, capacity = 0, threshold = 16, root = 0x0}
        light_count = 3
        failed = 0
        max_failed_meshes = 4
        start = 3070331613
        cm = (class iCacheManager *) 0x852e97c
        data = {obj = 0x0}
        lit = {obj = 0x852ec04}
        stop = 3220855944
        do_relight = true
        l = (class iLight *) 0x852f564
        sn = 0
#1  0xb6f9083f in csEngine::Prepare (this=0x8146620, meter=0x0)
    at plugins/engine/3d/engine.cpp:1177
No locals.
#2  0x0804bb05 in Simple::Application (this=0xbffa5d98)
    at apps/tutorial/simple1/simple1.cpp:199
        g2d = (class iGraphics2D *) 0x810cca4
#3  0x0805bc1c in csApplicationFramework::Start ()
    at libs/cstool/csapplicationframework.cpp:71
No locals.
#4  0x0805bdd3 in csApplicationFramework::Main (this=0xbffa5d98, argc=1,
    argv=0xbffa5e94) at libs/cstool/csapplicationframework.cpp:124
        iReturn = 0
#5  0x0804da3f in csApplicationRunner<Simple>::Run (argc=1, argv=0xbffa5e94)
    at csapplicationframework.h:433
        app = {<csApplicationFramework> = {<csInitializer> = {<No data fields>}, _vptr.csApplicationFramework = 0x80e070c, static m_Ptr = 0xbffa5d98,
    static m_FoundationStringName = 0x80e1adc "crystalspace.libcsappframe",
    static m_ApplicationStringName = 0x80e0c18 "CrystalSpace.Simple1",
    restartFlag = false,
    static object_reg = 0x813507c}, <csBaseEventHandler> = {<scfImplementation1<csBaseEventHandler,iEventHandler>> = {<scfImplementation<csBaseEventHandler>> = {<iBase> = {_vptr.iBase = 0x80e0750}, scfObject = 0xbffa5da0, scfRefCount = 2,
        scfParent = 0x0,
        scfWeakRefOwners = 0x0}, <iEventHandler> = {<No data fields>}, <No data fields>}, queue = {obj = 0x812d064}, static pmfnTriggers = {{
        __pfn = 0x51 <scfImplementation<csBaseEventHandler>::RemoveRefOwner(iBase**)+65>, __delta = 0}, {
        __pfn = 0x39 <scfImplementation<csBaseEventHandler>::RemoveRefOwner(iBase**)+41>, __delta = 0}, {
        __pfn = 0x3d <scfImplementation<csBaseEventHandler>::RemoveRefOwner(iBas---Type <return> to continue, or q <return> to quit---
e**)+45>, __delta = 0}, {
        __pfn = 0x41 <scfImplementation<csBaseEventHandler>::RemoveRefOwner(iBase**)+49>, __delta = 0}, {
        __pfn = 0x45 <scfImplementation<csBaseEventHandler>::RemoveRefOwner(iBase**)+53>, __delta = 0}, {
        __pfn = 0x49 <scfImplementation<csBaseEventHandler>::RemoveRefOwner(iBase**)+57>, __delta = 0}, {
        __pfn = 0x4d <scfImplementation<csBaseEventHandler>::RemoveRefOwner(iBase**)+61>, __delta = 0}, {
        __pfn = 0x2d <scfImplementation<csBaseEventHandler>::RemoveRefOwner(iBase**)+29>, __delta = 0}, {
        __pfn = 0x31 <scfImplementation<csBaseEventHandler>::RemoveRefOwner(iBase**)+33>, __delta = 0}, {
        __pfn = 0x35 <scfImplementation<csBaseEventHandler>::RemoveRefOwner(iBase**)+37>, __delta = 0}, {
        __pfn = 0x29 <scfImplementation<csBaseEventHandler>::RemoveRefOwner(iBase**)+25>, __delta = 0}, {
        __pfn = 0x25 <scfImplementation<csBaseEventHandler>::RemoveRefOwner(iBase**)+21>, __delta = 0}, {__pfn = 0, __delta = 0}, {__pfn = 0, __delta = 0}, {
        __pfn = 0, __delta = 0}, {__pfn = 0, __delta = 0}, {__pfn = 0,
        __delta = 0}, {__pfn = 0, __delta = 0}}}, engine = {obj = 0x8146658},
  loader = {obj = 0x8148768}, g3d = {obj = 0x810c21c}, kbd = {
    obj = 0x8107a24}, vc = {obj = 0x812cc4c}, view = {obj = 0x852bcf4},
  room = 0x852da68, rotX = -1.95599079, rotY = 4.27349594e-34}
        result = 0
        again = 8
#6  0x0804b666 in main (argc=1, argv=0xbffa5e94)
    at apps/tutorial/simple1/simple1.cpp:263
No locals.


Any ideas?
80  Crystal Space Project Development / Bug Reports / could not load plugin 'crystalspace.window.x.extf86vm' on: November 04, 2005, 01:34:03 pm
Hi all.

I try to run CS on my new Debian testing system (the 'etch' distribution).
When I launch walktest or any other test program (except g2dtest which works perfectly), the system generates the following message then raise a segmentation fault:

WARNING: could not load plugin 'crystalspace.window.x.extf86vm'

The error is most presumably linked to the fact that the X11 client distributed with Debian 'etch' is no more XFree86 and has been replaced by X.org.
This is due to the fact that the licence of XFree86 has been changed recently, and do no more fit with the views of the open-source community. In response to that, most of the GNU/Linux distributions such as Debian, Fedora, Slackware, FreeBSD,... have migrated to the X.org X11 client. You can find some info on that via http://www.debian-administration.org/articles/185

Can someone tell what has to be done in order to run CS on X.org?

Thanks a lot
Pages: 1 ... 4 5 [6]
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 6.187 seconds with 16 queries.