Crystal Space
Welcome, Guest. Please login or register.
August 29, 2014, 05:19:50 pm

Login with username, password and session length
Search:     Advanced search
9009 Posts in 2043 Topics by 8358 Members
Latest Member: Rodgerkline
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  Problem with changing from stable to pseudo stable release.
« previous next »
Pages: [1] Print
Author Topic: Problem with changing from stable to pseudo stable release.  (Read 2915 times)
willjm
Newbie
*
Posts: 39


View Profile
« on: June 16, 2006, 03:10:36 am »

I recently decided to stop using the stable release 0.98r004 and started using the pseudo stable release 0.99. I have been making the necessary modifications to update my code to work with this version of CS. I am running into a couple of problems though. I am receiving the following messages in the console when I launch the application. This does not crash my application. It still runs, but the top half of the view doesn't get displayed.


crystalspace.maploader.parse.region:
  <renderpriorities> is no longer supported!
[node: world]

crystalspace.graphics3d.shader.glcg:
  CG ERROR : The compile returned an error.
  (39) : warning C7006: uninitialized variable "A2F.surface.texture"
  used
(169) : fatal error C9999: sampler parameter to texture function not a uniform sampler


These messages were not generated when I was using the stable release. I decided to recompile my application using the flarge map and I did not get the renderpriorities message.

This is the <renderpriorities> section of my XML for my world:

Code:
<!-- render priority specification -->
<renderpriorities>
<priority name="sky">
<level>1</level>
<sort>NONE</sort>
</priority>
<priority name="wall">
<level>2</level>
<sort>NONE</sort>
</priority>
<priority name="object">
<level>3</level>
<sort>NONE</sort>
</priority>
<priority name="alpha">
<level>4</level>
<sort>BACK2FRONT</sort>
</priority>
</renderpriorities>

I did not see much difference between that and what is in the definition for the flarge map.

Also, when I build my solution I receive the following warnings.


c:\cs\include\csutil\win32\csosdefs.h(387) : warning C4996: 'getenv' was declared deprecated
        c:\program files\microsoft visual studio 8\vc\include\stdlib.h(483) : see declaration of 'getenv'
        Message: 'This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
c:\cs\include\csutil\win32\csosdefs.h(389) : warning C4996: 'getenv' was declared deprecated
        c:\program files\microsoft visual studio 8\vc\include\stdlib.h(483) : see declaration of 'getenv'
        Message: 'This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
g_player.cpp
g_playermovement.cpp
c:\cs\include\csutil\win32\csosdefs.h(387) : warning C4996: 'getenv' was declared deprecated
        c:\program files\microsoft visual studio 8\vc\include\stdlib.h(483) : see declaration of 'getenv'
        Message: 'This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
c:\cs\include\csutil\win32\csosdefs.h(389) : warning C4996: 'getenv' was declared deprecated
        c:\program files\microsoft visual studio 8\vc\include\stdlib.h(483) : see declaration of 'getenv'
        Message: 'This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
g_view.cpp


 Any ideas on how to eliminate these warnings from being generated other than changing the verbosity of the compiler?

Thanks,

willjm

Version of CS: Pseudo Stable Release (0.99 from 27 January 2006)
Version of winlibs package (if on windows): CrystalSpace Win32 libraries 0.99r0_018
Operating system: Win 2K
Compiler: Microsoft Visual Studio 2005
Video card: MOBILITY RADEON 9000 DDR x86/SSE2 (vendor: ATI Technologies Inc.)
Driver: atioglxx.dll 6.14.10.3842
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #1 on: June 16, 2006, 04:57:00 am »

Just remove the entire <renderpriorities> block. It is no longer used.

About the CG error I'm not sure. It could be that you have to update your GL drivers. Did you try that?

Greetings,
Logged
willjm
Newbie
*
Posts: 39


View Profile
« Reply #2 on: June 16, 2006, 07:32:59 pm »

