Skip to content

Commit 462db73

Browse files
committed
关于资源数量加载的常量还原
Restoring constant references related to amounts of resources
1 parent 8bc743d commit 462db73

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

Lawn_Shared/Lawn/LawnApp.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ public override void LoadingThreadProc()
280280
mResourceManager.LoadAllResources();
281281
Resources.ExtractResources(mResourceManager, AtlasResources.mAtlasResources);
282282
AtlasResources.mAtlasResources.ExtractResources();
283-
ReanimatorXnaHelpers.ReanimatorLoadDefinitions(ref GameConstants.gLawnReanimationArray, 119);
283+
ReanimatorXnaHelpers.ReanimatorLoadDefinitions(ref GameConstants.gLawnReanimationArray, (int)ReanimationType.NumReanims);
284284
TodStringFile.TodStringListSetColors(GameConstants.gLawnStringFormats, GameConstants.gLawnStringFormatCount);
285285
if (mLoadingFailed || mShutdown || mCloseRequest)
286286
{
@@ -290,9 +290,9 @@ public override void LoadingThreadProc()
290290
mZenGarden = new ZenGarden();
291291
mReanimatorCache = new ReanimatorCache();
292292
mReanimatorCache.ReanimatorCacheInitialize();
293-
TodFoley.TodFoleyInitialize(null, 103);
294-
GlobalMembersTrail.TrailLoadDefinitions(GameConstants.gLawnTrailArray, 1);
295-
TodParticleGlobal.TodParticleLoadDefinitions(ref GameConstants.gLawnParticleArray, 102);
293+
TodFoley.TodFoleyInitialize(null, (int)FoleyType.FoleyCount);
294+
GlobalMembersTrail.TrailLoadDefinitions(GameConstants.gLawnTrailArray, (int)TrailType.NumTrails);
295+
TodParticleGlobal.TodParticleLoadDefinitions(ref GameConstants.gLawnParticleArray, (int)ParticleEffect.ParticleCount);
296296
PreloadForUser();
297297
if (!mLoadingFailed && !mShutdown)
298298
{
@@ -3208,9 +3208,9 @@ public void DelayLoadGamePlayResources(bool doLoad)
32083208
if (Main.LOW_MEMORY_DEVICE)
32093209
{
32103210
ResourceManager.mReanimContentManager.Unload();
3211-
ReanimatorXnaHelpers.ReanimatorLoadDefinitions(ref GameConstants.gLawnReanimationArray, 119);
3211+
ReanimatorXnaHelpers.ReanimatorLoadDefinitions(ref GameConstants.gLawnReanimationArray, (int)ReanimationType.NumReanims);
32123212
ResourceManager.mParticleContentManager.Unload();
3213-
TodParticleGlobal.TodParticleLoadDefinitions(ref GameConstants.gLawnParticleArray, 102);
3213+
TodParticleGlobal.TodParticleLoadDefinitions(ref GameConstants.gLawnParticleArray, (int)ParticleEffect.ParticleCount);
32143214
}
32153215
}
32163216
else if (gamePlayLoaded && !doLoad)
@@ -3253,9 +3253,9 @@ public void DelayLoadZenGardenResources(bool doLoad)
32533253
if (Main.LOW_MEMORY_DEVICE)
32543254
{
32553255
ResourceManager.mReanimContentManager.Unload();
3256-
ReanimatorXnaHelpers.ReanimatorLoadDefinitions(ref GameConstants.gLawnReanimationArray, 119);
3256+
ReanimatorXnaHelpers.ReanimatorLoadDefinitions(ref GameConstants.gLawnReanimationArray, (int)ReanimationType.NumReanims);
32573257
ResourceManager.mParticleContentManager.Unload();
3258-
TodParticleGlobal.TodParticleLoadDefinitions(ref GameConstants.gLawnParticleArray, 102);
3258+
TodParticleGlobal.TodParticleLoadDefinitions(ref GameConstants.gLawnParticleArray, (int)ParticleEffect.ParticleCount);
32593259
}
32603260
}
32613261
else if (zenGardenLoaded && !doLoad)

Lawn_Shared/Sexy.TodLib/Foley/TodFoley.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public void RehookupSoundWithMusicVolume()
257257

258258
public static void TodFoleyInitialize(FoleyParams[] theFoleyParamArray, int theFoleyParamArraySize)
259259
{
260-
TodFoley.gFoleyParamArray = new FoleyParams[]
260+
TodFoley.gFoleyParamArray = new FoleyParams[(int)FoleyType.FoleyCount]
261261
{
262262
new FoleyParams(FoleyType.Sun, 10f, new int[]
263263
{

Lawn_Shared/Sexy.TodLib/Reanim/ReanimatorXnaHelpers.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public static void BlendTransform(out ReanimatorTransform theResult, ref Reanima
231231
//public static float SECONDS_PER_UPDATE = 0.033333f;
232232
public static float SECONDS_PER_UPDATE = 0.01f;
233233

234-
public static ReanimatorDefinition[] gReanimatorDefArray = new ReanimatorDefinition[119];
234+
public static ReanimatorDefinition[] gReanimatorDefArray = new ReanimatorDefinition[(int)ReanimationType.NumReanims];
235235

236236
public static ReanimationParams[] gReanimationParamArray = null;
237237

@@ -243,7 +243,7 @@ public static void BlendTransform(out ReanimatorTransform theResult, ref Reanima
243243

244244
public static double mLoadingProgress;
245245

246-
public static int mTotalResources = 118;
246+
public static int mTotalResources = (int)ReanimationType.NumReanims - 1;
247247

248248
public static int mLoadedResources;
249249
}

0 commit comments

Comments
 (0)