Crystal Space
Welcome, Guest. Please login or register.
December 18, 2014, 10:42:09 pm

Login with username, password and session length
Search:     Advanced search
9032 Posts in 2046 Topics by 9288 Members
Latest Member: Lorrainewhite
* Home Help Search Login Register
  Show Posts
Pages: [1] 2
1  Crystal Space Development / Support / Re: how to create a "loading level" sequence on: August 07, 2008, 02:47:56 am
after a few investigations i discovered the iProgressMeter class but i dont get how to actually use it and also in this topic http://www.crystalspace3d.org/forum/index.php/topic,419.0.html it says that displaying an image, it would remain through the loading proses.

here is my code for the last option:

Code:
engine->DeleteAll();
vfs->ChDir (mapname);
g2d = g3d->GetDriver2D ();

csRef<iTextureManager> txtmgr = g3d->GetTextureManager ();
csRef<iDataBuffer> buf = vfs->ReadFile ("water.jpg");
csRef<iImage> ifile = imgldr->Load (buf, txtmgr->GetTextureFormat ());
csRef<iTextureHandle> txt = txtmgr->RegisterTexture (ifile, CS_TEXTURE_2D);
img_name = new csSimplePixmap (txt);
img_name->DrawScaled(g3d, 0, 0, g2d->GetWidth(), g2d->GetHeight());

if (!loader->LoadMapFile ("world")) return false;
engine->Prepare();

but i dont see any changes. Am i loading it right? am i suposed to use another image tipe?

any help on how to use the progressmeter or the image would be thanked
2  Crystal Space Development / Support / how to create a "loading level" sequence on: August 04, 2008, 04:02:25 am
I posted this topic in the Tutorial Request Section but since i haven`t got any luck ill try here since its also about development:

Im pretty much done with the first beta of my proyect and to finish some details could anyone show me where to find a tutorial to show loading sequence while loading the game and levels since now i just show the CS output.

like the game Worms that shows a cake bieng eaten or just a loading bar.
3  Miscellaneous / Article/Tutorial Requests / how to create a "loading level" sequence on: August 01, 2008, 09:53:06 pm
Im pretty much done with the first beta of my proyect and to finish some details could anyone show me where to find a tutorial to show loading sequence while loading the game and levels since now i just show the CS output.

like worms that shows a cake bieng eaten or just a loading bar.
4  Crystal Space Development / Support / Re: splited camera lookat problem on: July 29, 2008, 12:16:32 am
I solved it

after a while looking at the functions of view, camera and transform i found

Code:
view[0]->GetCamera()->SetPerspectiveCenter(
g2d->GetWidth() / 4,
g2d->GetHeight()*3/4);
this centeres the horizont to the point in the window you want.

thanks anyway
5  Crystal Space Development / Support / splited camera lookat problem on: July 28, 2008, 11:37:09 pm
im spliting the camera in four with this code

Code:
for (i; i < 4; i++) {
view[i].AttachNew(new csView (engine, g3d));
view[i]->GetCamera ()->SetSector (room);
view[i]->GetCamera ()->GetTransform ().SetOrigin (pos);
}
view[0]->SetRectangle(0, g2d->GetHeight() / 2, g2d->GetWidth() / 2, g2d->GetHeight() / 2);
view[1]->SetRectangle(g2d->GetWidth() / 2, g2d->GetHeight() / 2, g2d->GetWidth() / 2, g2d->GetHeight() / 2);
view[2]->SetRectangle(0, 0, g2d->GetWidth() / 2, g2d->GetHeight() / 2);
view[3]->SetRectangle(g2d->GetWidth() / 2, 0, g2d->GetWidth() / 2, g2d->GetHeight() / 2);

and im trying to look at a car

Code:
view[0]->GetCamera()->GetTransform().LookAt(car->GetMovable()->GetPosition() -
view[jug]->GetCamera()->GetTransform().GetOrigin(),
csVector3(0,1,0));

the thing is that the camera actualy reacts like its not splited and the car ends in the center of the window instead of the center of the camera view does anyone konw how to fix this?¿

thanks
6  Crystal Space Development / Support / Re: warnings at map load on: July 27, 2008, 06:54:39 am
like always jorrit saving the day,

i understand that is would be best to fix the warnings but im programing on a beta scenario for now and i had about 10 seconds of a warning screen that took time from actualy testing the program.

thanks
7  Crystal Space Development / Support / warnings at map load on: July 27, 2008, 12:31:10 am
Greetings

this is probably a dumb problem.

at the start of my application i get all this warnings from CS regarding stuff that has to do with the map and the textures.

i really dont care about these cause the map loads fine. how do i tell CS not to show me these warnings because they are kind of anoying.
8  Crystal Space Development / Support / Re: Missing Files? on: July 24, 2008, 06:26:27 pm
i also got the same problems with plgbullet, plgglshader and plgglmesh3ds but since im still a noob and dont use the full capacity of CS i havent really needed these plugins but still would be nice to see 0 errors after 1 hour compiling CS.
i got the problems using

Visual Studio 2005
cs-win32libs-1.2_002 and cs-win32libs-1.3_003

PD right now im not in the mood for recompiling but when i do ill post the errors i get.
9  Crystal Space Development / Support / Re: mesh factory question on: July 23, 2008, 12:48:44 pm
thanks

the friend im working with is using 3D Studio Max and in the exportguide sais that exporting a genmesh can only be done if the genmesh has only one texture.

I have read the CS manual where it sais that genmeshes support multitexture but i supposed the max script didnt support that. what should i do, just change the plugin in this line

Code:
  <meshfact name="edificio"><plugin>thingFact</plugin><params>

for

Code:
  <meshfact name="edificio"><plugin>meshFact</plugin><params>

or is there a syntax that should go the other way¿
10  Crystal Space Development / Support / mesh factory question on: July 23, 2008, 06:13:03 am
Hello again.

This time im not looking for a solution, just guidance.

The thing is I have a mesh factory that creates a thingmesh that has way to many faces im talking more than 15.000 lines of code in the xml file, so it takes more than 15 minutes create it. the funy thing is that when this mesh is in the map as mesh and not as factory it takes much less i think is because of the cache information CS saves the first time you load the thing. im already working with a much simplier mesh but just to know is there a way to accelerate the process like having all the factories precached or a CS trick that I for being a total noob am unaware of.

one other thing what would be a relatively good number of faces to have in a mesh factory?

PS: i dont have any lights on my map, only ambient.

11  Crystal Space Development / Support / Re: Problem loading more than 1 level. 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
12  Crystal Space Development / Support / Re: Problem loading more than 1 level. 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
13  Crystal Space Development / Support / Re: Problem loading more than 1 level. 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
14  Crystal Space Development / Support / Re: Problem loading more than 1 level. 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);
}
15  Crystal Space Development / Support / Re: Problem loading more than 1 level. 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.
Pages: [1] 2
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 7.173 seconds with 16 queries.