Crystal Space
Welcome, Guest. Please login or register.
October 21, 2014, 03:01:30 pm

Login with username, password and session length
Search:     Advanced search
9010 Posts in 2044 Topics by 8776 Members
Latest Member: Nowelc
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  Problem loading more than 1 level.
« previous next »
Pages: [1] Print
Author Topic: Problem loading more than 1 level.  (Read 3895 times)
Janther
Newbie
*
Posts: 19


View Profile Email
« on: July 09, 2008, 11:58:36 pm »

In my 3d handler class i have thhe folowing code for loading a map

Code:
bool Owner3D::LoadMap (const char* mapname)
{
  view1.Invalidate();

  engine->DeleteAll();
  vfs->ChDir (mapname);
  if (!loader->LoadMapFile ("world")) return false;
  engine->Prepare ();

  return true;
}

And this one for seting the camera.

Code:
bool Owner3D::StartCamera()
{
  iGraphics2D* g2d = g3d->GetDriver2D ();
  view1.AttachNew(new csView (engine, g3d));
  view1->SetRectangle (0, 0, g2d->GetWidth (), g2d->GetHeight ());

  csVector3 pos (0);
  if (engine->GetCameraPositions ()->GetCount () > 0)
  {
    iCameraPosition* campos = engine->GetCameraPositions ()->Get (0);
    room = engine->GetSectors ()->FindByName (campos->GetSector ());
    pos = campos->GetPosition ();
  }
  else
  {
    room = engine->GetSectors ()->FindByName ("room");
    pos = csVector3 (0, 0, 0);
  }
  if (!room)
    return false;

  view1->GetCamera ()->SetSector (room);
  view1->GetCamera ()->GetTransform ().SetOrigin (pos);
}

The thing is that when i load the 1st map everithing goes smooth bu the instant i want to load a second level, it throws me an error.

any sugestions┬┐?

PD:

this is the order for calling the methods

Code:
  owner3d.LoadMap(gameMap);
  owner3d.StartCamera();
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #1 on: July 10, 2008, 07:26:02 am »

Can you be more specific to the error? What error? And if it is a crash it would be helpful to get us a stack backtrace from the debugger.

Greetings,
Logged
Janther
Newbie
*
Posts: 19


View Profile Email
« Reply #2 on: July 10, 2008, 05:37:29 pm »

ok the last version had a problem with the iView being NULL the second time i fixed it and here is the second version of my class:


Code:
#ifndef __OWNER3D_H__
#define __OWNER3D_H__

#include <crystalspace.h>
#include <iengine/camera.h>
#include <csgeom/transfrm.h>

class Owner3D
{
private:
  csRef<iEngine> engine;

  csRef<iLoader> loader;

  csRef<iGraphics3D> g3d;

  csRef<iView> view1;

  csRef<iVFS> vfs;

  csRef<iConfigManager> confman;

  iSector* room;

  bool LoadConfig();
 
  csString menuMap;

public:

  Owner3D ();

  Owner3D (csRef<iEngine> engine,
  csRef<iLoader> loader,
  csRef<iGraphics3D> g3d,
  csRef<iVFS> vfs,
  csRef<iConfigManager> confman);

  ~Owner3D ();

  bool Setup ();

  void ProcessFrame ();
   
  void FinishFrame ();

  bool LoadMap (const char* mapname);
};

#endif //__OWNER3D_H__


Code:
#include "Owner3D.h"

//-----------------------------------------------------------------------------

Owner3D::Owner3D ()
{
}
Owner3D::Owner3D (csRef<iEngine> engine,
  csRef<iLoader> loader,
  csRef<iGraphics3D> g3d,
  csRef<iVFS> vfs,
  csRef<iConfigManager> confman)
{
  this->engine = engine;
  this->loader = loader;
  this->g3d = g3d;
  this->vfs = vfs;
  this->confman = confman;
}

Owner3D::~Owner3D ()
{
}

bool Owner3D::Setup ()
{
  LoadConfig();

  if (!LoadMap (menuMap.GetData())) return false;

  return true;
}

void Owner3D::ProcessFrame ()
{
  if (!g3d->BeginDraw (engine->GetBeginDrawFlags () | CSDRAW_3DGRAPHICS))
    return;
  view1->Draw ();
}

