[no bug] IRR problem or compiler issue?

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Abraxas)
Posts: 227
Joined: Sun Oct 18, 2009 7:24 am

[no bug] IRR problem or compiler issue?

Post by Abraxas) »

Sometimes bugs just dont make any sence, so I'd like to know what the probably source of error here is. First of all I would like to mention my program often begins at a 'low' framerate (like 50fps) and quite inexplicably after an arbitrary amount of time, it jumps up to ~120.

Here is some code that malfunctions:

Code: Select all

if (lhold) 
		driver->draw2DRectangleOutline(recti(lholdx,lholdy,mousex,mousey),SColor(255,0,255,0));

			//draw target lines
for (int j=0;j<=objcounter;j++)  if ( object[j].orderedtoattack && object[j].target != -1 && object[j].target != -1 )	
		driver->draw3DLine(vector3df( object[j].posx , object[j].posy, object[j].posz),
		vector3df(object[object[j].target].posx, object[object[j].target].posy, object[object[j].target].posz),
		SColor(255,255,0,0) );
It is formatted exactly that way, and the statement block is only contained within Main{} and one (loop-wide) While{}. No other conditions for those statements.

After an abstract amount of time, the target lines simply dissapear. The most confusing part is if I hold my left mouse button (so lhold is true) the lines appear! As if a dependancy was somehow created.

Im using VC++ EE. I even ported the code to another solution file with default configuration properties. Same thing.

This is very frustrating.... Can anyone offer insight?
Abraxas)
Posts: 227
Joined: Sun Oct 18, 2009 7:24 am

Post by Abraxas) »

I would like to add, it seems then when I increase my z and x distance to the lines they draw, and if I close in they dissapear. Is there a setting that could cause close lines to be erased?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You should make sure that you set the transformation and material for methods named draw3D*. Otherwise, unexpected things can happen. Please provide a full and correct example if this doesn't solve the problem
Post Reply