Can't create DirectX texture: ...

Posted By: Rei_Ayanami

Can't create DirectX texture: ... - 06/27/10 17:39

Hiya Guys,

I've got another problem. I am getting the Engine Error:
"Can't create DirectX texture: schwert_off".

The manual says: "The texture format is invalid or unsupported
by DirectX or by your video card."
BUT if I change the texture to any other working, I get the
same error(it is a part of my inventory system, so if I copy
another bmap and rename it, the error also appears).

The problem is: it appears random, but always on the same object.

The bmap is defined as the following:
Code:
BMAP* schwert_off = "schwert_off.png";
BMAP* schwert_on = "schwert_on.png";



All the panels in the following piece are already shown on the
screen, but with a different/no bmap. It just changes the bmaps.
Code:
for(i = 0; i < 8; i++)
	{
		proc_mode = PROC_EARLY;
		switch(inventar[i])
		{
			case none: invent_pan[i].bmap = NULL;
			break;
			case lighter: invent_pan[i].bmap = lighter_off;
			break;
			case oil: invent_pan[i].bmap = oil_off;
			break;
			case battery: invent_pan[i].bmap = batt_off;
			break;
			case spitzhacke: invent_pan[i].bmap = spitz_off;
			break;
			case splitter: invent_pan[i].bmap = splitter_off;
			break;
			case noten: invent_pan[i].bmap = noten_off;
			break;
			case schwert: invent_pan[i].bmap = schwert_off;
			break;
			case fischglas: invent_pan[i].bmap = fisch_off;
			break;
			case nagel: invent_pan[i].bmap = nagel_off;
			break;
			case codebook: invent_pan[i].bmap = code_off;
			break;
			case lupe: invent_pan[i].bmap = lupe_off;
			break;
			case news: invent_pan[i].bmap = news_off;
			break;
			case fischglas_full: invent_pan[i].bmap = fisch_full_off;
			break;
			case clock: invent_pan[i].bmap = clock_off;
			break;
			case runenstein: invent_pan[i].bmap = runen_off;
			break;
		}
		invent_pan[i].skill_x = inventar[i];
	}



The picking up of the object is handled as at all other
objects.(of course the number is different for all)

Oh, and if you ask: none, lighter,...,runenstein are all
defined numbers.


This is really annoying, because I can't play any further
after this point...

If you have an idea how to solve this, or if you know what the
problem could be, please be so kind and response laugh


Thanks in advance and best regards,
Rei
Posted By: tD_Datura_v

Re: Can't create DirectX texture: ... - 06/27/10 19:11

Perhaps the error has something to do with the PNG format or the lack of support thereof.

Here is a manual quote which seems to suggest that the PNG format should not be used:
Quote:
PNG images behave like TGA images, but are not recommended because they are loaded not by the engine, but by the DirectX library, and are not guaranteed to be automatically restored when the video device gets lost. This means that they can lose their content f.i. when a fullscreen application is minimized.

That quote is from an out-dated manual.


...
Code:
case none: invent_pan[i].bmap = NULL;


...
Posted By: sPlKe

Re: Can't create DirectX texture: ... - 06/27/10 20:54

doubtfull, the error ONLY happens with one certain panel object. funny enough, its the same as all the others just with a different name.
furthermore, form panels and other things, i use PNG only in all my projects and i havent experienced this error in any of them.

edit: the error also doe not happen all the time or in windowed mode.
Posted By: tD_Datura_v

Re: Can't create DirectX texture: ... - 06/27/10 21:38

The object's lite-c variable name and file name are very similar then?
So the error only occurs with an object of a certain name or naming scheme?


Posted By: Rei_Ayanami

Re: Can't create DirectX texture: ... - 06/27/10 21:40

well, at least it didn't happened to me with other pics, but as i said, it does appear random...
Posted By: Rei_Ayanami

Re: Can't create DirectX texture: ... - 06/28/10 21:22

bump

anyone an idea?
Posted By: Rei_Ayanami

Re: Can't create DirectX texture: ... - 07/01/10 18:46

Okay, i have found a workaround -> I load the pictures that fail (schwert_on / off) at the start. Till now we got no error so far...

But this is just an unnice workaround...

Sorry for triple-posting...
© 2024 lite-C Forums