public CSectorDataResource(IRed3EngineFile cr2w, CVariable parent, string name) : base(cr2w, parent, name) { box0 = new CFloat(cr2w, this, nameof(box0)) { IsSerialized = true }; box1 = new CFloat(cr2w, this, nameof(box1)) { IsSerialized = true }; box2 = new CFloat(cr2w, this, nameof(box2)) { IsSerialized = true }; box3 = new CFloat(cr2w, this, nameof(box3)) { IsSerialized = true }; box4 = new CFloat(cr2w, this, nameof(box4)) { IsSerialized = true }; box5 = new CFloat(cr2w, this, nameof(box5)) { IsSerialized = true }; pathHash = new CString(cr2w, this, nameof(pathHash)) { IsSerialized = true }; }
public override CVariable SetValue(object val) { if (val is SVector2D v) { this.x = v.x; this.y = v.y; } return(this); }
public override CVariable SetValue(object val) { if (val is SVector3D v) { this.X = v.X; this.Y = v.Y; this.Z = v.Z; } return(this); }
public override CVariable SetValue(object val) { this.IsSerialized = true; this.Value = val switch { float o => o, CFloat cvar => cvar.Value, _ => this.Value }; return(this); }
public EngineTransform(CR2WFile cr2w, CVariable parent, string name) : base(cr2w, parent, name) { X = new CFloat(cr2w, this, nameof(X)); Y = new CFloat(cr2w, this, nameof(Y)); Z = new CFloat(cr2w, this, nameof(Z)); Pitch = new CFloat(cr2w, this, nameof(Pitch)); Yaw = new CFloat(cr2w, this, nameof(Yaw)); Roll = new CFloat(cr2w, this, nameof(Roll)); Scale_x = new CFloat(cr2w, this, nameof(Scale_x)); Scale_y = new CFloat(cr2w, this, nameof(Scale_y)); Scale_z = new CFloat(cr2w, this, nameof(Scale_z)); }
public SVector3D(CR2WFile cr2w, CVariable parent, string name) : base(cr2w, parent, name) { X = new CFloat(cr2w, this, nameof(X)) { IsSerialized = true }; Y = new CFloat(cr2w, this, nameof(Y)) { IsSerialized = true }; Z = new CFloat(cr2w, this, nameof(Z)) { IsSerialized = true }; }
public CSwarmCellMap(CR2WFile cr2w, CVariable parent, string name) : base(cr2w, parent, name) { Data = new CBytes(cr2w, this, nameof(Data)) { IsSerialized = true }; CornerPositionX = new CFloat(cr2w, this, nameof(CornerPositionX)) { IsSerialized = true }; CornerPositionY = new CFloat(cr2w, this, nameof(CornerPositionY)) { IsSerialized = true }; CornerPositionZ = new CFloat(cr2w, this, nameof(CornerPositionZ)) { IsSerialized = true }; DataSizeX = new CInt32(cr2w, this, nameof(DataSizeX)) { IsSerialized = true }; DataSizeY = new CInt32(cr2w, this, nameof(DataSizeY)) { IsSerialized = true }; DataSizeZ = new CInt32(cr2w, this, nameof(DataSizeZ)) { IsSerialized = true }; DataSizeBits = new CInt32(cr2w, this, nameof(DataSizeBits)) { IsSerialized = true }; SizeInKbytes = new CFloat(cr2w, this, nameof(SizeInKbytes)) { IsSerialized = true }; }
public CPaddedBuffer(IRed3EngineFile cr2w, CVariable parent, string name) : base(cr2w, parent, name) { padding = new CFloat(cr2w, this, "padding"); }
public override void Read(BinaryReader file, uint size) { base.Read(file, size); var cnt = file.ReadVLQInt32(); for (int i = 0; i < cnt; i++) { //This is actually a byte-byte pair but no idea why or how anyone would edit this var mapping = new CUInt16(cr2w, Unicodemapping, ""); mapping.Read(file, size); Unicodemapping.AddVariable(mapping); } Linedist.Read(file, size); Maxglyphheight.Read(file, size); Kerning.Read(file, size); var num = file.ReadVLQInt32(); for (int i = 0; i < num; i++) { var glyph = new CArray <CFloat>(cr2w, Glyphs, "Glyph - " + i) { Elementtype = "Float" }; // UVs CFloat uv00 = new CFloat(cr2w, glyph, "UV[0][0]"); uv00.Read(file, size); glyph.AddVariable(uv00); CFloat uv01 = new CFloat(cr2w, glyph, "UV[0][1]"); uv01.Read(file, size); glyph.AddVariable(uv01); CFloat uv10 = new CFloat(cr2w, glyph, "UV[1][0]"); uv10.Read(file, size); glyph.AddVariable(uv10); CFloat uv11 = new CFloat(cr2w, glyph, "UV[1][1]"); uv11.Read(file, size); glyph.AddVariable(uv11); CInt32 textureindex = new CInt32(cr2w, glyph, "Texture index"); textureindex.Read(file, size); glyph.AddVariable(textureindex); CInt32 width = new CInt32(cr2w, glyph, "Width"); width.Read(file, size); glyph.AddVariable(width); CInt32 height = new CInt32(cr2w, glyph, "Height"); height.Read(file, size); glyph.AddVariable(height); CInt32 advance_x = new CInt32(cr2w, glyph, "Advance X"); advance_x.Read(file, size); glyph.AddVariable(advance_x); CInt32 bearing_x = new CInt32(cr2w, glyph, "Bearing X"); bearing_x.Read(file, size); glyph.AddVariable(bearing_x); CInt32 bearing_y = new CInt32(cr2w, glyph, "Bearing Y"); bearing_y.Read(file, size); glyph.AddVariable(bearing_y); Glyphs.AddVariable(glyph); } }