protected override void loadBlo1(aBinaryReader reader) { base.loadBlo1(reader); var finder = bloResourceFinder.getFinder(); int numparams = reader.Read8(); mFont = finder.find <bloResFont>(reader, "font"); mTopColor = new bloColor(reader.Read32()); mBottomColor = new bloColor(reader.Read32()); int binding = reader.Read8(); mHBinding = (bloTextboxHBinding)((binding >> 2) & 3); mVBinding = (bloTextboxVBinding)((binding >> 0) & 3); mFontSpacing = reader.ReadS16(); mFontLeading = reader.ReadS16(); mFontWidth = reader.Read16(); mFontHeight = reader.Read16(); int strlen = reader.Read16(); setString(reader.Read8s(strlen)); numparams -= 10; if (numparams > 0) { if (reader.Read8() != 0) { setConnectParent(true); } --numparams; } if (numparams > 0) { mFromColor = new bloColor(reader.Read32()); --numparams; } else { mFromColor = new bloColor(bloColor.cZero); } if (numparams > 0) { mToColor = new bloColor(reader.Read32()); --numparams; } else { mToColor = new bloColor(bloColor.cOne); } reader.Skip(4); }
protected override void loadCompact(aBinaryReader reader) { base.loadCompact(reader); var finder = bloResourceFinder.getFinder(); mTextureCount = 1; mTextures[0] = finder.find <bloTexture>(reader, "timg"); mPalette = finder.find <bloPalette>(reader, "tlut"); mBinding = (bloBinding)reader.Read8(); int bits = reader.Read8(); mMirror = (bloMirror)((bits >> 0) & 3); mRotate90 = ((bits & 4) != 0); mWrapS = (bloWrapMode)((bits >> 3) & 3); mWrapT = mWrapS; reader.Skip(4); for (int i = 0; i < 4; ++i) { mColors[i] = new bloColor(bloColor.cWhite); } setBlendKonstColor(); setBlendKonstAlpha(); }
protected override void loadCompact(aBinaryReader reader) { base.loadCompact(reader); var finder = bloResourceFinder.getFinder(); mFont = finder.find <bloResFont>(reader, "font"); mTopColor = new bloColor(reader.Read32()); mBottomColor = new bloColor(reader.Read32()); int hbinding = reader.Read8(); mHBinding = (bloTextboxHBinding)(hbinding & 127); mVBinding = (bloTextboxVBinding)reader.Read8(); if ((hbinding & 0x80) != 0) { mFontSpacing = reader.ReadS16(); mFontLeading = reader.ReadS16(); mFontWidth = reader.Read16(); mFontHeight = reader.Read16(); } else if (mFont != null) { mFontSpacing = 0; mFontLeading = mFont.getLeading(); mFontWidth = mFont.getWidth(); mFontHeight = mFont.getHeight(); } else { mFontSpacing = 0; mFontLeading = 0; mFontWidth = 0; mFontHeight = 0; } int strlen = reader.Read16(); setString(reader.Read8s(strlen)); mFromColor = new bloColor(bloColor.cZero); mToColor = new bloColor(bloColor.cOne); reader.Skip(4); }
protected override void loadCompact(aBinaryReader reader) { base.loadCompact(reader); var finder = bloResourceFinder.getFinder(); int x = reader.Read16(); int y = reader.Read16(); int width = reader.Read16(); int height = reader.Read16(); mContentRect.set(x, y, (x + width), (y + height)); for (int i = 0; i < 4; ++i) { mTextures[i].texture = finder.find <bloTexture>(reader, "timg"); } mPalette = finder.find <bloPalette>(reader, "tlut"); int bits = reader.Read8(); for (int i = 0; i < 4; ++i) { mTextures[i].mirror = (bloMirror)((bits >> (6 - (i * 2))) & 3); } for (int i = 0; i < 4; ++i) { mTextures[i].color = new bloColor(reader.Read32()); } mContentTexture = null; mFromColor.rgba = bloColor.cZero; mToColor.rgba = bloColor.cOne; reader.Skip(4); initializeMinSize(); }
protected override void loadBlo1(aBinaryReader reader) { base.loadBlo1(reader); var finder = bloResourceFinder.getFinder(); int numparams = reader.Read8(); mTextureCount = 1; mTextures[0] = finder.find <bloTexture>(reader, "timg"); mPalette = finder.find <bloPalette>(reader, "tlut"); mBinding = (bloBinding)reader.Read8(); numparams -= 3; if (numparams > 0) { int bits = reader.Read8(); mMirror = (bloMirror)(bits & 3); mRotate90 = ((bits & 4) != 0); --numparams; } else { mMirror = 0; mRotate90 = false; } if (numparams > 0) { int bits = reader.Read8(); mWrapS = (bloWrapMode)((bits >> 2) & 3); mWrapT = (bloWrapMode)((bits >> 0) & 3); --numparams; } else { mWrapS = bloWrapMode.None; mWrapT = bloWrapMode.None; } if (numparams > 0) { mFromColor = new bloColor(reader.Read32()); --numparams; } else { mFromColor = new bloColor(bloColor.cZero); } if (numparams > 0) { mToColor = new bloColor(reader.Read32()); --numparams; } else { mToColor = new bloColor(bloColor.cOne); } for (int i = 0; i < 4; ++i) { if (numparams > 0) { mColors[i] = new bloColor(reader.Read32()); --numparams; } else { mColors[i] = new bloColor(bloColor.cWhite); } } reader.Skip(4); setBlendKonstColor(); setBlendKonstAlpha(); }
protected virtual void loadBlo1(aBinaryReader reader) { if (reader == null) { throw new ArgumentNullException("reader"); } int numparams = reader.Read8(); mVisible = (reader.Read8() != 0); reader.Step(2); mName = reader.Read32(); int left = reader.ReadS16(); int top = reader.ReadS16(); int width = reader.ReadS16(); int height = reader.ReadS16(); mRect.set(left, top, (left + width), (top + height)); numparams -= 6; if (numparams > 0) { mAngle = reader.Read16(); --numparams; } else { mAngle = 0.0d; } if (numparams > 0) { mAnchor = (bloAnchor)reader.Read8(); --numparams; } else { mAnchor = bloAnchor.TopLeft; } if (numparams > 0) { mAlpha = reader.Read8(); --numparams; } else { mAlpha = 255; } if (numparams > 0) { mInheritAlpha = (reader.Read8() != 0); --numparams; } else { mInheritAlpha = true; } reader.Skip(4); }