void Owner3D::FinishFrame ()
{
g3d->FinishDraw ();
g3d->Print (0);
}

bool Owner3D::LoadMap (const char* mapname)
{

  engine->DeleteAll();
  vfs->ChDir (mapname);
  if (!loader->LoadMapFile ("world")) return false;
  engine->Prepare ();

  iGraphics2D* g2d = g3d->GetDriver2D ();
  view1.AttachNew(new csView (engine, g3d));
  view1->SetRectangle (0, 0, g2d->GetWidth (), g2d->GetHeight ());

  csVector3 pos (0, 0, 0);
  if (engine->GetCameraPositions ()->GetCount () > 0)
  {
    iCameraPosition* campos = engine->GetCameraPositions ()->Get (0);
    room = engine->GetSectors ()->FindByName (campos->GetSector ());
    pos = campos->GetPosition ();
  }

  view1->GetCamera ()->SetSector (room);
  view1->GetCamera ()->GetTransform ().SetOrigin (pos);

  return true;
}


bool Owner3D::LoadConfig()
{
menuMap = confman->GetStr("Dado.Settings.MenuLevel","MenuMap");
return true;
}

But the problem still exist, this is the exception i get:

Code:
Unhandled exception at 0x08c2980c (engine.dll) in Owner.exe: 0xC0000005: Access violation reading location 0x000000cf.

and it ocures in the line 1504 of engine.cpp

im using:
crystalspace-src-1.2
cs-win32libs-1.3_003
Visual Studio 2005

the order i execute the functions from the main class are:
Code:
  owner3d = Owner3D (engine,
  loader,
  g3d,
  vfs,
  confman);
  if(!owner3d.Setup())
    return false;

and then after a while:

Code:
owner3d.LoadMap(gameMap);
in this moment i get the exception.
« Last Edit: July 10, 2008, 06:36:30 pm by Janther » Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #3 on: July 10, 2008, 07:23:17 pm »

I don't have the 1.2 source with me at the moment but could you tell me what is at line 1504 of engine.cpp (and around it).

Also having the full backtrace of callstack would probably also help.

Greetings,
Logged
Janther
Newbie
*
Posts: 19


View Profile Email
« Reply #4 on: July 10, 2008, 08:12:24 pm »

here is the backtrace:

Code:
'Owner.exe': Loaded 'D:\CS\Owner.exe', Symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\system32\ntdll.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\system32\kernel32.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\CS\libCEGUIBase-csvc8.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\libfreetype2-cs.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.1433_x-ww_5cf844d2\msvcr80.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\system32\msvcrt.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.1433_x-ww_5cf844d2\msvcp80.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\system32\user32.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\system32\gdi32.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\system32\advapi32.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\system32\rpcrt4.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\system32\secur32.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\system32\shell32.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\system32\shlwapi.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\system32\imm32.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2982_x-ww_ac3f9c03\comctl32.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\system32\comctl32.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\CS\vfs.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\libz-cs.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\system32\shfolder.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\CS\fontplex.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\freefnt2.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\csfont.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\gl3d.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\system32\opengl32.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\system32\glu32.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\system32\ddraw.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\system32\dciman32.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\CS\glwin32.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\system32\version.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\CS\csconin.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\csconout.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\imgplex.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\xmlread.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\engine.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\csparser.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\cssynldr.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\sndmanager.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\reporter.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\stdrep.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\cscegui.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\system32\uxtheme.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\Archivos de programa\Stardock\ObjectDock\DockShellHook.dll', Binary was not built with debug information.
'Owner.exe': Loaded 'D:\WINDOWS\system32\msctf.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\system32\MSCTFIME.IME', No symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\system32\ole32.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\WINDOWS\system32\nvoglnt.dll', Binary was not built with debug information.
'Owner.exe': Loaded 'D:\WINDOWS\system32\mcd32.dll', No symbols loaded.
'Owner.exe': Unloaded 'D:\WINDOWS\system32\mcd32.dll'
'Owner.exe': Loaded 'D:\CS\shadermgr.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\xmlshader.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\rendstep_std.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\thing.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\csbmpimg.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\csddsimg.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\csgifimg.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\csjngimg.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\libmng-cs.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\libjpeg-cs.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\csjpgimg.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\cspngimg.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\libpng-cs.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\gmeshldr.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\genmesh.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\nullmesh.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\rendloop_loader.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\simpleformerldr.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\simpleformer.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\terrainldr.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\bruteblock.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\thingldr.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\libCEGUITinyXMLParser-csvc8.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\cstgaimg.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\libCEGUIFalagardWRBase-csvc8.dll', Symbols loaded.
First-chance exception at 0x7c812a5b in Owner.exe: Microsoft C++ exception: CEGUI::UnknownObjectException at memory location 0x0012e1f4..
First-chance exception at 0x7c812a5b in Owner.exe: Microsoft C++ exception: CEGUI::UnknownObjectException at memory location 0x0012dfd4..
First-chance exception at 0x7c812a5b in Owner.exe: Microsoft C++ exception: CEGUI::UnknownObjectException at memory location 0x0012dfb4..
First-chance exception at 0x7c812a5b in Owner.exe: Microsoft C++ exception: CEGUI::UnknownObjectException at memory location 0x0012dfb4..
First-chance exception at 0x7c812a5b in Owner.exe: Microsoft C++ exception: CEGUI::UnknownObjectException at memory location 0x0012dfb4..
First-chance exception at 0x7c812a5b in Owner.exe: Microsoft C++ exception: CEGUI::UnknownObjectException at memory location 0x0012dfb4..
First-chance exception at 0x7c812a5b in Owner.exe: Microsoft C++ exception: CEGUI::UnknownObjectException at memory location 0x0012e084..
First-chance exception at 0x7c812a5b in Owner.exe: Microsoft C++ exception: CEGUI::UnknownObjectException at memory location 0x0012e084..
First-chance exception at 0x7c812a5b in Owner.exe: Microsoft C++ exception: CEGUI::UnknownObjectException at memory location 0x0012e084..
First-chance exception at 0x7c812a5b in Owner.exe: Microsoft C++ exception: CEGUI::UnknownObjectException at memory location 0x0012e1f4..
First-chance exception at 0x7c812a5b in Owner.exe: Microsoft C++ exception: CEGUI::UnknownObjectException at memory location 0x0012dfd4..
First-chance exception at 0x7c812a5b in Owner.exe: Microsoft C++ exception: CEGUI::UnknownObjectException at memory location 0x0012dfb4..
First-chance exception at 0x7c812a5b in Owner.exe: Microsoft C++ exception: CEGUI::UnknownObjectException at memory location 0x0012dfb4..
First-chance exception at 0x7c812a5b in Owner.exe: Microsoft C++ exception: CEGUI::UnknownObjectException at memory location 0x0012dfb4..
First-chance exception at 0x7c812a5b in Owner.exe: Microsoft C++ exception: CEGUI::UnknownObjectException at memory location 0x0012dfb4..
First-chance exception at 0x7c812a5b in Owner.exe: Microsoft C++ exception: CEGUI::UnknownObjectException at memory location 0x0012e084..
First-chance exception at 0x7c812a5b in Owner.exe: Microsoft C++ exception: CEGUI::UnknownObjectException at memory location 0x0012dfd4..
'Owner.exe': Loaded 'D:\CS\frustvis.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\glshader_fixed.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\glshader_arb.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\glshader_cg.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\cg.dll', Binary was not built with debug information.
'Owner.exe': Loaded 'D:\CS\cgGL.dll', Binary was not built with debug information.
'Owner.exe': Loaded 'D:\WINDOWS\system32\oleaut32.dll', No symbols loaded.
'Owner.exe': Loaded 'D:\CS\particlesldr.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\particles.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\dynavis.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\engseq.dll', Symbols loaded.
'Owner.exe': Loaded 'D:\CS\sequence.dll', Symbols loaded.
First-chance exception at 0x08c2980c (engine.dll) in Owner.exe: 0xC0000005: Access violation reading location 0x0000008a.
Unhandled exception at 0x08c2980c (engine.dll) in Owner.exe: 0xC0000005: Access violation reading location 0x0000008a.

