• R/O
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

FreeTrainの進化系を目指す


Commit MetaInfo

Revision37 (tree)
Time2015-11-08 21:47:02
Authorc477

Log Message

DirectionalTextureSetにCatalogVariableSizeの定義、他細かい修正

Change Summary

Incremental Difference

--- trunk/core/contributions/game/CtbImageImportTerrainGenerator.cs (revision 36)
+++ trunk/core/contributions/game/CtbImageImportTerrainGenerator.cs (revision 37)
@@ -18,7 +18,7 @@
1818 namespace nft.contributions.game {
1919 public class CtbImageImportTerrainGenerator : CtbTerrainGenerator, ITerrainGenerator
2020 {
21- //public const string KEY_MAX_HEIGHT = "MaxHeoght";
21+ //public const string KEY_MAX_HEIGHT = "MaxHeight";
2222 public const string KEY_SRCIMG_PATH = "SoruceImagePath";
2323 public const string KEY_HORZ_SCALING = "HorizontalScaling";
2424 public const string KEY_VERT_SCALING = "VerticalScaling";
--- trunk/core/core/geometry/Direction.cs (revision 36)
+++ trunk/core/core/geometry/Direction.cs (revision 37)
@@ -41,6 +41,7 @@
4141 /// </summary>
4242 [Serializable]
4343 public enum InterCardinalDirection : short {
44+ // 4の倍数で始まる連続した値であること(そういう前提の実装がある)
4445 NORTHEAST = 4, NORTHWEST, SOUTHWEST, SOUTHEAST,
4546 //INVALID = byte.MaxValue
4647 }
--- trunk/core/core/graphics/DirectionalTextureSet.cs (revision 36)
+++ trunk/core/core/graphics/DirectionalTextureSet.cs (revision 37)
@@ -53,13 +53,16 @@
5353 /// <returns></returns>
5454 public abstract ConditionedTextureSrc this[int rotation] { get; }
5555
56+ public virtual int CatalogVariableSize { get; }
57+
5658 protected abstract ConditionedTextureSrc[] ArrayForCatalogVariable { get; }
5759
5860 public virtual IEnumerable<KeyValuePair<string, ICatalogVariable>> CatalogVariables {
5961 get {
6062 ConditionedTextureSrc[] array = ArrayForCatalogVariable;
61- if (array != null && array.Length > 1) {
62- ICatalogVariable var = new IndexVariable(array.Length, true);
63+ if (array != null && CatalogVariableSize > 1) {
64+ ICatalogVariable var = new IndexVariable(CatalogVariableSize, true);
65+ // デフォルトでは、回転パターンの方角をカタログ変数として返す
6366 yield return new KeyValuePair<string, ICatalogVariable>(CatalogVarNameConstants.Direction, var);
6467 } else {
6568 yield break;
@@ -91,6 +94,8 @@
9194 }
9295 }
9396
97+ public override int CatalogVariableSize { get { return 4; } }
98+
9499 protected override ConditionedTextureSrc[] ArrayForCatalogVariable {
95100 get { return textures; }
96101 }
@@ -112,6 +117,7 @@
112117 return textures[rotation & 1];
113118 }
114119 }
120+ public override int CatalogVariableSize { get { return 2; } }
115121 protected override ConditionedTextureSrc[] ArrayForCatalogVariable {
116122 get { return textures; }
117123 }
@@ -136,6 +142,7 @@
136142 yield break;
137143 }
138144 }
145+ public override int CatalogVariableSize { get { return 0; } }
139146 protected override ConditionedTextureSrc[] ArrayForCatalogVariable {
140147 // このクラスは CatalogVariablesを返さないので、このメソッドも呼ばれないはず。
141148 get { throw new NotSupportedException(); }