Jump to content

  • Log In with Google      Sign In   
  • Create Account

Dynamite Andy

Member Since 15 Mar 2013
Offline Last Active May 09 2013 03:06 PM

Posts I've Made

In Topic: A Super Mario Source Code

06 May 2013 - 06:51 AM

Nice, I like it.

But as already mentioned, remember to put your required .dll's and other files in the zip.

In Topic: C++ - Passing array of textures through function

03 May 2013 - 03:21 AM

The function should take a pointer, and you pass the array as it is.


virtual bool initialize(..., TextureManager *textureM);
if(!gamePanels.initialize(..., panelTexture))

That fixed that bit, but now i face this problem in panelManager intialize.


bool panelManager::initialize(Game *gamePtr, int width, int height, int ncols,
                            TextureManager *textureM)
	for (int i = 0; i < MAX_PANELS; i++)

	1	IntelliSense: invalid destructor declaration
	2	IntelliSense: no suitable conversion function from "TextureManager" to "TextureManager *" exists

Edit: Think i got it, replaced textureM[gamePanel[i].ReturnColour()] with &textureM[gamePanel[i].ReturnColour()]

In Topic: Coding Style: Curly Braces

17 April 2013 - 06:36 AM

When it comes to curly braces... I used to do this...

if (x == 0)
     // do something
     // do something else

But during university I was taught that I should always use curly braces and I should always comment everything - my lecturer was pretty strict with coding styles and marked us on the style instead of the code itself. Since leaving my coding style has changed from above to..

// Used to check if x is equal to 0
if (x == 0)
     x  =  5;        // give x the value of 5
else                 // if x is not equal to 0 then do this
     x = 4;         // give x the value of 4

Personally I now find this easier on the eyes and easier to read,

However i've found myself now starting to do this for functions

void ReturnX() { return x; }

In Topic: Keeping functions in a game engine. Switching engines

17 April 2013 - 04:47 AM


? what your suggesting is that your Modifying the acctual engine code? and when a new version is released, you code get overwritten?
Thats bad design isnt it?
Surely you have your DLLs structures like so:
Where MyGame.exe uses MyGameBase.dll which contains all the functionality of your Game, and uses SomeGenericGameEngine.dll which contains all the Code which an engine like Havok, Crytek or XNA has etc.
You dont' directly modify the Crytek engine, or the Havok engine to suit your needs, you tailor your own DLL surely?


What I was referring to is actual code, the game engine that I'm currently using is written in c++ and uses only .cpp and .h files.

In Topic: C++ Function to center image?

05 April 2013 - 08:51 AM

That did the trick, thank you! :)