Code:
engine.dll!csEngine::Draw(iCamera * c=0x0b448458, iClipper2D * view=0x000001c2, iMeshWrapper * mesh=0x00000000)  Line 1504 + 0x2 bytes C++
  Owner.exe!csView::Draw(iMeshWrapper * mesh=0x00000000)  Line 160 + 0x1a bytes C++
  Owner.exe!OwnerApp::ProcessFrame()  Line 66 C++
  Owner.exe!csBaseEventHandler::HandleEvent(iEvent & event={...})  Line 124 + 0x7 bytes C++
  Owner.exe!csEventTree::Dispatch(iEvent & e={...})  Line 576 + 0x9 bytes C++
  Owner.exe!csEventTree::Notify()  Line 547 C++
  Owner.exe!csEventQueue::iTypedFrameEventDispatcher::HandleEvent(iEvent & __formal={...})  Line 262 + 0x36 bytes C++
  Owner.exe!csEventTree::Dispatch(iEvent & e={...})  Line 576 + 0x9 bytes C++
  Owner.exe!csEventTree::Notify()  Line 547 C++
  Owner.exe!csEventQueue::Process()  Line 298 C++
  Owner.exe!csDefaultRunLoop(iObjectRegistry * r=0x00b01ce8)  Line 91 + 0x8 bytes C++
  Owner.exe!OwnerApp::Application()  Line 145 + 0xc bytes C++
  Owner.exe!csApplicationFramework::Main(int argc=1, char * * argv=0x003c6ec8)  Line 131 + 0xd bytes C++
  Owner.exe!csApplicationRunner<OwnerApp>::Run(int argc=1, char * * argv=0x00000000)  Line 442 C++
  Owner.exe!WinMain(HINSTANCE__ * hApp=0x00400000, HINSTANCE__ * prev=0x00000000, char * cmd=0x00151ef2, int show=1)  Line 3 + 0x16 bytes C++
  Owner.exe!__tmainCRTStartup()  Line 578 + 0x1d bytes C
> kernel32.dll!7c816fd7()
  [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]

and here is the function arround line 1504:

Code:
void csEngine::Draw (iCamera *c, iClipper2D *view, iMeshWrapper* mesh)
{
  if (bugplug)
    bugplug->ResetCounter ("Sector Count");

  currentFrameNumber++;
  ControlMeshes ();
  csRef<csRenderView> rview;
  rview.AttachNew (new (rviewPool) csRenderView (c, view, G3D, G2D));
  StartDraw (c, view, *rview);

  // First initialize G3D with the right clipper.
  G3D->SetClipper (view, CS_CLIPPER_TOPLEVEL);  // We are at top-level.
  G3D->ResetNearPlane ();
  G3D->SetPerspectiveAspect (c->GetFOV ());

  FireStartFrame (rview);

  iSector *s = c->GetSector ();
  if (s)
  {
//**********line 1504*************//
    iRenderLoop* rl = s->GetRenderLoop ();
    if (!rl) rl = defaultRenderLoop;
    rl->Draw (rview, s, mesh);
  }

  // draw all halos on the screen
  if (halos.GetSize () > 0)
  {
    csTicks elapsed = virtualClock->GetElapsedTicks ();
    size_t halo = halos.GetSize ();
    while (halo-- > 0)
      if (!halos[halo]->Process (elapsed, c, this))
halos.DeleteIndex (halo);
  }
  G3D->SetClipper (0, CS_CLIPPER_NONE);
}
« Last Edit: July 11, 2008, 05:53:55 pm by Janther » Logged
Janther
Newbie
*
Posts: 19


View Profile Email
« Reply #5 on: July 11, 2008, 09:54:13 pm »

after a few tries i discovered that the problem is in how i execute the function.

i when i execute the function in a keyboard related event it works however when i use a CEGUI button it craches.

here is the Gui handler class
Code:
#ifndef __OWNERGUI_H__
#define __OWNERGUI_H__

#include <crystalspace.h>
#include "ivaria/icegui.h"
#include "Owner3D.h"


class OwnerGui
{
private:

  iObjectRegistry* objectRegistry;

  csRef<iCEGUI> cegui;

  csRef<iVFS> vfs;

  csRef<iConfigManager> confman;

  csString layoutOpciones;

  csString layoutMenu;
 
  csString gameMap;

  CEGUI::WindowManager* winMgr;

  Owner3D owner3d;

  bool LoadLayout (const char* layoutname);

  bool SetButtonsMenu();

  bool SetButtonsOptions();

public:

  OwnerGui ();

  OwnerGui (csRef<iVFS> vfs,
  csRef<iCEGUI> cegui,
  iObjectRegistry* objectRegistry,
  csRef<iConfigManager> confman,
  Owner3D owner3d);

  ~OwnerGui ();

  void ProcessFrame ();

  void FinishFrame ();

  bool LoadConfig();


  bool OnNewGameButtonClicked (const CEGUI::EventArgs& e);

};

#endif //__OWNERGUI_H__

Code:
#include "OwnerGui.h"

//-----------------------------------------------------------------------------

OwnerGui::OwnerGui ()
{
}
OwnerGui::OwnerGui (csRef<iVFS> vfs,
csRef<iCEGUI> cegui,
iObjectRegistry* objectRegistry,
csRef<iConfigManager> confman,
Owner3D owner3d)
{
  this->vfs = vfs;
  this->cegui = cegui;
  this->objectRegistry = objectRegistry;
  this->confman = confman;
  this->owner3d = owner3d;
}

OwnerGui::~OwnerGui ()
{
}


void OwnerGui::ProcessFrame ()
{
  cegui->Render ();
}

void OwnerGui::FinishFrame ()
{
}

bool OwnerGui::LoadConfig()
{
  layoutMenu = confman->GetStr("Dado.Settings.Menu","menu");
  layoutOpciones = confman->GetStr("Dado.Settings.Opciones","opciones");
  gameMap = confman->GetStr("Dado.Settings.GameLevel","GameMap");
  cegui->Initialize ();

  cegui->GetLoggerPtr ()->setLoggingLevel(CEGUI::Informative);

  vfs->ChDir ("/lev/dado/0.5/");

  cegui->GetSchemeManagerPtr ()->loadScheme("WindowsLook.scheme");

  cegui->GetSystemPtr ()->setDefaultMouseCursor("WindowsLook", "MouseArrow");

  CEGUI::Font* font = cegui->GetFontManagerPtr ()->createFont("FreeType",
    "Vera", "/fonts/ttf/Vera.ttf");
  font->setProperty("PointSize", "10");
  font->load();

  winMgr = cegui->GetWindowManagerPtr ();

  if (!LoadLayout (layoutMenu.GetData())) return false;
  if (!SetButtonsMenu ()) return false;

  return true;
}

bool OwnerGui::SetButtonsMenu()
{
  CEGUI::Window* newGameBtn = winMgr->getWindow("Root/menu/newGame");
  newGameBtn->subscribeEvent(CEGUI::PushButton::EventClicked,
    CEGUI::Event::Subscriber(&OwnerGui::OnNewGameButtonClicked, this));
}

bool OwnerGui::LoadLayout (const char* layoutname)
{
  winMgr->destroyAllWindows();
  vfs->ChDir ("/lev/dado/0.5/");
  cegui->GetSystemPtr ()->setGUISheet(winMgr->loadWindowLayout(layoutname));
  return true;
}

bool OwnerGui::OnNewGameButtonClicked (const CEGUI::EventArgs&)
{
  owner3d.LoadMap(gameMap.GetData());();
  return true;
}

any thoughts on the problem┬┐?

thanks
Logged
Njoc
Newbie
*
Posts: 27


View Profile Email
« Reply #6 on: July 14, 2008, 04:31:21 pm »

Hmm, why do you use 1.3 win32 suupport libs? Use version 1.2_002 , maybe it helps.
Logged
Janther
Newbie
*
Posts: 19


View Profile Email
« Reply #7 on: July 14, 2008, 05:17:42 pm »

thanks for the advise, im going skiing for a weeck so ill try that solution when i return to the civilization in a weeck from now.

i'll keep you posted whether that works or not.

Greetings
Logged
Janther
Newbie
*
Posts: 19


View Profile Email
« Reply #8 on: July 21, 2008, 04:47:54 pm »

At the end i had the exact same problem with the previous release of win32libs, for now ill just ask the pleyer to press enter to start a new game till I figure the exact problem.

Thanks anyway
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 8.495 seconds with 16 queries.