Jump to content

Recommended Posts

Posted

Hi all,

 

hopefully someone can proof this bug. if not i have to dig a lot deeper...

 

Since a few hours i try to convert my game NightFist to 231. But i have a small little problem and i think i can reproduce it.

 

I think that the initialization of the engine has changed a little bit. Because i get an error if i want to log something into the logfile before the world is created.

 

Here is an example:

#include "engine.h"

int WINAPI WinMain( HINSTANCE hInstance,
				HINSTANCE hPrevInstance,
				LPSTR lpCmdLine,
				int nShowCmd ) 
{
Initialize() ;
RegisterAbstractPath("D:/04 Leadwerks/10 SDK 231");
SetAppTitle( "test231" ) ;
Graphics( 800, 600 ) ;
AFilter() ;
TFilter() ;


TWorld	world;
TBuffer gbuffer;
TCamera camera;
TMesh	mesh;
TLight	light;
TMesh	ground;
TMaterial material;

// AppLog( "A BIGGGGG Problem if i want to log something at this position !!!!!!!!!!!!!!!!!!!!!!!!!!" );

world = CreateWorld() ;


AppLog( "Here is OK" );




if (!world) {
	MessageBoxA(0,"Error","Failed to create world.",0);
	return Terminate();
}



gbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL);

camera=CreateCamera();
PositionEntity(camera,Vec3(0,0,-2));

material=LoadMaterial("abstract::cobblestones.mat");

mesh=CreateCube();
PaintEntity(mesh,material);

ground=CreateCube();
ScaleEntity(ground,Vec3(10,1,10));
PositionEntity(ground,Vec3(0,-2,0));
PaintEntity(ground,material);

light=CreateDirectionalLight();
RotateEntity(light,Vec3(45,45,45));

// Game loop
while( !KeyHit() && !AppTerminate() )
{
	if( !AppSuspended() ) // We are not in focus!
	{
		// Rotate cube
		TurnEntity( mesh, Vec3( 0.5f*AppSpeed() ) ) ;

		// Update timing and world
		UpdateAppTime();
		UpdateWorld(AppSpeed()) ;

		// Render
		SetBuffer(gbuffer);
		RenderWorld();
		SetBuffer(BackBuffer());
		RenderLights(gbuffer);

		// Send to screen
		Flip(0) ;
	}
}

// Done
return Terminate() ;
}

 

The initialization of my game uses a lot of AppLogs before the world is created.

Hopefully this is the problem and it can be solved inside of the engine... if not... i have to go deeper...

 

cu

Oliver

Windows Vista 64 / Win7 64 | 12GB DDR3 1600 | I7 965 | 2 * 280GTX sli | 2 * 300GB Raptor | 2 * 1.5TB

Posted

Thanks for the approval...

@Josh: did something changed in the engine and is there a chance to fix it? Or is that wanted and has to stay?

 

cu

Oliver

Windows Vista 64 / Win7 64 | 12GB DDR3 1600 | I7 965 | 2 * 280GTX sli | 2 * 300GB Raptor | 2 * 1.5TB

Posted

A small work around... but not beautiful

 

// DUMMY World only to start the engine... nerv.
FreeWorld( CreateWorld() );

 

cu

Oliver

Windows Vista 64 / Win7 64 | 12GB DDR3 1600 | I7 965 | 2 * 280GTX sli | 2 * 300GB Raptor | 2 * 1.5TB

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...