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!


Mussi

Member Since 12 Oct 2004
Offline Last Active Today, 01:07 PM

#5044711 The name of that floating-up fading number UI thingy?

Posted by Mussi on 19 March 2013 - 05:18 PM

Floating combat text is what it's called in World of Warcraft.




#5040525 Prevent a base class method from being overridden?

Posted by Mussi on 07 March 2013 - 02:26 PM

Does final work on non-virtual functions?

No, it can only be used on virtual functions. Same goes for override, as in you can only override a parent class' virtual function.

 

Edit:

The final identifier is there to prevent overriding methods. Technically, I think, you would not be overriding a method if it's not virtual.




#5036731 Code Review Comments

Posted by Mussi on 26 February 2013 - 09:57 AM

Hmm. Now I'm confused too. Did this behaviour change in C++11?

Seems so: http://stackoverflow.com/questions/4178175/what-are-aggregates-and-pods-and-how-why-are-they-special/7189821#7189821

 

Edit: or well I'm not sure actually :P, any experts on this?




#5036524 New forum - Coding Horrors

Posted by Mussi on 25 February 2013 - 06:37 PM

if(lolReturnThisInstead == true)
	return true;
else
	return false;



#5029363 [Tutorial] Instant-Insertion Quadtrees

Posted by Mussi on 06 February 2013 - 06:04 AM

Bookmarked. Thanks for sharing!


#5025826 A star

Posted by Mussi on 26 January 2013 - 12:44 PM

Are you sure you don't have a using namespace std; somewhere? Possibly inside include.h? Alternatively you can rename your map variable.


#5018581 How is my programming format

Posted by Mussi on 07 January 2013 - 07:51 AM

Looks good, I would however recommend learning something more powerful than VB if you expect to make responsive high paced games that those of us with older computers (You know the majority of your potential players) can play. Yes the obvious functions are always better to have.
That's not VB, I think it's Boo.


#5011623 Using multiple header and .cpp files

Posted by Mussi on 17 December 2012 - 04:04 AM

Or place this at the top of your header files:
[source lang="cpp"]#pragma once[/source]

If that doesn't fix your problem, paste the complete error/errors you're getting.


#5011423 Extracting LookAt Vector from View Matrix

Posted by Mussi on 16 December 2012 - 05:53 PM

Okay, let me start by saying that your mixed use of 'look at' and 'look' is confusing. Use look for directions and look at for positions or distinguish them in some other way.

This link I posted before, shows how the view matrix is built. You want to build the view matrix with the look direction, you get this by subtracting the eye position from what point you're looking at and then normalizing that. Basically, what eppo said.


#5010767 NULL vs 0

Posted by Mussi on 14 December 2012 - 04:42 PM

I used NULL in the past, but now I'd just define nullptr if it wasn't available. So that when you transition to a modern compiler, your code base stays consistent.


#5007308 Namespaces good for anything else?

Posted by Mussi on 04 December 2012 - 11:30 PM

One of the reasons I like namespaces is that I can count on my IDE to pop up a lovely list to quickly reference functions, classes, etc.


#5000091 C++ - Is Goto a Good Practice?

Posted by Mussi on 11 November 2012 - 08:29 PM

You don't need an object to get rid of your goto. Take a step back and look at what you're trying to accomplish. You basically want to loop when some condition is met, this is exactly what while/do while/ for loops are meant to do. You can make a function out of the battlemenu section, return true when you have to execute it again or false otherwise. Then you simply call while( battlemenu() ) {}.


#4993648 Favorite little known or underused C++ features

Posted by Mussi on 24 October 2012 - 09:17 PM

I don't know how often it's used, but man do I love auto.


#4983935 Yes, I'm still trying to make pong, and yes, I do have another bug.

Posted by Mussi on 26 September 2012 - 03:58 AM

You don't have to justify asking a 'noob' question, that's what this forum is for. Don't hesitate to ask questions when you run into more trouble :).


#4978450 Swapping addresses between pointers and cache locality

Posted by Mussi on 09 September 2012 - 07:56 PM

I'm probably being really stupid here but how is this code exactly working out? From the way I understand it I have my 32 objects and when all of them are active all bits are supposed to be set. A quick look at _BitScanForward says that it search for the LSB that is set so each loop I would find this index and use it when I updated my player. Do I understand it correct? Also I understand you said this is just an alternative but I was wondering how it would differ in general from having something like this:

The loop keeps looping until the mask becomes 0. Every iteration the first bit that's set to 1 is set to 0, going from least significant to most significant. The offset value is simply the position of the first bit set to 1, again going from LSB to MSB, this gives you a value between 0 and 31 for a 32 bit mask. It's quite ingenious I must say.

How this differs from your example is that you have a single memory address to check for availability, instead of the many addresses within each object. If I'm correct, the cache will not only load the bytes to those addresses, but also some bytes around them(that you might not need), quickly filling up your cache-lines. Please correct me if I'm wrong.




PARTNERS