Synced code, need some changes.

Everything related to the code /
Tout ce qui touche au code
Post Reply
User avatar
Cire
Moderator
Posts: 350
Joined: Tue Oct 31, 2006 5:59 pm
Location: Somewhere on Earth

Synced code, need some changes.

Post by Cire » Fri Jan 05, 2007 8:43 am

Ok I synced my code with yours again last night, first however I backed up my old version since I have alot of additional code not yet present to you. I need a few adjustments.

First starting with stdafx.h, I'll post the complete contents of this file to make things easier as I removed quite a few windows things.

Code: Select all

#pragma once

// Cire:
//   Right off the bat, lets get everything we will need from STL includes.
#include <cstdio>
#include <cstdlib>
#include <map>
#include <list>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <iostream>
#include <fstream>

// Now lets get platform specific stuff.
#include "TA3D_Platform.h"

#if defined TA3D_PLATFORM_WINDOWS
	#pragma warning(disable : 4996)

	#pragma comment( lib, "tools/win32/libs/alleg.lib" )
	#pragma comment( lib, "tools/win32/libs/agl.lib" )
	#pragma comment( lib, "opengl32.lib" )
	#pragma comment( lib, "glu32.lib" )
	#pragma comment( lib, "glaux.lib" )
	#pragma comment( lib, "tools/win32/libs/glew32.lib" )

	#include "tools/win32/include/gl/glew.h"

// Cire:
//   I had to setup a pragma on c4312, 4005 warnings, because allgero include
//     was generating alot of compiler noise.
	#pragma warning( disable : 4312 )
	#pragma warning( disable : 4005 )

	#include <alleggl.h> // alleggl also includes allegro

// Cire:
//  restore warning states
	#pragma warning( default : 4005 )
	#pragma warning( default : 4312 )
#else 
// Cire:
//   Other platfroms may wish to adjust how allegro is included, for
//   now its this way.
	#include <alleggl.h>
#endif

// Now lets get gl/glu support.
#include <GL/glu.h>

#include "jpeg/ta3d_jpg.h"

// Math include.
#include <math.h>
// Cire:
//   Malloc should not be platform specfic right???
#include <malloc.h>


// Cire:
//   string and wstring typedefs to make life easier.
typedef std::string		String;
typedef std::wstring	WString;
#define List			std::list

// Cire:
//   Since byte seems to be common throughout the project we'll typedef here.
typedef uint8         byte;
typedef unsigned char uchar;
typedef signed char   schar;

// Floating point types, defined for consistencies sakes.
typedef float  real32;
typedef double real64;

#ifdef max
	#undef max
#endif

#ifdef min
	#undef min
#endif

template<class T> inline T max(T a, T b)	{	return (a > b) ? a : b;	}
template<class T> inline T min(T a, T b)	{	return (a > b) ? b : a;	}

#if defined TA3D_PLATFORM_WINDOWS
// Cire:
//  The below functions don't exists within windows math routines.
	#define strcasecmp(x,xx) _stricmp( x, xx )

	static inline const real32 asinh( const real32 f )
	{
		return (real32)log( (real32)(f + sqrt( f * f + 1)) );
	}

	static inline const real32 acosh( const real32 f )
	{
		return (real32)log( (real32)( f + sqrt( f * f- 1)) );
	}

	static inline const real32 atanh( const real32 f)
	{
		return (real32)log( (real32)( (real32)(1.0f / f + 1.0f) /
			(real32)(1.0f / f - 1.0f))  ) / 2.0f;
	}
#endif

#if ((MAKE_VERSION(4, 2, 1) == MAKE_VERSION(ALLEGRO_VERSION, ALLEGRO_SUB_VERSION, ALLEGRO_WIP_VERSION)) && ALLEGRO_WIP_VERSION>0) \
	|| (MAKE_VERSION(4, 2, 1) < MAKE_VERSION(ALLEGRO_VERSION, ALLEGRO_SUB_VERSION, ALLEGRO_WIP_VERSION))
	#define FILE_SIZE	file_size_ex
#else
	#define FILE_SIZE	file_size
#endif

// zuzuf: to prevent some warnings
#undef PACKAGE_BUGREPORT
#undef PACKAGE_NAME
#undef PACKAGE_TARNAME
#undef PACKAGE_STRING
#undef PACKAGE_VERSION

Second in hashtable.h, cpp thiere are several snips of code that look like this.

Code: Select all

				for( class std::vector< std::list< cBucket<T> > >::iterator iter = m_Table.begin() ; iter != m_Table.end() ; iter++ ) 
				{
					if( m_bFreeDataOnErase )
					{
						for(  class std::list< cBucket<T> >::iterator cur = iter->begin() ; cur != iter->end() ; cur++ ) 
The 'class' defination in front of std::.. code is improperly used, and should prevent compling, remove 'class' from all loops that have interaterators.

Other then that the only other areas I noticed issues are that 'a' alot of gfx/binary files are still coming down as 'ascii', and thus corrupt. as well many fiels are uploaded in mac file format.

Tommorow I will submit my new TA3D_Audio files, as well as some slight changes to add some error handling code to ta3d.cpp, I'd like to get gfx code with a few slight chagnes as well, its good to see that you started one but i'd like to offer some suggestions, however its late at night, and am a bit too tired to really think though tonight.


++Cire.
Females: impossible to live with, most powerful money reducing agent known to man, 99% of the time they drive us insane; yet somehow we desire to have as many as we can.

Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests