Main.SideBar (edit) |
Main /
GroundTypesProblemsProblems with current ground types/ground theme:
SolutionIntroduce public BosonGroundType class: class BosonGroundType { public: int id; BoTextureArray* textures; QString texturefile; int animationDelay; QString name; // Maybe change to BoVector3Float? QRgb color; QPixmap* icon; QString iconfile; }; This class would be visible to other classes and could be used to get certain info/data of a ground type, such as it's textures or icon. AB: sounds good so far, I agree.
LoadingATM we have "Boson Ground" group in index.ground, which includes the number of textures (ground types) in the file. Each texture has group "Texture_n", where n is number from 0 to texturecount-1. AB: I don't see your point here. All you need to do is to increase texturecount and add the texture to the end. Where is the problem? (btw: this is the standard way of saving linked lists to kconfig files)
So I'm proposing to make it group-based instead: all ground types would be in groups "Ground-name" where name would be a string which would identify the ground type. So we'd also use strings instead of integers as ids. At loading time, we can easily assign numeric id to every ground type (e.g. in the order of loading) to speed up in-game queries. AB: I don't see the gain from this. Why do we need to add so much complexity? After all no user/designer should ever look at index.ground, but rather use a tool that generates it. The index.ground file is for loading only. With your proposal you need to iterate all groups in the file, which can be very error prone in kconfig files, as old groups are not necessarily deleted. E.g. you can have texture count=10 but have Texture_0 .. Texture_100 groups. Everything above Texture_19 would be simply ignored when loading. RL: Yeah, ground type editor would make this pointless indeed... Ok, then I won't make this change. MapsMaps would store a texmap for every used ground type. AB: seems good, would make index.ground files obsolete, no?
RL: No, index.ground would still be used to load description of each (used) ground type. It's just that texmap of each ground type would be stored in a different file. |