public void GetFromRegs(float[] registers) { Vector4 v = new(); Rectangle rect = new(); if (!enabled || var == null || (var != null && (var.Dict != null || !var.Eval))) { return; } for (var i = 0; i < regCount; i++) { v[i] = registers[regs[i]]; } switch (type) { case REGTYPE.VEC4: var = (WinVec4)v; break; case REGTYPE.RECTANGLE: rect.x = v.x; rect.y = v.y; rect.w = v.z; rect.h = v.w; var = (WinRectangle)rect; break; case REGTYPE.VEC2: var = (WinVec2)v.ToVec2(); break; case REGTYPE.VEC3: var = (WinVec3)v.ToVec3(); break; case REGTYPE.FLOAT: var = (WinFloat)v[0]; break; case REGTYPE.INT: var = (WinInt)v[0]; break; case REGTYPE.BOOL: var = (WinBool)(v[0] != 0.0f); break; default: common.FatalError("Register::GetFromRegs: bad reg type"); break; } }
public WinVar(WinVar other) { guiDict = other.guiDict; Name = other.name; }