2025-07-17 05:53 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0003160Spring engineGeneralpublic2012-07-09 20:10
Reportersmoth 
Assigned To 
PrioritynormalSeveritytweakReproducibilityalways
StatusnewResolutionopen 
Product Version89.0 
Target VersionFixed in Version 
Summary0003160: Unit build pictures are hard coded to /unitpics/, they should not be
Description
rts\Sim\Units\UnitDefHandler.cpp

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
      }


There is NO reason this string processing should be in the code. It should be moved to the unitdefs lua file.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0008901

smoth (reporter)

*unitdefs_post.lua sorrty

~0008905

FLOZi (reporter)

That will break all games for your own OCD desire to put all images under bitmaps/ you realise?

~0008921

smoth (reporter)

Last edited: 2012-07-08 01:55

View 2 revisions

There is no reason for this to be in the engine out of our control. It is vestigial crap from the old stuff before unitdefs_post.

It isn't THAT huge a thing to feed it into a tag in unit defs post. After ALL the other things we have had to patch which were FAR more complex. As it stands now, I CANNOT OVER RIDE IT.

give me a real reason the engine should be hard coding directory structure for content on this level.

~0008930

FLOZi (reporter)

Last edited: 2012-07-08 20:44

View 2 revisions

A hardcoded structure promotes well-structured content with a standardized layout - bringing obvious benefits to new content developers looking into different existing games and anyone wishing to maintain an older game not of their making.

Give me a real reason you need to have your build icons under bitmaps/?

I'm pretty confident this example is not the only such hardcoding of structure to remain - would you propose being able to store models in the sounds directory? (Assuming you can't already :P)

~0008931

smoth (reporter)

1)
Because they are just images.
They clutter the root directory of the game.
They may be reused for other things(and are)
The engine should not care where the files are stored just that it has the right path in vfs.

are a few.

2)
Because I want use them for more than unitpictures in the build menu.

3)
I don't care where people put what, just that I would like to be able to organize my project in a way that seems logical to me.

~0008932

FLOZi (reporter)

The only thing that really stands out there to me is reuse - You are aware of the # operator for gl.Texture?

~0008933

smoth (reporter)

Nope, what is the relevance?

~0008935

FLOZi (reporter)

Last edited: 2012-07-09 00:18

View 2 revisions

http://springrts.com/wiki/Lua_OpenGL_Api#Textures

gl.Texture("0000012") -- 'load/bind' the texture of unitdefid 12 build icon

edit: crap, mantis changes numbers to issue links

gl.Texture("#twelve_but_in_digits")

~0008936

smoth (reporter)

I don't follow how it solves the problem.

~0008937

FLOZi (reporter)

Last edited: 2012-07-09 03:25

View 3 revisions

Well, just that you can already reuse build icons for basically anything except CEG textures (could be done via resources.lua) and maybe decals (can't quite remember how those are loaded)? I don't see how having them under /bitmaps/ makes reuse any easier.

Perhaps a forum discussion to canvas opinions on this proposal? (Well I guess the thread is already there)

~0008939

smoth (reporter)

by all means, debate it in the thread. Hoenstly I think that at the VERY least we should have some variables to load the base directory name. It may just be that I am being "OCD" but I feel it is a smart way of handling things to not hard set this stuff.
+Notes

-Issue History
Date Modified Username Field Change
2012-07-07 17:25 smoth New Issue
2012-07-07 17:28 smoth Note Added: 0008901
2012-07-07 18:43 FLOZi Note Added: 0008905
2012-07-08 01:54 smoth Note Added: 0008921
2012-07-08 01:55 smoth Note Edited: 0008921 View Revisions
2012-07-08 20:43 FLOZi Note Added: 0008930
2012-07-08 20:44 FLOZi Note Edited: 0008930 View Revisions
2012-07-08 22:15 smoth Note Added: 0008931
2012-07-08 22:28 FLOZi Note Added: 0008932
2012-07-08 23:21 smoth Note Added: 0008933
2012-07-09 00:17 FLOZi Note Added: 0008935
2012-07-09 00:18 FLOZi Note Edited: 0008935 View Revisions
2012-07-09 02:11 smoth Note Added: 0008936
2012-07-09 03:24 FLOZi Note Added: 0008937
2012-07-09 03:24 FLOZi Note Edited: 0008937 View Revisions
2012-07-09 03:25 FLOZi Note Edited: 0008937 View Revisions
2012-07-09 20:10 smoth Note Added: 0008939
+Issue History