void drawArray(Graphics g, List <starAnimation> animationList, LineDescription[] lines, int x, int y, bool secretCourses) { for (int i = 0; i < lines.Length; i++) { if (lines[i] == null) { continue; } int line = i; int index = (i - 1) + 0xC; byte myStar = 0, collectedStar = 0; if (secretCourses) { index = lines[i].offset + 8; } index = (index >> 2 << 2) + (3 - index % 4); if (index >= 0) { myStar = (byte)(myStars[index] << 1); collectedStar = (byte)(stars[index] << 1); } g.DrawString(lines[i].text, bonusFont, Brushes.White, (lines[i].isTextOnly ? -15 : -20) + x, y + line * 15); for (int k = 0; k < 7; k++) { if (((lines[i].starMask << k) & 0x80) != 0) { starAnimation anim = animations[(secretCourses ? i + 15 : i) * 7 + k]; if (anim != null) { float d = anim.time * anim.time; d = d * d * 24; anim.rect = new RectangleF((7 - k) * 12 + x - d, i * 15 + y - d, 12 + d * 2, 12 + d * 2); anim.image = ((myStar & 0x80) > 0 || (this.mode == 1 && (collectedStar & 0x80) > 0)) ? imgStar : imgLockout; animationList.Add(anim); } else { Rectangle rect; rect = new Rectangle((7 - k) * 12 + x, i * 15 + y, 12, 12); if ((myStar & 0x80) > 0 || (this.mode == 1 && (collectedStar & 0x80) > 0)) { g.DrawImage(imgStar, rect); } else if ((collectedStar & 0x80) > 0) { g.DrawImage(imgLockout, rect); } else { g.DrawImage(imgStarSlot, rect); } } } myStar = (byte)(myStar << 1); collectedStar = (byte)(collectedStar << 1); } } }
public void visualUpdate(float fTime) { if (networkClient != null) { networkClient.update(fTime); if (networkClient.ErrorText != "") { System.Windows.Forms.MessageBox.Show("Connection has been terminated." + networkClient.ErrorText); started = false; networkClient = null; } } for (int i = 0; i < 26; i++) { for (int k = 0; k < 7; k++) { starAnimation anim = animations[i * 7 + k]; if (anim != null) { anim.time -= fTime; if (anim.time <= 0) { animations[i * 7 + k] = null; } } } } }
private void updateStarAnimations(byte[] newStars) { for (int i = 0; i < 26; i++) { int index = i + 0xB; if (i >= 15) { index = layoutDescription.secretDescription[i - 15].offset + 8; } index = (index >> 2 << 2) + (3 - index % 4); byte newStar = (byte)(newStars[index] << 1); byte collectedStar = (byte)(stars[index] << 1); for (int k = 0; k < 7; k++) { starAnimation anim = animations[i * 7 + k]; if (((collectedStar << k) & 0x80) == 0 && ((newStar << k) & 0x80) > 0) { anim = new starAnimation(); animations[i * 7 + k] = anim; } } } }