Feature #1616: Body part record verifier

Involved development of the OpenMW construction set.
User avatar
Jiub
Posts: 26
Joined: 02 Aug 2014, 09:29
Location: Russia

Feature #1616: Body part record verifier

Post by Jiub »

Gonna investigate this one.
Can I have any additional info about the feature?
And can I assign on issues by myself?
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Feature #1616: Body part record verifier

Post by Zini »

Can I have any additional info about the feature?
Works like any other record verifier (plenty of examples in the code base). Check that the body part records don't contain nonsense (out of range value, references to things that don't exist, missing mandatory data, missing mandatory records) and report any findings through the provided interface.
And can I assign on issues by myself?
Now you can.
User avatar
Jiub
Posts: 26
Joined: 02 Aug 2014, 09:29
Location: Russia

Re: Feature #1616: Body part record verifier

Post by Jiub »

I'm stuck.

mw_esm.txt states only this:

Code: Select all

20: BODY =  1125 (    75,     92.73,    103)
	Body Parts
	BYDT = Body part data (4 bytes)
		byte Part
			0 = Head
			1 = Hair
			2 = Neck
			3 = Chest
			4 = Groin
			5 = Hand
			6 = Wrist
			7 = Forearm
			8 = Upperarm
			9 = Foot
			10 = Ankle
			11 = Knee
			12 = Upperleg
			13 = Clavicle
			14 = Tail
		byte Vampire
		byte Flags
			1 = Female
			2 = Playable
		byte PartType
			0 = Skin
			1 = Clothing
			2 = Armor
But according to /components/esm/loadbody.cpp there are also:

Code: Select all

mModel = esm.getHNString("MODL");
mRace = esm.getHNOString("FNAM");
My question is do I needed to check any of BYDT fields (for accepted range?) or just check that MODL & FNAM reference to existent objects.

And could you be so kind to point me on where models and races objects are stored in code?
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Feature #1616: Body part record verifier

Post by Zini »

mw_esm.txt states only this:
This is a good source of information about the esx format, but it is neither complete nor fully accurate in all cases. When in doubt, use the code.
My question is do I needed to check any of BYDT fields (for accepted range?
Let's be thorough and check it anyway.
And could you be so kind to point me on where models and races objects are stored in code?
- CSMWorld::Data::getResources (CSMWorld::UniversalId::Type_Meshes)
- CSMWorld::Data::getRaces()
User avatar
Jiub
Posts: 26
Joined: 02 Aug 2014, 09:29
Location: Russia

Re: Feature #1616: Body part record verifier

Post by Jiub »

Got in troubles with
Zini wrote:CSMWorld::Data::getResources (CSMWorld::UniversalId::Type_Meshes)
Since:

Code: Select all

const CSMWorld::Resources& CSMWorld::Data::getResources (const UniversalId& id) const
{
    return mResourcesManager.get (UniversalId::getParentType (id.getType()));
}
I call:

Code: Select all

getResources(CSMWorld::UniversalId( CSMWorld::UniversalId::Type_Mesh ))
getParentType() converts Type_Mesh to Type_Meshes, and in mResourcesManager there is no Type_Meshes, only:

Code: Select all

addResources (Resources ("meshes", UniversalId::Type_Mesh, sMeshTypes));
So, all I left with is "std::logic_error ("Unknown resource type");".
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Feature #1616: Body part record verifier

Post by Zini »

The resources management system in OpenCS is new and hasn't been tested extensively. Possible that it still has bugs. I will look into it.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Feature #1616: Body part record verifier

Post by Zini »

Fix is in master. Note that you need to use the resource collection type (e.g. Type_Meshes) instead of the type for individual resoruces (e.h. Type_Mesh).
User avatar
Jiub
Posts: 26
Joined: 02 Aug 2014, 09:29
Location: Russia

Re: Feature #1616: Body part record verifier

Post by Jiub »

Done!
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Feature #1616: Body part record verifier

Post by Zini »

Good. Merged.

Are you sufficiently bored with the verifier task that you want to do something else or can I give you another one of these?
User avatar
Jiub
Posts: 26
Joined: 02 Aug 2014, 09:29
Location: Russia

Re: Feature #1616: Body part record verifier

Post by Jiub »

Something else would be better, but I can do this boring stuff again :­)
Post Reply