Removing the <renderpriorities> block solved that issue.

I'm still at a loss as to solve the other one. I did update my driver per your suggestion; however that did not solve the problem. Perhaps if I show some more of the log entries around that it might help.


crystalspace.graphics3d.shader.glcg:
  Routing Cg fragment programs to Pixel Shader plugin ON (default).
SCF_NOTIFY: loading plugin C:\CS\glshader_ps1.dll to satisfy request f
or csGLShader_PS1

crystalspace.canvas.opengl.extmgr:
  GL Extension 'GL_NV_texture_shader' not found.
  GL Extension 'GL_NV_texture_shader2' not found.

crystalspace.graphics3d.shader.glcg:
  CG ERROR : The compile returned an error.
  (39) : warning C7006: uninitialized variable "A2F.surface.texture"
  used
(169) : fatal error C9999: sampler parameter to texture function not a

  uniform sampler


crystalspace.graphics3d.shadercompiler.xmlshader:
  Shader 'std_lighting'<2>: Technique with priority 150 fails. Reason:

  fragment program failed to load.
  No technique validated for shader 'std_lighting'<2>: using fallback
SCF_NOTIFY: loading plugin C:\CS\glshader_fixed.dll to satisfy request
 for csGLShader_FIXED


It looks like it's trying to use a shader but can't find it.


Version of CS: Pseudo Stable Release (0.99 from 27 January 2006)
Version of winlibs package (if on windows): CrystalSpace Win32 libraries 0.99r0_018
Operating system: Win 2K
Compiler: Microsoft Visual Studio 2005
Video card: MOBILITY RADEON 9000 DDR x86/SSE2 (vendor: ATI Technologies Inc.)
Driver: atioglxx.dll 6.14.10.6371
Logged
willjm
Newbie
*
Posts: 39


View Profile
« Reply #3 on: June 16, 2006, 09:21:11 pm »

Ok, I've thought a little more about the problem and I don't think the problem is related to drivers at all. I say this because I can run walktest without getting that error. I can run walktest with my map and not get that error either. So it's very likely it's a problem with my code. Maybe it's something that I should be initializing or I am initializing that shouldn't be anymore?
Logged
willjm
Newbie
*
Posts: 39


View Profile
« Reply #4 on: June 17, 2006, 08:55:38 pm »

I went through my code and commented out the line where I set the sector for the camera. The end result was that there was no error, but the screen is black. I'm going to try to post some screenies of what the end result is with that code in and with in commented out. Does this shed any light on the problem I'm having? I'll post my Initialize and LoadMap function below.

