Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Nexian

Member Since 11 Jan 2010
Offline Last Active Sep 07 2013 03:52 AM

#4971150 Chat/Combat Log (Game)

Posted by Nexian on 19 August 2012 - 11:00 AM

Buy the book Design Patterns: Elements of Reusable Object-Oriented Software, by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides. It sounds like you're at the point where it'd be rather useful.


Thank you for the book suggestion. Added a link to the book for when I am not horrifically poor :)

For filtering reasons I would add a type field to your CombatLogLine struct.

Have you profiled this case for being slow already, if not don´t worry about it untill it becomes a problem, but an idea to reduce the drawcalls is to combine all of the CombatLogLines into one string seperated with carrage return feed symbol if they don't contain an image. This will then only use one call to D3DXFont::DrawText for that portion of text.


Yeah, a type field would probably be a good idea, maybe with a source and flags for the type. Like Source = Player 1 and Type = LTYPE_COMBAT | LTYPE_GETHIT

You're right, I probably should worry about performance when it actually becomes an issue. ^^


PARTNERS