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: 22300
Joined: 13 Jan 2005, 00:46

build picture issues.

Post by smoth » 07 Jul 2012, 01:18

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

unitpics/

to

bitmaps/unitpics/

my build pictures are red?
0 x

User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: build picture issues.

Post by knorke » 07 Jul 2012, 11:40

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
0 x

User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Re: build picture issues.

Post by rattle » 07 Jul 2012, 12:40

why is stuff like this not in a config file...
0 x

gajop
Moderator
Posts: 3023
Joined: 05 Aug 2009, 20:42

Re: build picture issues.

Post by gajop » 07 Jul 2012, 13:05

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
0 x

User avatar
smoth
Posts: 22300
Joined: 13 Jan 2005, 00:46

Re: build picture issues.

Post by smoth » 07 Jul 2012, 17:27

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.
0 x

User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: build picture issues.

Post by knorke » 07 Jul 2012, 19:11

i loled
0 x

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

Re: build picture issues.

Post by FLOZi » 09 Jul 2012, 20:16

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

What does anyone else think?
0 x

Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Re: build picture issues.

Post by Gnomre » 12 Jul 2012, 14:59

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!
0 x

Post Reply

Return to “Game Development”