Code:
/////////////////////////////////////////////////////////////////////
//
// Initialize the g_environment application
//
/////////////////////////////////////////////////////////////////////
bool G_Environment::Initialize()
{
    // Set up the Configuration Manager
    if(!csInitializer::SetupConfigManager(object_reg,
        "/config/g_environment.cfg",
        "CrystalSpace.G_Environment"))
    {
        csReport(object_reg, CS_REPORTER_SEVERITY_ERROR,
"crystalspace.application.g_environment",
"Can't initialize configuration manager!");
return false;
}

const char* cdType = "crystalspace.collisiondetection.opcode";

// Set up the plug-ins to be used
if(!csInitializer::RequestPlugins(object_reg,
CS_REQUEST_VFS,
CS_REQUEST_OPENGL3D,
CS_REQUEST_ENGINE,
CS_REQUEST_FONTSERVER,
CS_REQUEST_IMAGELOADER,
CS_REQUEST_LEVELLOADER,
CS_REQUEST_PLUGIN(cdType, iCollideSystem),
CS_REQUEST_REPORTER,
CS_REQUEST_REPORTERLISTENER,
CS_REQUEST_END))
{
csReport(object_reg, CS_REPORTER_SEVERITY_ERROR,
"crystalspace.application.g_environment",
"Can't initialize plugins!");
return false;
}

// Get the pointer to the command line parser (shortcut way)
csRef<iCommandLineParser> clp(CS_QUERY_REGISTRY(object_reg,
iCommandLineParser));

const char* cfgVal;

if(!(cfgVal = clp->GetName()))

// Check for commandline help.
if(csCommandLineHelper::CheckHelp(object_reg))
{
csCommandLineHelper::Help(object_reg);
csInitializer::DestroyApplication(object_reg);
exit (0);
}

// Set up the event handler
if(!csInitializer::SetupEventHandler(object_reg, EventHandler))
{
csReport(object_reg, CS_REPORTER_SEVERITY_ERROR,
"crystalspace.application.g_environment",
"Can't initialize event handler!");
return false;
}

// Open the main system. This will open all the previously
// loaded plug-ins.
if(!csInitializer::OpenApplication(object_reg))
{
csReport(object_reg, CS_REPORTER_SEVERITY_ERROR,
"crystalspace.application.g_environment",
"Error opening system!");
return false;
}

// Get the pointer to engine plug-in
engine = CS_QUERY_REGISTRY(object_reg, iEngine);
if(engine == 0)
{
csReport(object_reg, CS_REPORTER_SEVERITY_ERROR,
"crystalspace.application.g_environment",
"No iEngine plugin!");
return false;
}

// Get the pointer to the map loader plug-in
loader = CS_QUERY_REGISTRY(object_reg, iLoader);
if(loader == 0)
{
csReport(object_reg, CS_REPORTER_SEVERITY_ERROR,
"crystalspace.application.g_environment",
"No iLoader plugin!");
return false;
}

// Get the pointer to the 3D renderer plug-in
g3d = CS_QUERY_REGISTRY(object_reg, iGraphics3D);
if(g3d == 0)
{
csReport(object_reg, CS_REPORTER_SEVERITY_ERROR,
"crystalspace.application.g_environment",
"No iGraphics3D plugin!");
return false;
}

// Get the pointer to the Collision detection system
cdsys = CS_QUERY_REGISTRY(object_reg, iCollideSystem);
if(cdsys == 0)
{
csReport(object_reg, CS_REPORTER_SEVERITY_ERROR,
"crystalspace.application.g_environment",
"No iCollideSystem plugin!");
return false;
}

// Get the pointer to the 3D renderer plug-in
vc = CS_QUERY_REGISTRY(object_reg, iVirtualClock);
if(vc == 0)
{
csReport(object_reg, CS_REPORTER_SEVERITY_ERROR,
"crystalspace.application.g_environment",
"No iVirtualClock plugin!");
return false;
}

// Get the pointer to the command line parser
//if(clp == 0)
//{
// csReport(object_reg, CS_REPORTER_SEVERITY_ERROR,
// "crystalspace.application.g_environment",
// "No iCommandLineParser plugin!");
// return false;
//}

// Initialize the view to the environment and set the size of
// the view
view = csPtr<iView> (new csView(engine, g3d));
iGraphics2D* g2d = g3d->GetDriver2D();
view->SetRectangle(0, 0, g2d->GetWidth(), g2d->GetHeight() / 2);



// Load the environment level
if(!LoadMap())
{
return false;
}

// Pass necessary info. to the player.
player.SetCamera(view->GetCamera());
player.SetCollideSystem(cdsys);
player.SetEngine(engine);
player.SetView(view);
player.SetDesiredLocation(view->GetCamera()->GetTransform().GetOrigin());
player.SetDesiredLookAt(csVector3(0, 0, 1));
player.SetStartLocation(view->GetCamera()->GetTransform().GetOrigin());
player.SetStartLookAt(csVector3(0, 0, 1));

// Load a SpriteCal3D Mesh Object
csRef<iVFS> VFS(CS_QUERY_REGISTRY(object_reg, iVFS));
VFS->ChDir("/this/");

csRef<iMeshFactoryWrapper>
imeshfact(loader->LoadMeshObjectFactory("/this/test.cal3d"));

if(imeshfact == 0)
{
csReport(object_reg, CS_REPORTER_SEVERITY_ERROR,
     "crystalspace.application.g_environment",
"Error loading mesh object factory!");
return false;
}

csRef<iMeshWrapper>
sprite = engine->CreateMeshWrapper(imeshfact,
   "varge_wb1_gunner_pod",
   engine->GetSectors()->FindByName("room"),
   csVector3(0, 2, 5));

// Animate the model
csRef<iSpriteCal3DFactoryState> factState
(SCF_QUERY_INTERFACE(imeshfact->GetMeshObjectFactory(),
iSpriteCal3DFactoryState));

csRef<iSpriteCal3DState> cal3dState
(SCF_QUERY_INTERFACE(sprite->GetMeshObject(),
iSpriteCal3DState));

//cal3dState->SetAnimCycle("standing_idle", 1.0f);
cal3dState->SetAnimCycle("left_engine_rot_45deg", 1.0f);
cal3dState->SetAnimationTime(0.05f);
cal3dState->SetAnimCycle("dual_cannon_rotation_45deg_down", 1.0f);

// Initialize the collision detection
if(!InitCollisionDetection())
return false;

return true;
}


