Added functionality to generate asset names

This commit is contained in:
parax0
2016-12-12 01:33:46 -07:00
parent efa85036c2
commit 2e44e5b119
35 changed files with 82035 additions and 311 deletions

View File

@@ -129,6 +129,12 @@ public:
return nullptr;
}
void GetUniquePrimitives(std::set<CAnimPrimitive>& rPrimSet) const
{
for (u32 iAnim = 0; iAnim < mAnimPrimitives.size(); iAnim++)
rPrimSet.insert(mAnimPrimitives[iAnim]);
}
// Accessors
inline u32 NumCharacters() const { return mCharacters.size(); }
inline u32 NumAnimations() const { return mAnimations.size(); }

View File

@@ -84,6 +84,7 @@ public:
// Inline Accessors
inline u32 WorldIndex() const { return mWorldIndex; }
inline CTransform4f Transform() const { return mTransform; }
inline CMaterialSet* Materials() const { return mpMaterialSet; }
inline u32 NumWorldModels() const { return mWorldModels.size(); }
inline u32 NumStaticModels() const { return mStaticWorldModels.size(); }
inline CModel* TerrainModel(u32 iMdl) const { return mWorldModels[iMdl]; }
@@ -94,7 +95,9 @@ public:
inline u32 NumLightLayers() const { return mLightLayers.size(); }
inline u32 NumLights(u32 LayerIndex) const { return (LayerIndex < mLightLayers.size() ? mLightLayers[LayerIndex].size() : 0); }
inline CLight* Light(u32 LayerIndex, u32 LightIndex) const { return mLightLayers[LayerIndex][LightIndex]; }
inline CAssetID PathID() const { return mPathID; }
inline CPoiToWorld* PoiToWorldMap() const { return mpPoiToWorldMap; }
inline CAssetID PortalAreaID() const { return mPortalAreaID; }
inline CAABox AABox() const { return mAABox; }
inline void SetWorldIndex(u32 NewWorldIndex) { mWorldIndex = NewWorldIndex; }

View File

@@ -65,6 +65,10 @@ public:
CVector2f Position = CVector2f(0,0),
CColor FillColor = CColor::skWhite, CColor StrokeColor = CColor::skBlack,
u32 FontSize = CFONT_DEFAULT_SIZE);
// Accessors
inline TString FontName() const { return mFontName; }
inline CTexture* Texture() const { return mpFontTexture; }
private:
void InitBuffers();
};

View File

@@ -14,7 +14,7 @@ u32 GetGameTypeID(EGame Game, EResType ResType)
// ************ STATIC ************
EResType CResource::ResTypeForExtension(CFourCC Extension)
{
auto Find = gExtensionTypeMap.find(Extension.ToLong());
auto Find = gExtensionTypeMap.find(Extension.ToUpper().ToLong());
if (Find == gExtensionTypeMap.end())
{

View File

@@ -98,10 +98,14 @@ public:
return pTree;
}
CStringTable* ScanText() const { return mpStringTable; }
bool IsImportant() const { return mIsImportant; }
bool IsSlow() const { return mIsSlow; }
ELogbookCategory LogbookCategory() const { return mCategory; }
// Accessors
inline CStringTable* ScanText() const { return mpStringTable; }
inline bool IsImportant() const { return mIsImportant; }
inline bool IsSlow() const { return mIsSlow; }
inline ELogbookCategory LogbookCategory() const { return mCategory; }
inline CAssetID GuiFrame() const { return mFrameID; }
inline CAssetID ScanImage(u32 ImgIndex) const { return mScanImageTextures[ImgIndex]; }
inline CAssetID LogbookDisplayAssetID() const { return (mLogbookAnimParams.ID().IsValid() ? mLogbookAnimParams.ID() : mLogbookModel); }
};
#endif // CSCAN_H

View File

@@ -126,6 +126,39 @@ public:
return pTree;
}
static TWideString StripFormatting(const TWideString& rkStr)
{
TWideString Out = rkStr;
int TagStart = -1;
for (u32 iChr = 0; iChr < Out.Size(); iChr++)
{
if (Out[iChr] == L'&')
{
if (TagStart == -1)
TagStart = iChr;
else
{
Out.Remove(TagStart, 1);
TagStart = -1;
iChr--;
}
}
else if (TagStart != -1 && Out[iChr] == L';')
{
int TagEnd = iChr + 1;
int TagLen = TagEnd - TagStart;
Out.Remove(TagStart, TagLen);
iChr = TagStart - 1;
TagStart = -1;
}
}
return Out;
}
};
#endif // CSTRINGTABLE_H