internal SceneInfo(Reader reader, bool scenesHaveModeFilter) { Name = reader.ReadRSDKString(); Zone = reader.ReadRSDKString(); SceneID = reader.ReadRSDKString(); if (scenesHaveModeFilter) { ModeFilter = reader.ReadByte(); } }
internal SceneInfo(Reader reader, bool scenesHaveModeFilter, int currentConfigID = 0) { Name = reader.ReadRSDKString(); Zone = reader.ReadRSDKString(); SceneID = reader.ReadRSDKString(); LevelID = currentConfigID; //For GameConfig Position; Used for Auto Booting if (scenesHaveModeFilter) { ModeFilter = reader.ReadByte(); } }
public SceneInfo(Reader reader, bool scenesHaveModeFilter, int index, bool levelIDMode = false) { Name = reader.ReadRSDKString(); Zone = reader.ReadRSDKString(); SceneID = reader.ReadRSDKString(); if (levelIDMode) { LevelID = CurrentLevelID; //For GameConfig Position; Used for Auto Booting } Index = index; //For Getting the Index of Categories if (scenesHaveModeFilter) { ModeFilter = reader.ReadByte(); } }
public GameConfig(Reader reader, bool closeReader = false) { ReadMagic(reader); GameName = reader.ReadRSDKString(); GameSubname = reader.ReadRSDKString(); Version = reader.ReadRSDKString(); InterpretVersion(); StartSceneCategoryIndex = reader.ReadByte(); StartSceneIndex = reader.ReadUInt16(); ReadCommonConfig(reader); ushort TotalScenes = reader.ReadUInt16(); byte categories_count = reader.ReadByte(); CurrentLevelID = 0; for (int i = 0; i < categories_count; ++i) { Categories.Add(new Category(reader, _scenesHaveModeFilter)); } CurrentLevelID = 0; try { byte config_memory_count = reader.ReadByte(); for (int i = 0; i < config_memory_count; ++i) { ConfigMemory.Add(new ConfigurableMemoryEntry(reader)); } } catch (Exception ex) { Console.WriteLine("Error reading config memory! you potentially have a bad gameconfig!"); Console.WriteLine("Error: " + ex.Message); } if (closeReader) { reader.Close(); } }
internal SceneEditorMetadata(Reader reader) { UnknownByte = reader.ReadByte(); BackgroundColor1 = new Color(reader); BackgroundColor2 = new Color(reader); UnknownBytes = reader.ReadBytes(7); BinName = reader.ReadRSDKString(); UnknownByte2 = reader.ReadByte(); }
internal void ReadObjectsNames(Reader reader) { byte objects_count = reader.ReadByte(); for (int i = 0; i < objects_count; ++i) { ObjectsNames.Add(reader.ReadRSDKString()); } }
public Animation(Reader reader) { if (!reader.ReadBytes(4).SequenceEqual(MAGIC)) { throw new Exception("Invalid config file header magic"); } TotalFrameCount = reader.ReadInt32(); int spriteSheetCount = reader.ReadByte(); for (int i = 0; i < spriteSheetCount; ++i) { SpriteSheets.Add(reader.ReadRSDKString()); string tmp = ""; for (int ii = 0; ii < SpriteSheets[i].Length - 1; ii++) //Fixes a crash when using the string to load (by trimming the null char off) { tmp += SpriteSheets[i][ii]; } SpriteSheets[i] = tmp; } int collisionBoxCount = reader.ReadByte(); for (int i = 0; i < collisionBoxCount; ++i) { CollisionBoxes.Add(reader.ReadRSDKString()); string tmp = ""; for (int ii = 0; ii < CollisionBoxes[i].Length - 1; ii++) //Fixes a crash when using the string to load (by trimming the null char off) { tmp += CollisionBoxes[i][ii]; } CollisionBoxes[i] = tmp; } var animationCount = reader.ReadInt16(); for (int i = 0; i < animationCount; ++i) { Animations.Add(new AnimationEntry(reader, this)); } reader.Close(); }
internal Category(Reader reader) { Name = reader.ReadRSDKString(); byte scenes_count = reader.ReadByte(); for (int i = 0; i < scenes_count; ++i) { Scenes.Add(new SceneInfo(reader)); } }
internal Category(Reader reader, bool scenesHaveModeFilter) { Name = reader.ReadRSDKString(); byte scenes_count = reader.ReadByte(); for (int i = 0; i < scenes_count; ++i) { Scenes.Add(new SceneInfo(reader, scenesHaveModeFilter, RSDKv5.GameConfig.CurrentLevelID)); RSDKv5.GameConfig.CurrentLevelID++; } }
public AnimationEntry(Reader reader, Animation anim = null) { AnimName = reader.ReadRSDKString().Replace("" + '\0', ""); short frameCount = reader.ReadInt16(); SpeedMultiplyer = reader.ReadInt16(); LoopIndex = reader.ReadByte(); RotationFlags = reader.ReadByte(); for (int i = 0; i < frameCount; ++i) { Frames.Add(new Frame(reader, anim)); } }
private void Read(Reader reader) { ReadMagic(reader); GameName = reader.ReadRSDKString(); GameSubname = reader.ReadRSDKString(); Version = reader.ReadRSDKString(); InterpretVersion(); StartSceneCategoryIndex = reader.ReadByte(); StartSceneIndex = reader.ReadUInt16(); ReadCommonConfig(reader); ushort TotalScenes = reader.ReadUInt16(); if (CurrentLevelID >= TotalScenes) { CurrentLevelID = 0; } byte categories_count = reader.ReadByte(); for (int i = 0; i < categories_count; ++i) { Categories.Add(new Category(reader, _scenesHaveModeFilter)); } byte config_memory_count = reader.ReadByte(); for (int i = 0; i < config_memory_count; ++i) { ConfigMemory.Add(new ConfigurableMemoryEntry(reader)); } }
private GameConfig(Reader reader, bool closeStream = false) { base.ReadMagic(reader); GameName = reader.ReadRSDKString(); GameSubname = reader.ReadRSDKString(); Version = reader.ReadRSDKString(); InterpretVersion(); StartSceneCategoryIndex = reader.ReadByte(); StartSceneIndex = reader.ReadUInt16(); base.ReadCommonConfig(reader); ushort TotalScenes = reader.ReadUInt16(); byte categories_count = reader.ReadByte(); for (int i = 0; i < categories_count; ++i) { Categories.Add(new Category(reader, _scenesHaveModeFilter)); } byte config_memory_count = reader.ReadByte(); for (int i = 0; i < config_memory_count; ++i) { ConfigMemory.Add(new ConfigurableMemoryEntry(reader)); } if (closeStream) { reader.Close(); } }
public Category(Reader reader, bool scenesHaveModeFilter) { Name = reader.ReadRSDKString(); byte scenes_count = reader.ReadByte(); int index = 0; for (int i = 0; i < scenes_count; ++i) { Scenes.Add(new SceneInfo(reader, scenesHaveModeFilter, index, true)); CurrentLevelID++; index++; } }
public AnimationEntry(Reader reader, Animation anim = null) { AnimName = reader.ReadRSDKString(); string tmp = ""; for (int ii = 0; ii < AnimName.Length - 1; ii++) //Fixes a crash when using the string to load (by trimming the null char off) { tmp += AnimName[ii]; } AnimName = tmp; short frameCount = reader.ReadInt16(); SpeedMultiplyer = reader.ReadInt16(); LoopIndex = reader.ReadByte(); RotationFlags = reader.ReadByte(); for (int i = 0; i < frameCount; ++i) { Frames.Add(new Frame(reader, anim)); } }
internal SceneLayer(Reader reader) { IgnoredByte = reader.ReadByte(); Name = reader.ReadRSDKString(); UnknownByte1 = reader.ReadByte(); UnknownByte2 = reader.ReadByte(); Width = reader.ReadUInt16(); Height = reader.ReadUInt16(); UnknownWord1 = reader.ReadUInt16(); UnknownWord2 = reader.ReadUInt16(); ushort scrolling_info_count = reader.ReadUInt16(); for (int i = 0; i < scrolling_info_count; ++i) { ScrollingInfo.Add(new ScrollInfo(reader)); } ScrollIndexes = reader.ReadCompressed(); Tiles = new ushort[Height][]; using (Reader creader = reader.GetCompressedStream()) { for (int i = 0; i < Height; ++i) { Tiles[i] = new ushort[Width]; for (int j = 0; j < Width; ++j) { Tiles[i][j] = creader.ReadUInt16(); } } } }
internal SceneInfo(Reader reader) { Name = reader.ReadRSDKString(); Zone = reader.ReadRSDKString(); SceneID = reader.ReadRSDKString(); }
internal WAVConfiguration(Reader reader) { Name = reader.ReadRSDKString(); MaxConcurrentPlay = reader.ReadByte(); }
internal WAVConfiguration(Reader reader) { Name = reader.ReadRSDKString(); Console.WriteLine(Name); MaxConcurrentPlay = reader.ReadByte(); }