/////////////////////////////////////////////////////////////////////
//
// Load the map
//
/////////////////////////////////////////////////////////////////////
bool G_Environment::LoadMap()
{
// set VFS current directory to the level we want to load
csRef<iVFS> VFS(csQueryRegistry<iVFS>(object_reg));
VFS->ChDir("/lev/room01");

// load the level file which is called 'world'
if(!loader->LoadMapFile("world"))
{
// Create the default room for this application
if(!g_environment->CreateDefaultRoom())
{
csReport(object_reg, CS_REPORTER_SEVERITY_ERROR,
"crystalspace.application.g_environment",
"Error generating environment!");
return false;
}
}

engine->Prepare();

// Find the starting position in this level
csVector3 pos(0.0f, 0.0f, 0.0f);

if(engine->GetCameraPositions()->GetCount() > 0)
{
// There is a valid starting position defined in the level file
iCameraPosition* campos = engine->GetCameraPositions()->Get(0);
room = engine->GetSectors()->FindByName(campos->GetSector());
pos = campos->GetPosition();
} else {
// Didn't find a valid starting position. The default
// room and start position is used
room = engine->GetSectors()->FindByName("room");
pos.Set(csVector3(0.0f, 3.0f, -3.0f));
}

if(!room)
{
csReport(object_reg, CS_REPORTER_SEVERITY_ERROR,
     "crystalspace.application.g_environment",
"Can't find a valid starting position!");
return false;
}


        // This is the offending line
view->GetCamera()->SetSector(room);


view->GetCamera()->GetTransform().SetOrigin(pos);

return true;
}
Logged
willjm
Newbie
*
Posts: 39


View Profile
« Reply #5 on: June 19, 2006, 04:51:40 am »

Ok, as promised here are some screenies of what's going on...

As you will see, the errors are listed in the application.
I ran this from Microsoft Visual Studio 2005 using Debug -> Start Without Debugging.
http://www.cs.sunyit.edu/~bodilyw/screenies/g_environment_room01_msvs2005.jpg

This is the same level loaded in the walktest application.
I ran this from the command line using walktest -relight data\room01.
http://www.cs.sunyit.edu/~bodilyw/screenies/walktest_room01.jpg

Interestingly I decided to see what would happen if I copied the g_environment.exe file to the \CS directory and ran it from the command line. As you can see, the errors were not generated.
http://www.cs.sunyit.edu/~bodilyw/screenies/g_environment_room01.jpg

I can assume that the error that is being generated is from running the application in Visual Studio? I set the Working directory in the project to C:\CS and thought that was good enough. The output directory is .\Debug. I'm pretty sure that's what caused this, would someone confirm this for me?
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.338 seconds with 15 queries.