savagerx

Members
  • Content count

    152
  • Joined

  • Last visited

Community Reputation

122 Neutral

About savagerx

  • Rank
    Member
  1. TAO framework

    Very helpful indeed! Thank you very much :)
  2. TAO framework

    Does anyone happens to come across docs on tao framework? care to enlighten this lost soul...
  3. C# OnPaint() Question

    Quote:Original post by phil05 As you can tell by this code, this is rediculous. I have to read each Array, paint it. Read next array, paint it. This occures about 50 times. Obviously, this is what methods are, to reduce the same repeated code. However, how can I pass OnPaint() to a method? Can I pass 'g' and it would work? How can I keep each array as just one so I don't have to keep re-drawing everything? // OnPaint() Override. Where map and PC/NPC/Enemies will be displayed. protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { Graphics g = e.Graphics; switch (Loc) { case eLocation.HillcrestForest1: { // Draw Map for (int y = 0; y < 10; y++) for (int x = 0; x < 13; x++) switch (rWorld.HillcrestWoods1[y, x]) { case 0: g.DrawImage(rWorld.imgGrass, x * SIZE, y * SIZE); break; case 1: g.DrawImage(rWorld.imgTree, x * SIZE, y * SIZE); break; case 2: g.DrawImage(rWorld.imgTrail_LR1, x * SIZE, y * SIZE); break; case 3: g.DrawImage(rWorld.imgTrail_LR2, x * SIZE, y * SIZE); break; case 4: g.DrawImage(rWorld.imgWater, x * SIZE, y * SIZE); break; case 5: g.DrawImage(rWorld.imgTreasure, x * SIZE, y * SIZE); break; case 6: g.DrawImage(rWorld.imgHouse1_00, x * SIZE, y * SIZE); break; case 7: g.DrawImage(rWorld.imgHouse1_01, x * SIZE, y * SIZE); break; case 8: g.DrawImage(rWorld.imgHouse1_10, x * SIZE, y * SIZE); break; case 9: g.DrawImage(rWorld.imgHouse1_11, x * SIZE, y * SIZE); break; case 10: g.DrawImage(rWorld.imgTrailCL, x * SIZE, y * SIZE); break; case 11: g.DrawImage(rWorld.imgTrail, x * SIZE, y * SIZE); break; case 12: g.DrawImage(rWorld.imgShore, x * SIZE, y * SIZE); break; case 13: g.DrawImage(rWorld.imgShoreTop, x * SIZE, y * SIZE); break; case 14: g.DrawImage(rWorld.imgTreeStump1, x * SIZE, y * SIZE); break; case 15: g.DrawImage(rWorld.imgFlowers1, x * SIZE, y * SIZE); break; } } break; case eLocation.HillcrestForest2: { // Draw Map for (int y = 0; y < 10; y++) for (int x = 0; x < 13; x++) switch (rWorld.HillcrestWoods2[y, x]) { case 0: g.DrawImage(rWorld.imgGrass, x * SIZE, y * SIZE); break; case 1: g.DrawImage(rWorld.imgTree, x * SIZE, y * SIZE); break; case 2: g.DrawImage(rWorld.imgTrail_LR1, x * SIZE, y * SIZE); break; case 3: g.DrawImage(rWorld.imgTrail_LR2, x * SIZE, y * SIZE); break; case 4: g.DrawImage(rWorld.imgWater, x * SIZE, y * SIZE); break; case 5: g.DrawImage(rWorld.imgTreasure, x * SIZE, y * SIZE); break; case 6: g.DrawImage(rWorld.imgHouse1_00, x * SIZE, y * SIZE); break; case 7: g.DrawImage(rWorld.imgHouse1_01, x * SIZE, y * SIZE); break; case 8: g.DrawImage(rWorld.imgHouse1_10, x * SIZE, y * SIZE); break; case 9: g.DrawImage(rWorld.imgHouse1_11, x * SIZE, y * SIZE); break; case 10: g.DrawImage(rWorld.imgTrailCL, x * SIZE, y * SIZE); break; case 11: g.DrawImage(rWorld.imgTrail, x * SIZE, y * SIZE); break; case 12: g.DrawImage(rWorld.imgShore, x * SIZE, y * SIZE); break; case 13: g.DrawImage(rWorld.imgShoreTop, x * SIZE, y * SIZE); break; case 14: g.DrawImage(rWorld.imgTreeStump1, x * SIZE, y * SIZE); break; case 15: g.DrawImage(rWorld.imgFlowers1, x * SIZE, y * SIZE); break; } } break;
  4. C# OnPaint() Question

    Quote:Original post by phil05 As you can tell by this code, this is rediculous. I have to read each Array, paint it. Read next array, paint it. This occures about 50 times. Obviously, this is what methods are, to reduce the same repeated code. However, how can I pass OnPaint() to a method? Can I pass 'g' and it would work? How can I keep each array as just one so I don't have to keep re-drawing everything? // OnPaint() Override. Where map and PC/NPC/Enemies will be displayed. protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { Graphics g = e.Graphics; switch (Loc) { case eLocation.HillcrestForest1: { // Draw Map for (int y = 0; y < 10; y++) for (int x = 0; x < 13; x++) switch (rWorld.HillcrestWoods1[y, x]) { case 0: g.DrawImage(rWorld.imgGrass, x * SIZE, y * SIZE); break; case 1: g.DrawImage(rWorld.imgTree, x * SIZE, y * SIZE); break; case 2: g.DrawImage(rWorld.imgTrail_LR1, x * SIZE, y * SIZE); break; case 3: g.DrawImage(rWorld.imgTrail_LR2, x * SIZE, y * SIZE); break; case 4: g.DrawImage(rWorld.imgWater, x * SIZE, y * SIZE); break; case 5: g.DrawImage(rWorld.imgTreasure, x * SIZE, y * SIZE); break; case 6: g.DrawImage(rWorld.imgHouse1_00, x * SIZE, y * SIZE); break; case 7: g.DrawImage(rWorld.imgHouse1_01, x * SIZE, y * SIZE); break; case 8: g.DrawImage(rWorld.imgHouse1_10, x * SIZE, y * SIZE); break; case 9: g.DrawImage(rWorld.imgHouse1_11, x * SIZE, y * SIZE); break; case 10: g.DrawImage(rWorld.imgTrailCL, x * SIZE, y * SIZE); break; case 11: g.DrawImage(rWorld.imgTrail, x * SIZE, y * SIZE); break; case 12: g.DrawImage(rWorld.imgShore, x * SIZE, y * SIZE); break; case 13: g.DrawImage(rWorld.imgShoreTop, x * SIZE, y * SIZE); break; case 14: g.DrawImage(rWorld.imgTreeStump1, x * SIZE, y * SIZE); break; case 15: g.DrawImage(rWorld.imgFlowers1, x * SIZE, y * SIZE); break; } } break; case eLocation.HillcrestForest2: { // Draw Map for (int y = 0; y < 10; y++) for (int x = 0; x < 13; x++) switch (rWorld.HillcrestWoods2[y, x]) { case 0: g.DrawImage(rWorld.imgGrass, x * SIZE, y * SIZE); break; case 1: g.DrawImage(rWorld.imgTree, x * SIZE, y * SIZE); break; case 2: g.DrawImage(rWorld.imgTrail_LR1, x * SIZE, y * SIZE); break; case 3: g.DrawImage(rWorld.imgTrail_LR2, x * SIZE, y * SIZE); break; case 4: g.DrawImage(rWorld.imgWater, x * SIZE, y * SIZE); break; case 5: g.DrawImage(rWorld.imgTreasure, x * SIZE, y * SIZE); break; case 6: g.DrawImage(rWorld.imgHouse1_00, x * SIZE, y * SIZE); break; case 7: g.DrawImage(rWorld.imgHouse1_01, x * SIZE, y * SIZE); break; case 8: g.DrawImage(rWorld.imgHouse1_10, x * SIZE, y * SIZE); break; case 9: g.DrawImage(rWorld.imgHouse1_11, x * SIZE, y * SIZE); break; case 10: g.DrawImage(rWorld.imgTrailCL, x * SIZE, y * SIZE); break; case 11: g.DrawImage(rWorld.imgTrail, x * SIZE, y * SIZE); break; case 12: g.DrawImage(rWorld.imgShore, x * SIZE, y * SIZE); break; case 13: g.DrawImage(rWorld.imgShoreTop, x * SIZE, y * SIZE); break; case 14: g.DrawImage(rWorld.imgTreeStump1, x * SIZE, y * SIZE); break; case 15: g.DrawImage(rWorld.imgFlowers1, x * SIZE, y * SIZE); break; } } break; wah! wats this?