build picture issues.

build picture issues.

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

build picture issues.

Post by smoth »

Why is it that when I move my build pictures from:

unitpics/

to

bitmaps/unitpics/

my build pictures are red?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: build picture issues.

Post by knorke »

rts\Sim\Units\UnitDefHandler.cpp

Code: Select all

	if (!texName.empty()) {
		bitmap.Load("unitpics/" + texName);
	}
	else {
		if (!LoadBuildPic("unitpics/" + unitDef->name + ".dds", bitmap) &&
		    !LoadBuildPic("unitpics/" + unitDef->name + ".png", bitmap) &&
		    !LoadBuildPic("unitpics/" + unitDef->name + ".pcx", bitmap) &&
		    !LoadBuildPic("unitpics/" + unitDef->name + ".bmp", bitmap)) {
			bitmap.Alloc(1, 1); // last resort
		}
all the things it tries have "unitpics/"+... in them, so I think you can not change it to load from another folder.

I guess eventually it ends up here and that makes it red:

Code: Select all

void CBitmap::AllocDummy()
{
	channels = 4;
	Alloc(1, 1);
	mem[0] = 255; // Red allows us to easily see textures that failed to load
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Re: build picture issues.

Post by rattle »

why is stuff like this not in a config file...
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: build picture issues.

Post by gajop »

just in case any developer does make it a config thing, please be sure to add some way to get that value as well - i'm currently depending (perhaps incorrectly, but oh well) that it's in a known location
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: build picture issues.

Post by smoth »

that should be handled in the unitdefs_post lua file

mantis'd

hopefully it can get addressed. I didn't realize it was hardcoded otherwise I could have maed patch last night :( what a waste of a day. cannot maek patch today, spending time with IRL friends and well I am now behind so sunday I will be focused on this green bean sandwich I am making.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: build picture issues.

Post by knorke »

i loled
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: build picture issues.

Post by FLOZi »

There's been a discussion on mantis between myself and smoth about the pros and cons of changing this.

What does anyone else think?
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Re: build picture issues.

Post by Gnomre »

I always wanted this too when I was still developing. I wanted to put ALL of the little image directories (sidepics and anims* come to mind off the top of my head) into bitmaps but didn't really campaign very hard for it.

I don't see why you can't just add a line to one of the gamedata files, like modrules or resources or whatever: unitpicloc = "bitmaps/unitpics" and just have it assume unitpicloc = "unitpics" if undefined. Wouldn't require any _post additions or any def editing, and it shouldn't break any OGL binds or whatever.


*I don't know if these were ever moved or anything. Anims should have been eliminated a long, long time ago. If I remember right, we could define the cursors with a text file, and that text file could reference bitmaps anywhere in the vfs, so I had already moved the actual images into bitmaps but the anims folder remained to house all those text files. I would rather just merge the text files into one cursors.lua and dump that in gamedata once and for all. But again, I'm out of the loop, so maybe that's already been done!
Post Reply

Return to “Game Development”