소스 검색

Work on the f* codding style

Panagiotis Christopoulos Charitos 16 년 전
부모
커밋
0d3a4eb383
85개의 변경된 파일674개의 추가작업 그리고 1215개의 파일을 삭제
  1. 365 391
      build/debug/Makefile
  2. 2 2
      src/controllers/Controller.cpp
  3. 1 1
      src/controllers/Controller.h
  4. 1 1
      src/controllers/LightPropsScriptCtrl.h
  5. 1 1
      src/controllers/MeshSkelNodeCtrl.h
  6. 1 1
      src/controllers/SkelAnimCtrl.h
  7. 1 1
      src/controllers/TrfScriptCtrl.h
  8. 62 62
      src/main.cpp
  9. 1 1
      src/math/Axisang.h
  10. 1 1
      src/math/Euler.h
  11. 1 1
      src/math/Mat3.h
  12. 1 1
      src/math/Mat4.h
  13. 1 1
      src/math/MathFuncs.h
  14. 1 1
      src/math/MathFuncs.inl.h
  15. 1 1
      src/math/Quat.h
  16. 1 1
      src/math/Vec2.h
  17. 1 1
      src/math/Vec3.h
  18. 1 1
      src/math/Vec4.h
  19. 1 1
      src/renderer/BulletDebuger.h
  20. 1 1
      src/renderer/fbo.h
  21. 2 2
      src/renderer/r_bs.cpp
  22. 2 2
      src/renderer/r_bs2.cpp
  23. 9 9
      src/renderer/r_dbg.cpp
  24. 5 5
      src/renderer/r_is.cpp
  25. 3 3
      src/renderer/r_is_shadows.cpp
  26. 3 3
      src/renderer/r_ms.cpp
  27. 4 4
      src/renderer/r_ms_earlyz.cpp
  28. 1 1
      src/renderer/r_pps_lscatt.cpp
  29. 1 1
      src/renderer/r_private.h
  30. 5 5
      src/renderer/renderer.cpp
  31. 1 1
      src/renderer/renderer.h
  32. 1 1
      src/renderer/vbo.h
  33. 1 1
      src/renderer2/r_is.cpp
  34. 5 5
      src/renderer2/r_ms.cpp
  35. 1 1
      src/resources/Extension.h
  36. 1 1
      src/resources/LightProps.h
  37. 2 2
      src/resources/Material.cpp
  38. 1 1
      src/resources/Material.h
  39. 1 1
      src/resources/Mesh.h
  40. 1 1
      src/resources/Path.h
  41. 2 2
      src/resources/Resource.cpp
  42. 10 11
      src/resources/Resource.h
  43. 1 1
      src/resources/ShaderParser.h
  44. 3 3
      src/resources/ShaderProg.cpp
  45. 1 1
      src/resources/ShaderProg.h
  46. 1 1
      src/resources/SkelAnim.h
  47. 2 2
      src/resources/Skeleton.cpp
  48. 4 3
      src/resources/Skeleton.h
  49. 1 1
      src/resources/Texture.h
  50. 1 1
      src/scene/Camera.cpp
  51. 1 1
      src/scene/Camera.h
  52. 4 4
      src/scene/Light.cpp
  53. 1 1
      src/scene/Light.h
  54. 1 1
      src/scene/MeshNode.h
  55. 2 2
      src/scene/Node.cpp
  56. 1 1
      src/scene/Node.h
  57. 1 1
      src/scene/Scene.cpp
  58. 4 4
      src/scene/Scene.h
  59. 2 2
      src/scene/SkelModelNode.h
  60. 1 1
      src/scene/SkelNode.h
  61. 1 1
      src/tokenizer/Scanner.h
  62. 1 1
      src/tokenizer/parser.h
  63. 12 12
      src/ui/Ui.cpp
  64. 22 0
      src/ui/Ui.h
  65. 0 22
      src/ui/ui.h
  66. 1 1
      src/uncategorized/collision.h
  67. 0 30
      src/uncategorized/engine_class.cpp
  68. 0 29
      src/uncategorized/engine_class.h
  69. 0 30
      src/uncategorized/input.h
  70. 1 1
      src/uncategorized/map.h
  71. 1 1
      src/uncategorized/memory.h
  72. 1 1
      src/uncategorized/particles.cpp
  73. 2 2
      src/uncategorized/particles.h
  74. 1 1
      src/uncategorized/skybox.cpp
  75. 1 1
      src/uncategorized/skybox.h
  76. 15 15
      src/utility/App.cpp
  77. 3 3
      src/utility/App.h
  78. 2 0
      src/utility/Common.cpp
  79. 6 11
      src/utility/Common.h
  80. 32 32
      src/utility/Input.cpp
  81. 30 0
      src/utility/Input.h
  82. 1 1
      src/utility/Util.cpp
  83. 1 1
      src/utility/Util.h
  84. 0 23
      src/utility/common.cpp
  85. 0 430
      src/utility/u_string.h

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 365 - 391
build/debug/Makefile


+ 2 - 2
src/controllers/Controller.cpp

@@ -4,10 +4,10 @@
 Controller::Controller( Type type_ ): 
 	type(type_) 
 {
-	scene::registerController( this );
+	Scene::registerController( this );
 }
 
 Controller::~Controller()
 {
-	scene::unregisterController( this );
+	Scene::unregisterController( this );
 }

+ 1 - 1
src/controllers/Controller.h

@@ -1,7 +1,7 @@
 #ifndef _CONTROLLER_H_
 #define _CONTROLLER_H_
 
-#include "common.h"
+#include "Common.h"
 
 
 /// Scenegraph node controller (A)

+ 1 - 1
src/controllers/LightPropsScriptCtrl.h

@@ -1,7 +1,7 @@
 #ifndef _LIGHT_SCRIPT_CTRL_H_
 #define _LIGHT_SCRIPT_CTRL_H_
 
-#include "common.h"
+#include "Common.h"
 #include "Controller.h"
 
 

+ 1 - 1
src/controllers/MeshSkelNodeCtrl.h

@@ -1,7 +1,7 @@
 #ifndef _MESH_SKEL_CTRL_H_
 #define _MESH_SKEL_CTRL_H_
 
-#include "common.h"
+#include "Common.h"
 #include "Controller.h"
 
 

+ 1 - 1
src/controllers/SkelAnimCtrl.h

@@ -1,7 +1,7 @@
 #ifndef _SKEL_ANIM_CTRL_H_
 #define _SKEL_ANIM_CTRL_H_
 
-#include "common.h"
+#include "Common.h"
 #include "Controller.h"
 #include "Math.h"
 

+ 1 - 1
src/controllers/TrfScriptCtrl.h

@@ -1,7 +1,7 @@
 #ifndef _TRF_SCRIPT_CTRL_H_
 #define _TRF_SCRIPT_CTRL_H_
 
-#include "common.h"
+#include "Common.h"
 #include "Controller.h"
 
 

+ 62 - 62
src/main.cpp

@@ -2,14 +2,14 @@
 #include <iostream>
 #include <fstream>
 #include <typeinfo>
-#include "common.h"
+#include "Common.h"
 
-#include "input.h"
+#include "Input.h"
 #include "Camera.h"
 #include "Math.h"
 #include "renderer.h"
-#include "ui.h"
-#include "app.h"
+#include "Ui.h"
+#include "App.h"
 #include "particles.h"
 #include "Texture.h"
 #include "Mesh.h"
@@ -35,7 +35,7 @@
 
 
 // map (hard coded)
-Camera* main_cam;
+Camera* mainCam;
 MeshNode* floor__,* sarge,* horse;
 skelModelNode* imp;
 PointLight* point_lights[10];
@@ -49,7 +49,7 @@ class floor_t: public Camera
 			r::dbg::RenderCube( true, 1.0 );
 		}
 
-		void RenderDepth()
+		void renderDepth()
 		{
 			r::dbg::RenderCube( true, 1.0 );
 		}
@@ -179,17 +179,17 @@ void Init()
 	srand( unsigned(time(NULL)) );
 	mathSanityChecks();
 
-	app::initWindow();
-	uint ticks = app::getTicks();
+	App::initWindow();
+	uint ticks = App::getTicks();
 
 	r::Init();
-	ui::Init();
+	Ui::init();
 
 	// camera
-	main_cam = new Camera( r::aspect_ratio*toRad(60.0), toRad(60.0), 0.5, 100.0 );
-	main_cam->moveLocalY( 3.0 );
-	main_cam->moveLocalZ( 5.7 );
-	main_cam->moveLocalX( -0.3 );
+	mainCam = new Camera( r::aspect_ratio*toRad(60.0), toRad(60.0), 0.5, 100.0 );
+	mainCam->moveLocalY( 3.0 );
+	mainCam->moveLocalZ( 5.7 );
+	mainCam->moveLocalX( -0.3 );
 
 	// lights
 	point_lights[0] = new PointLight();
@@ -226,7 +226,7 @@ void Init()
 	imp = new skelModelNode();
 	imp->init( "models/imp/imp.smdl" );
 	imp->setLocalTransformation( Vec3( 0.0, 2.11, 0.0 ), Mat3( Euler(-M::PI/2, 0.0, 0.0) ), 0.7 );
-	imp->meshNodes[0]->meshSkelCtrl->skelNode->skelAnimCtrl->skelAnim = rsrc::skel_anims.load( "models/imp/walk.imp.anim" );
+	imp->meshNodes[0]->meshSkelCtrl->skelNode->skelAnimCtrl->skelAnim = rsrc::skelAnims.load( "models/imp/walk.imp.anim" );
 	imp->meshNodes[0]->meshSkelCtrl->skelNode->skelAnimCtrl->step = 0.8;
 
 
@@ -236,9 +236,9 @@ void Init()
 
 	const char* skybox_fnames [] = { "textures/env/hellsky4_forward.tga", "textures/env/hellsky4_back.tga", "textures/env/hellsky4_left.tga",
 																	 "textures/env/hellsky4_right.tga", "textures/env/hellsky4_up.tga", "textures/env/hellsky4_down.tga" };
-	scene::skybox.load( skybox_fnames );
+	Scene::skybox.load( skybox_fnames );
 
-	PRINT( "Engine initialization ends (" << app::getTicks()-ticks << ")" );
+	PRINT( "Engine initialization ends (" << App::getTicks()-ticks << ")" );
 	cerr.flush();
 }
 
@@ -251,16 +251,16 @@ int main( int /*argc*/, char* /*argv*/[] )
 	float f = M::sin( 10.0 );
 	PRINT( f );
 
-	app::printAppInfo();
+	App::printAppInfo();
 
 	Init();
 
 	PRINT( "Entering main loop" );
-	int ticks = app::getTicks();
+	int ticks = App::getTicks();
 	do
 	{
-		int ticks_ = app::getTicks();
-		i::HandleEvents();
+		int ticks_ = App::getTicks();
+		I::handleEvents();
 		r::PrepareNextFrame();
 
 		float dist = 0.2;
@@ -268,65 +268,65 @@ int main( int /*argc*/, char* /*argv*/[] )
 		float scale = 0.01;
 
 		// move the camera
-		static Node* mover = main_cam;
-
-		if( i::keys[ SDLK_1 ] ) mover = main_cam;
-		if( i::keys[ SDLK_2 ] ) mover = point_lights[0];
-		if( i::keys[ SDLK_3 ] ) mover = spot_lights[0];
-		if( i::keys[ SDLK_4 ] ) mover = point_lights[1];
-		if( i::keys[ SDLK_5 ] ) mover = spot_lights[1];
-		if( i::keys[ SDLK_m ] == 1 ) i::warp_mouse = !i::warp_mouse;
-
-		if( i::keys[SDLK_a] ) mover->moveLocalX( -dist );
-		if( i::keys[SDLK_d] ) mover->moveLocalX( dist );
-		if( i::keys[SDLK_LSHIFT] ) mover->moveLocalY( dist );
-		if( i::keys[SDLK_SPACE] ) mover->moveLocalY( -dist );
-		if( i::keys[SDLK_w] ) mover->moveLocalZ( -dist );
-		if( i::keys[SDLK_s] ) mover->moveLocalZ( dist );
-		if( !i::warp_mouse )
+		static Node* mover = mainCam;
+
+		if( I::keys[ SDLK_1 ] ) mover = mainCam;
+		if( I::keys[ SDLK_2 ] ) mover = point_lights[0];
+		if( I::keys[ SDLK_3 ] ) mover = spot_lights[0];
+		if( I::keys[ SDLK_4 ] ) mover = point_lights[1];
+		if( I::keys[ SDLK_5 ] ) mover = spot_lights[1];
+		if( I::keys[ SDLK_m ] == 1 ) I::warpMouse = !I::warpMouse;
+
+		if( I::keys[SDLK_a] ) mover->moveLocalX( -dist );
+		if( I::keys[SDLK_d] ) mover->moveLocalX( dist );
+		if( I::keys[SDLK_LSHIFT] ) mover->moveLocalY( dist );
+		if( I::keys[SDLK_SPACE] ) mover->moveLocalY( -dist );
+		if( I::keys[SDLK_w] ) mover->moveLocalZ( -dist );
+		if( I::keys[SDLK_s] ) mover->moveLocalZ( dist );
+		if( !I::warpMouse )
 		{
-			if( i::keys[SDLK_UP] ) mover->rotateLocalX( ang );
-			if( i::keys[SDLK_DOWN] ) mover->rotateLocalX( -ang );
-			if( i::keys[SDLK_LEFT] ) mover->rotateLocalY( ang );
-			if( i::keys[SDLK_RIGHT] ) mover->rotateLocalY( -ang );
+			if( I::keys[SDLK_UP] ) mover->rotateLocalX( ang );
+			if( I::keys[SDLK_DOWN] ) mover->rotateLocalX( -ang );
+			if( I::keys[SDLK_LEFT] ) mover->rotateLocalY( ang );
+			if( I::keys[SDLK_RIGHT] ) mover->rotateLocalY( -ang );
 		}
 		else
 		{
 			float accel = 44.0;
-			mover->rotateLocalX( ang * i::mouse_velocity.y * accel );
-			mover->rotateLocalY( -ang * i::mouse_velocity.x * accel );
+			mover->rotateLocalX( ang * I::mouseVelocity.y * accel );
+			mover->rotateLocalY( -ang * I::mouseVelocity.x * accel );
 		}
-		if( i::keys[SDLK_q] ) mover->rotateLocalZ( ang );
-		if( i::keys[SDLK_e] ) mover->rotateLocalZ( -ang );
-		if( i::keys[SDLK_PAGEUP] ) mover->scaleLspace += scale ;
-		if( i::keys[SDLK_PAGEDOWN] ) mover->scaleLspace -= scale ;
+		if( I::keys[SDLK_q] ) mover->rotateLocalZ( ang );
+		if( I::keys[SDLK_e] ) mover->rotateLocalZ( -ang );
+		if( I::keys[SDLK_PAGEUP] ) mover->scaleLspace += scale ;
+		if( I::keys[SDLK_PAGEDOWN] ) mover->scaleLspace -= scale ;
 
-		if( i::keys[SDLK_k] ) main_cam->lookAtPoint( point_lights[0]->translationWspace );
+		if( I::keys[SDLK_k] ) mainCam->lookAtPoint( point_lights[0]->translationWspace );
 
 		mover->rotationLspace.reorthogonalize();
 
 
-		scene::updateAllControllers();
-		scene::updateAllWorldStuff();
+		Scene::updateAllControllers();
+		Scene::updateAllWorldStuff();
 
 		dynamicsWorld->stepSimulation( 1 );
 
-		r::Render( *main_cam );
+		r::Render( *mainCam );
 
 		//map.octree.root->bounding_box.render();
 
 		// print some debug stuff
-		ui::SetColor( Vec4(1.0, 1.0, 1.0, 1.0) );
-		ui::SetPos( -0.98, 0.95 );
-		ui::SetFontWidth( 0.03 );
-		ui::printf( "frame:%d time:%dms\n", r::frames_num, app::getTicks()-ticks_ );
-		//ui::print( "Movement keys: arrows,w,a,s,d,q,e,shift,space\nSelect objects: keys 1 to 5\n" );
-		ui::printf( "Mover: Pos(%.2f %.2f %.2f) Angs(%.2f %.2f %.2f)", mover->translationWspace.x, mover->translationWspace.y, mover->translationWspace.z,
+		Ui::setColor( Vec4(1.0, 1.0, 1.0, 1.0) );
+		Ui::setPos( -0.98, 0.95 );
+		Ui::setFontWidth( 0.03 );
+		Ui::printf( "frame:%d time:%dms\n", r::frames_num, App::getTicks()-ticks_ );
+		//Ui::print( "Movement keys: arrows,w,a,s,d,q,e,shift,space\nSelect objects: keys 1 to 5\n" );
+		Ui::printf( "Mover: Pos(%.2f %.2f %.2f) Angs(%.2f %.2f %.2f)", mover->translationWspace.x, mover->translationWspace.y, mover->translationWspace.z,
 								 toDegrees(Euler(mover->rotationWspace).x), toDegrees(Euler(mover->rotationWspace).y), toDegrees(Euler(mover->rotationWspace).z) );
 
-		if( i::keys[SDLK_ESCAPE] ) break;
-		if( i::keys[SDLK_F11] ) app::togleFullScreen();
-		if( i::keys[SDLK_F12] == 1 ) r::TakeScreenshot("gfx/screenshot.jpg");
+		if( I::keys[SDLK_ESCAPE] ) break;
+		if( I::keys[SDLK_F11] ) App::togleFullScreen();
+		if( I::keys[SDLK_F12] == 1 ) r::TakeScreenshot("gfx/screenshot.jpg");
 
 		/*char str[128];
 		if( r::frames_num < 1000 )
@@ -341,15 +341,15 @@ int main( int /*argc*/, char* /*argv*/[] )
 		if( 1 )
 		{
 			//if( r::frames_num == 10 ) r::TakeScreenshot("gfx/screenshot.tga");
-			app::waitForNextFrame();
+			App::waitForNextFrame();
 		}
 		else
 			if( r::frames_num == 5000 ) break;
 	}while( true );
-	PRINT( "Exiting main loop (" << app::getTicks()-ticks << ")" );
+	PRINT( "Exiting main loop (" << App::getTicks()-ticks << ")" );
 
 
 	PRINT( "Exiting..." );
-	app::quitApp( EXIT_SUCCESS );
+	App::quitApp( EXIT_SUCCESS );
 	return 0;
 }

+ 1 - 1
src/math/Axisang.h

@@ -1,7 +1,7 @@
 #ifndef _AXISANG_H_
 #define _AXISANG_H_
 
-#include "common.h"
+#include "Common.h"
 #include "MathForwardDecls.h"
 
 

+ 1 - 1
src/math/Euler.h

@@ -1,7 +1,7 @@
 #ifndef _EULER_H_
 #define _EULER_H_
 
-#include "common.h"
+#include "Common.h"
 #include "MathForwardDecls.h"
 
 

+ 1 - 1
src/math/Mat3.h

@@ -1,7 +1,7 @@
 #ifndef _MAT3_H_
 #define _MAT3_H_
 
-#include "common.h"
+#include "Common.h"
 #include "MathForwardDecls.h"
 
 

+ 1 - 1
src/math/Mat4.h

@@ -1,7 +1,7 @@
 #ifndef _MAT4_H_
 #define _MAT4_H_
 
-#include "common.h"
+#include "Common.h"
 #include "MathForwardDecls.h"
 
 

+ 1 - 1
src/math/MathFuncs.h

@@ -1,7 +1,7 @@
 #ifndef _MATHFUNCS_H_
 #define _MATHFUNCS_H_
 
-#include "common.h"
+#include "Common.h"
 #include "MathForwardDecls.h"
 
 

+ 1 - 1
src/math/MathFuncs.inl.h

@@ -111,7 +111,7 @@ inline void sinCos( float a, float& sina, float& cosa )
 //=====================================================================================================================================
 // Small funcs                                                                                                                        =
 //=====================================================================================================================================
-inline float sqrt( float f ) { PRINT("LALA") return 1/invSqrt(f); }
+inline float sqrt( float f ) { return 1/invSqrt(f); }
 inline float toRad( float degrees ) { return degrees*(PI/180.0); }
 inline float toDegrees( float rad ) { return rad*(180.0/PI); }
 inline float sin( float rad ) { return ::sin(rad); }

+ 1 - 1
src/math/Quat.h

@@ -1,7 +1,7 @@
 #ifndef _QUAT_H_
 #define _QUAT_H_
 
-#include "common.h"
+#include "Common.h"
 #include "MathForwardDecls.h"
 
 

+ 1 - 1
src/math/Vec2.h

@@ -1,7 +1,7 @@
 #ifndef _VEC2_H_
 #define _VEC2_H_
 
-#include "common.h"
+#include "Common.h"
 #include "MathForwardDecls.h"
 
 

+ 1 - 1
src/math/Vec3.h

@@ -1,7 +1,7 @@
 #ifndef _VEC3_H_
 #define _VEC3_H_
 
-#include "common.h"
+#include "Common.h"
 #include "MathForwardDecls.h"
 
 

+ 1 - 1
src/math/Vec4.h

@@ -1,7 +1,7 @@
 #ifndef _VEC4_H_
 #define _VEC4_H_
 
-#include "common.h"
+#include "Common.h"
 #include "MathForwardDecls.h"
 
 

+ 1 - 1
src/renderer/BulletDebuger.h

@@ -1,7 +1,7 @@
 #ifndef _BULLETDEBUGER_H_
 #define _BULLETDEBUGER_H_
 
-#include "common.h"
+#include "Common.h"
 #include <LinearMath/btIDebugDraw.h>
 
 

+ 1 - 1
src/renderer/fbo.h

@@ -1,7 +1,7 @@
 #ifndef _FBO_H_
 #define _FBO_H_
 
-#include "common.h"
+#include "Common.h"
 #include "renderer.h"
 
 

+ 2 - 2
src/renderer/r_bs.cpp

@@ -63,9 +63,9 @@ void RunStage( const Camera& cam )
 
 
 	// render the meshes
-	for( uint i=0; i<scene::meshNodes.size(); i++ )
+	for( uint i=0; i<Scene::meshNodes.size(); i++ )
 	{
-		MeshNode* mesh_node = scene::meshNodes[i];
+		MeshNode* mesh_node = Scene::meshNodes[i];
 		if( mesh_node->material->blends && !mesh_node->material->blends )
 		{
 			fbo.Bind();

+ 2 - 2
src/renderer/r_bs2.cpp

@@ -87,9 +87,9 @@ void RunStage2( const Camera& cam )
 
 
 	// render the meshes
-	for( uint i=0; i<scene::meshNodes.size(); i++ )
+	for( uint i=0; i<Scene::meshNodes.size(); i++ )
 	{
-		MeshNode* mesh_node = scene::meshNodes[i];
+		MeshNode* mesh_node = Scene::meshNodes[i];
 		if( mesh_node->material->refracts )
 		{
 			// write to the rFbo

+ 9 - 9
src/renderer/r_dbg.cpp

@@ -171,19 +171,19 @@ void RunStage( const Camera& cam )
 	glDisable( GL_BLEND );
 
 	//r::RenderGrid();
-	for( uint i=0; i<scene::nodes.size(); i++ )
+	for( uint i=0; i<Scene::nodes.size(); i++ )
 	{
 		if
 		(
-			(scene::nodes[i]->type == Node::NT_LIGHT && show_lights) ||
-			(scene::nodes[i]->type == Node::NT_CAMERA && show_cameras)
+			(Scene::nodes[i]->type == Node::NT_LIGHT && show_lights) ||
+			(Scene::nodes[i]->type == Node::NT_CAMERA && show_cameras)
 		)
 		{
-			scene::nodes[i]->render();
+			Scene::nodes[i]->render();
 		}
-		else if( scene::nodes[i]->type == Node::NT_SKELETON && show_skeletons )
+		else if( Scene::nodes[i]->type == Node::NT_SKELETON && show_skeletons )
 		{
-			SkelNode* skel_node = static_cast<SkelNode*>( scene::nodes[i] );
+			SkelNode* skel_node = static_cast<SkelNode*>( Scene::nodes[i] );
 			glDisable( GL_DEPTH_TEST );
 			skel_node->render();
 			glEnable( GL_DEPTH_TEST );
@@ -403,7 +403,7 @@ static void RenderSun()
 {
 	glPushMatrix();
 
-	r::MultMatrix( Mat4( scene::SunPos(), Mat3::getIdentity(), 50.0 ) );
+	r::MultMatrix( Mat4( Scene::getSunPos(), Mat3::getIdentity(), 50.0 ) );
 
 	r::Color3( Vec3(1.0, 1.0, 0.0) );
 	r::dbg::RenderSphere( 1.0/8.0, 8 );
@@ -421,8 +421,8 @@ static void RenderSun()
 	glLoadIdentity();
 
 
-	Vec4 p = Vec4( scene::SunPos(), 1.0 );
-	p = main_cam->getProjectionMatrix() * (main_cam->getViewMatrix() * p);
+	Vec4 p = Vec4( Scene::getSunPos(), 1.0 );
+	p = mainCam->getProjectionMatrix() * (mainCam->getViewMatrix() * p);
 	p /= p.w;
 	p = p/2 + 0.5;
 

+ 5 - 5
src/renderer/r_is.cpp

@@ -24,7 +24,7 @@ VARS
 */
 static fbo_t fbo;
 
-Texture fai;  // illuminated scene
+Texture fai;  // illuminated Scene
 
 static uint stencil_rb; // framebuffer render buffer for stencil optimizations
 
@@ -401,7 +401,7 @@ static void SpotLightPass( const Camera& cam, const SpotLight& light )
 	shdr->locTexUnit( shdr->GetUniLoc(3), r::ms::depth_fai, 3 );
 
 	if( light.lightProps->getTexture() == NULL )
-		ERROR( "No texture is attached to the light. light_props name: " << light.lightProps->getName() );
+		ERROR( "No texture is attached to the light. light_props name: " << light.lightProps->getRsrcName() );
 
 	// the planes
 	//glUniform2fv( shdr->getUniLoc("planes"), 1, &planes[0] );
@@ -486,7 +486,7 @@ void RunStage( const Camera& cam )
 	glDisable( GL_DEPTH_TEST );
 
 	// ambient pass
-	AmbientPass( cam, scene::GetAmbientColor() );
+	AmbientPass( cam, Scene::getAmbientColor() );
 
 	// light passes
 	glEnable( GL_BLEND );
@@ -496,9 +496,9 @@ void RunStage( const Camera& cam )
 	CalcPlanes( cam );
 
 	// for all lights
-	for( uint i=0; i<scene::lights.size(); i++ )
+	for( uint i=0; i<Scene::lights.size(); i++ )
 	{
-		const Light& light = *scene::lights[i];
+		const Light& light = *Scene::lights[i];
 		switch( light.type )
 		{
 			case Light::LT_POINT:

+ 3 - 3
src/renderer/r_is_shadows.cpp

@@ -73,7 +73,7 @@ void Init()
 /*
 =======================================================================================================================================
 RunPass                                                                                                                               =
-render scene only with depth and store the result in the shadow map                                                                   =
+render Scene only with depth and store the result in the shadow map                                                                   =
 =======================================================================================================================================
 */
 void RunPass( const Camera& cam )
@@ -102,9 +102,9 @@ void RunPass( const Camera& cam )
 	glEnable( GL_POLYGON_OFFSET_FILL );
 
 	// render all meshes
-	for( uint i=0; i<scene::meshNodes.size(); i++ )
+	for( uint i=0; i<Scene::meshNodes.size(); i++ )
 	{
-		MeshNode* mesh_node = scene::meshNodes[i];
+		MeshNode* mesh_node = Scene::meshNodes[i];
 		if( mesh_node->material->blends || mesh_node->material->refracts ) continue;
 
 		DEBUG_ERR( mesh_node->material->dp_mtl == NULL );

+ 3 - 3
src/renderer/r_ms.cpp

@@ -94,7 +94,7 @@ void RunStage( const Camera& cam )
 	r::SetViewport( 0, 0, r::w, r::h );
 
 	//glEnable( GL_DEPTH_TEST );
-	scene::skybox.Render( cam.getViewMatrix().getRotationPart() );
+	Scene::skybox.Render( cam.getViewMatrix().getRotationPart() );
 	//glDepthFunc( GL_LEQUAL );
 
 	#if defined( _EARLY_Z_ )
@@ -103,9 +103,9 @@ void RunStage( const Camera& cam )
 	#endif
 
 	// render the meshes
-	for( uint i=0; i<scene::meshNodes.size(); i++ )
+	for( uint i=0; i<Scene::meshNodes.size(); i++ )
 	{
-		MeshNode* mesh_node = scene::meshNodes[i];
+		MeshNode* mesh_node = Scene::meshNodes[i];
 		DEBUG_ERR( mesh_node->material == NULL );
 		if( mesh_node->material->blends || mesh_node->material->refracts ) continue;
 		mesh_node->material->setup();

+ 4 - 4
src/renderer/r_ms_earlyz.cpp

@@ -78,12 +78,12 @@ void RunPass( const Camera& cam )
 
 
 	// render all meshes
-	for( uint i=0; i<scene::meshes.size(); i++ )
-		renderDepth<Mesh>( *scene::meshes[i], shdr_dp, shdr_dp_grass );
+	for( uint i=0; i<Scene::meshes.size(); i++ )
+		renderDepth<Mesh>( *Scene::meshes[i], shdr_dp, shdr_dp_grass );
 
 	// render all smodels
-	for( uint i=0; i<scene::models.size(); i++ )
-		renderDepth<model_t>( *scene::models[i], shdr_dp, shdr_dp_grass );
+	for( uint i=0; i<Scene::models.size(); i++ )
+		renderDepth<model_t>( *Scene::models[i], shdr_dp, shdr_dp_grass );
 
 	glColorMask( true, true, true, true );
 

+ 1 - 1
src/renderer/r_pps_lscatt.cpp

@@ -89,7 +89,7 @@ void RunPass( const Camera& cam )
 	shdr->locTexUnit( is_fai_uni_loc, r::is::fai, 1 );
 
 	// pass the light
-	Vec4 p = Vec4( scene::SunPos(), 1.0 );
+	Vec4 p = Vec4( Scene::getSunPos(), 1.0 );
 	p = cam.getProjectionMatrix() * (cam.getViewMatrix() * p);
 	p /= p.w;
 	p = p/2 + 0.5;

+ 1 - 1
src/renderer/r_private.h

@@ -31,7 +31,7 @@ namespace ms
 	namespace earlyz
 	{
 		extern void init(); ///< Inits the the earlyz FBO with r::ms::depth_fai
-		extern void RunPass( const Camera& cam ); ///< Renders the scene's depth in the r::ms:depth_fai
+		extern void RunPass( const Camera& cam ); ///< Renders the Scene's depth in the r::ms:depth_fai
 	}
 #endif
 }

+ 5 - 5
src/renderer/renderer.cpp

@@ -6,7 +6,7 @@
 #include "Scene.h"
 #include "r_private.h"
 #include "Camera.h"
-#include "app.h"
+#include "App.h"
 
 namespace r {
 
@@ -129,8 +129,8 @@ void Init()
 	if( !glewIsSupported("GL_ARB_vertex_buffer_object") )
 		WARNING( "Vertex Buffer Objects not supported. The application may crash (and burn)" );
 
-	w = app::windowW /* * rendering_quality*/;
-	h = app::windowH /* * rendering_quality*/;
+	w = App::windowW /* * rendering_quality*/;
+	h = App::windowH /* * rendering_quality*/;
 	aspect_ratio = float(w)/h;
 
 	glClearColor( 0.1, 0.1, 0.1, 0.0 );
@@ -195,8 +195,8 @@ void Render( const Camera& cam )
 	r::bs::RunStage2( cam );
 	r::dbg::RunStage( cam );
 
-	//r::SetViewport( 0, 0, app::windowW, app::windowH );
-	r::SetViewport( 0, 0, app::windowW, app::windowH );
+	//r::SetViewport( 0, 0, App::windowW, App::windowH );
+	r::SetViewport( 0, 0, App::windowW, App::windowH );
 
 	glDisable( GL_DEPTH_TEST );
 	glDisable( GL_BLEND );

+ 1 - 1
src/renderer/renderer.h

@@ -1,7 +1,7 @@
 #ifndef _RENDERER_H_
 #define _RENDERER_H_
 
-#include "common.h"
+#include "Common.h"
 #include <GL/glew.h>
 #include <GL/gl.h>
 #include <GL/glu.h>

+ 1 - 1
src/renderer/vbo.h

@@ -3,7 +3,7 @@
 
 #include <GL/glew.h>
 #include <GL/gl.h>
-#include "common.h"
+#include "Common.h"
 
 /// This is a wrapper for Vertex Buffer Objects to prevent us from making idiotic errors
 class vbo_t

+ 1 - 1
src/renderer2/r_is.cpp

@@ -103,7 +103,7 @@ void renderer_t::illumination_stage_t::ambient_pass_t::Run() const
 	shaderProg.bind();
 
 	// set the uniforms
-	glUniform3fv( shaderProg.getUniLoc(0), 1, &((Vec3)scene::GetAmbientColor())[0] );
+	glUniform3fv( shaderProg.getUniLoc(0), 1, &((Vec3)Scene::getAmbientColor())[0] );
 	shaderProg.locTexUnit( shaderProg.getUniLoc(1), renderer.ms.fais.diffuse, 0 );
 
 	// Draw quad

+ 5 - 5
src/renderer2/r_ms.cpp

@@ -55,17 +55,17 @@ void renderer_t::material_stage_t::Run() const
 	renderer.SetViewport( 0, 0, renderer.width, renderer.height );
 
 	//glEnable( GL_DEPTH_TEST );
-	scene::skybox.render( renderer.camera->getViewMatrix().getRotationPart() );
+	Scene::skybox.render( renderer.camera->getViewMatrix().getRotationPart() );
 	//glDepthFunc( GL_LEQUAL );
 
 
 	// render the meshes
-	for( uint i=0; i<scene::meshes.size(); i++ )
-		render<Mesh, false>( scene::meshes[i] );
+	for( uint i=0; i<Scene::meshes.size(); i++ )
+		render<Mesh, false>( Scene::meshes[i] );
 
 	// render the smodels
-	for( uint i=0; i<scene::smodels.size(); i++ )
-		render<smodel_t, false>( scene::smodels[i] );
+	for( uint i=0; i<Scene::smodels.size(); i++ )
+		render<smodel_t, false>( Scene::smodels[i] );
 
 	glPolygonMode( GL_FRONT, GL_FILL ); // the rendering above fucks the polygon mode
 

+ 1 - 1
src/resources/Extension.h

@@ -1,7 +1,7 @@
 #ifndef _EXTENSION_H_
 #define _EXTENSION_H_
 
-#include "common.h"
+#include "Common.h"
 #include "Resource.h"
 
 

+ 1 - 1
src/resources/LightProps.h

@@ -1,7 +1,7 @@
 #ifndef _LIGHTPROPS_H_
 #define _LIGHTPROPS_H_
 
-#include "common.h"
+#include "Common.h"
 #include "Resource.h"
 #include "Math.h"
 

+ 2 - 2
src/resources/Material.cpp

@@ -8,7 +8,7 @@
 #include "renderer.h"
 
 
-#define MTL_ERROR( x ) ERROR( "Material (" << getPath() << getName() << "): " << x );
+#define MTL_ERROR( x ) ERROR( "Material (" << getRsrcPath() << getRsrcName() << "): " << x );
 
 
 /*
@@ -357,7 +357,7 @@ bool Material::additionalInit()
 		int loc = shaderProg->getUniLoc( userDefinedVars[i].name.c_str() );
 		if( loc == -1 )
 		{
-			MTL_ERROR( "Shader \"" << shaderProg->getName() << "\" and user defined var \"" << userDefinedVars[i].name <<
+			MTL_ERROR( "Shader \"" << shaderProg->getRsrcName() << "\" and user defined var \"" << userDefinedVars[i].name <<
 			           "\" do not combine. Incorrect location" );
 			return false;
 		}

+ 1 - 1
src/resources/Material.h

@@ -1,7 +1,7 @@
 #ifndef _MATERIAL_H_
 #define _MATERIAL_H_
 
-#include "common.h"
+#include "Common.h"
 #include "Math.h"
 #include "Resource.h"
 

+ 1 - 1
src/resources/Mesh.h

@@ -1,7 +1,7 @@
 #ifndef _MESH_H_
 #define _MESH_H_
 
-#include "common.h"
+#include "Common.h"
 #include "Math.h"
 #include "vbo.h"
 #include "Resource.h"

+ 1 - 1
src/resources/Path.h

@@ -1,7 +1,7 @@
 #ifndef _PATH_H_
 #define _PATH_H_
 
-#include "common.h"
+#include "Common.h"
 #include "Resource.h"
 #include "Math.h"
 

+ 2 - 2
src/resources/Resource.cpp

@@ -20,7 +20,7 @@ Container<ShaderProg> shaders;
 Container<Material>    materials;
 Container<Mesh>        meshes;
 Container<Skeleton>    skeletons;
-Container<SkelAnim>   skel_anims;
-Container<LightProps> light_props;
+Container<SkelAnim>   skelAnims;
+Container<LightProps> lightProps;
 
 } // end namespace

+ 10 - 11
src/resources/Resource.h

@@ -1,8 +1,7 @@
 #ifndef _RESOURCE_H_
 #define _RESOURCE_H_
 
-#include "common.h"
-#include "engine_class.h"
+#include "Common.h"
 #include "Util.h"
 
 
@@ -27,9 +26,9 @@ template< typename Type > class Container;
  */
 class Resource
 {
-	PROPERTY_R( string, path, getPath );
-	PROPERTY_R( string, name, getName );
-	PROPERTY_R( uint, usersNum, getUsersNum );
+	PROPERTY_R( string, path, getRsrcPath );
+	PROPERTY_R( string, name, getRsrcName );
+	PROPERTY_R( uint, usersNum, getRsrcUsersNum );
 
 	// friends
 	friend class rsrc::Container<Texture>;
@@ -54,13 +53,13 @@ class Resource
 namespace rsrc {
 
 
-extern Container<Texture>     textures;
+extern Container<Texture>    textures;
 extern Container<ShaderProg> shaders;
-extern Container<Material>    materials;
-extern Container<Mesh>        meshes;
-extern Container<Skeleton>    skeletons;
-extern Container<SkelAnim>   skel_anims;
-extern Container<LightProps> light_props;
+extern Container<Material>   materials;
+extern Container<Mesh>       meshes;
+extern Container<Skeleton>   skeletons;
+extern Container<SkelAnim>   skelAnims;
+extern Container<LightProps> lightProps;
 
 
 /// resource container template class

+ 1 - 1
src/resources/ShaderParser.h

@@ -2,7 +2,7 @@
 #define _SHADERPARSER_H_
 
 #include <limits>
-#include "common.h"
+#include "Common.h"
 
 
 /**

+ 3 - 3
src/resources/ShaderProg.cpp

@@ -4,8 +4,8 @@
 #include "Texture.h"
 
 
-#define SHADER_ERROR( x ) ERROR( "Shader (" << getName() << "): " << x )
-#define SHADER_WARNING( x ) WARNING( "Shader (" << getName() << "): " << x )
+#define SHADER_ERROR( x ) ERROR( "Shader (" << getRsrcName() << "): " << x )
+#define SHADER_WARNING( x ) WARNING( "Shader (" << getRsrcName() << "): " << x )
 
 
 
@@ -224,7 +224,7 @@ bool ShaderProg::load( const char* filename )
 //=====================================================================================================================================
 bool ShaderProg::customload( const char* filename, const char* extra_source )
 {
-	if( getName().length() == 0 )
+	if( getRsrcName().length() == 0 )
 	{
 		name = Util::cutPath( filename );
 		path = Util::getPath( filename );

+ 1 - 1
src/resources/ShaderProg.h

@@ -3,7 +3,7 @@
 
 #include <GL/glew.h>
 #include <map>
-#include "common.h"
+#include "Common.h"
 #include "Resource.h"
 
 class ShaderParser;

+ 1 - 1
src/resources/SkelAnim.h

@@ -1,7 +1,7 @@
 #ifndef _SKEL_ANIM_H_
 #define _SKEL_ANIM_H_
 
-#include "common.h"
+#include "Common.h"
 #include "Resource.h"
 #include "Math.h"
 

+ 2 - 2
src/resources/Skeleton.cpp

@@ -35,7 +35,7 @@ bool Skeleton::load( const char* filename )
 			PARSE_ERR_EXPECTED( "string" );
 			return false;
 		}
-		bone.SetName( token->value.string );
+		bone.setName( token->value.string );
 
 		// head
 		if( !ParseArrOfNumbers<float>( scanner, false, true, 3, &bone.head[0] ) ) return false;
@@ -77,7 +77,7 @@ bool Skeleton::load( const char* filename )
 		}
 		if( token->value.int_ > Bone::MAX_CHILDS_PER_BONE )
 		{
-			ERROR( "Childs for bone \"" << bone.GetName() << "\" exceed the max" );
+			ERROR( "Childs for bone \"" << bone.getName() << "\" exceed the max" );
 			return false;
 		}
 		bone.childsNum = token->value.int_;

+ 4 - 3
src/resources/Skeleton.h

@@ -1,10 +1,9 @@
 #ifndef _SKELETON_H_
 #define _SKELETON_H_
 
-#include "common.h"
+#include "Common.h"
 #include "Math.h"
 #include "Resource.h"
-#include "engine_class.h"
 
 
 /// Skeleton
@@ -12,8 +11,10 @@ class Skeleton: public Resource
 {
 	public:
 		/// Bone
-		class Bone: public nc_t
+		class Bone
 		{
+			PROPERTY_RW( string, name, setName, getName )
+
 			public:
 				static const uint MAX_CHILDS_PER_BONE = 4; ///< Please dont change this
 				ushort  id; ///< pos inside the Skeleton::bones vector

+ 1 - 1
src/resources/Texture.h

@@ -4,7 +4,7 @@
 #include <GL/glew.h>
 #include <GL/gl.h>
 #include <limits>
-#include "common.h"
+#include "Common.h"
 #include "Resource.h"
 
 

+ 1 - 1
src/scene/Camera.cpp

@@ -61,7 +61,7 @@ void Camera::render()
 
 	glPopMatrix();
 
-//	if( !strcmp( camera_data_user_class_t::GetName(), "main_cam") ) return;
+//	if( !strcmp( camera_data_user_class_t::getName(), "mainCam") ) return;
 //	//for( uint i=0; i<2; i++ )
 //		wspaceFrustumPlanes[TOP].render();
 }

+ 1 - 1
src/scene/Camera.h

@@ -1,7 +1,7 @@
 #ifndef _CAMERA_H_
 #define _CAMERA_H_
 
-#include "common.h"
+#include "Common.h"
 #include "collision.h"
 #include "Node.h"
 

+ 4 - 4
src/scene/Light.cpp

@@ -9,7 +9,7 @@
 //=====================================================================================================================================
 void PointLight::init( const char* filename )
 {
-	lightProps = rsrc::light_props.load( filename );
+	lightProps = rsrc::lightProps.load( filename );
 	radius = lightProps->getRadius();
 }
 
@@ -19,12 +19,12 @@ void PointLight::init( const char* filename )
 //=====================================================================================================================================
 void SpotLight::init( const char* filename )
 {
-	lightProps = rsrc::light_props.load( filename );
+	lightProps = rsrc::lightProps.load( filename );
 	camera.setAll( lightProps->getFovX(), lightProps->getFovY(), 0.2, lightProps->getDistance() );
 	castsShadow = lightProps->castsShadow();
 	if( lightProps->getTexture() == NULL )
 	{
-		ERROR( "Light properties \"" << lightProps->getName() << "\" do not have a texture" );
+		ERROR( "Light properties \"" << lightProps->getRsrcName() << "\" do not have a texture" );
 		return;
 	}
 }
@@ -35,7 +35,7 @@ void SpotLight::init( const char* filename )
 //=====================================================================================================================================
 void Light::deinit()
 {
-	rsrc::light_props.unload( lightProps );
+	rsrc::lightProps.unload( lightProps );
 }
 
 

+ 1 - 1
src/scene/Light.h

@@ -17,7 +17,7 @@ Specular intensity of material: Sm
 #ifndef _LIGHT_H_
 #define _LIGHT_H_
 
-#include "common.h"
+#include "Common.h"
 #include "Texture.h"
 #include "Node.h"
 #include "Camera.h"

+ 1 - 1
src/scene/MeshNode.h

@@ -1,7 +1,7 @@
 #ifndef _MESH_NODE_H_
 #define _MESH_NODE_H_
 
-#include "common.h"
+#include "Common.h"
 #include "Node.h"
 #include "Material.h"
 

+ 2 - 2
src/scene/Node.cpp

@@ -5,7 +5,7 @@
 #include "Controller.h"
 
 
-namespace scene
+namespace Scene
 {
 	extern void registerNode( Node* );
 }
@@ -26,7 +26,7 @@ void Node::commonConstructorCode()
 	rotationWspace = Mat3::getIdentity();
 	bvolumeLspace = NULL;
 
-	scene::registerNode( this );
+	Scene::registerNode( this );
 }
 
 

+ 1 - 1
src/scene/Node.h

@@ -2,7 +2,7 @@
 #define _NODE_H_
 
 #include <memory>
-#include "common.h"
+#include "Common.h"
 #include "Math.h"
 
 

+ 1 - 1
src/scene/Scene.cpp

@@ -7,7 +7,7 @@
 #include "Controller.h"
 #include "Material.h"
 
-namespace scene {
+namespace Scene {
 
 /*
 =======================================================================================================================================

+ 4 - 4
src/scene/Scene.h

@@ -1,7 +1,7 @@
 #ifndef _SCENE_H_
 #define _SCENE_H_
 
-#include "common.h"
+#include "Common.h"
 #include "skybox.h"
 
 
@@ -13,12 +13,12 @@ class SkelNode;
 class Controller;
 
 
-namespace scene {
+namespace Scene {
 
 // misc
 extern skybox_t skybox;
-inline Vec3 GetAmbientColor() { return Vec3( 0.1, 0.05, 0.05 )*1; }
-inline Vec3 SunPos() { return Vec3( 0.0, 1.0, -1.0 ) * 50.0; }
+inline Vec3 getAmbientColor() { return Vec3( 0.1, 0.05, 0.05 )*1; }
+inline Vec3 getSunPos() { return Vec3( 0.0, 1.0, -1.0 ) * 50.0; }
 
 // funcs
 extern void registerNode( Node* node );

+ 2 - 2
src/scene/SkelModelNode.h

@@ -1,7 +1,7 @@
 #ifndef _SKEL_MODEL_NODE_H_
 #define _SKEL_MODEL_NODE_H_
 
-#include "common.h"
+#include "Common.h"
 #include "MeshNode.h" 
 
 
@@ -10,7 +10,7 @@ class SkelNode;
 
 
 /** 
- * Skeleton model scene node
+ * Skeleton model Scene node
  * It is just a group node with a derived init
  */
 class skelModelNode: public Node

+ 1 - 1
src/scene/SkelNode.h

@@ -1,7 +1,7 @@
 #ifndef _SKEL_NODE_H_
 #define _SKEL_NODE_H_
 
-#include "common.h"
+#include "Common.h"
 #include "Node.h"
 #include "Controller.h"
 #include "Math.h"

+ 1 - 1
src/tokenizer/Scanner.h

@@ -2,7 +2,7 @@
 #define _SCANNER_H_
 
 #include <sstream>
-#include "common.h"
+#include "Common.h"
 
 
 //=====================================================================================================================================

+ 1 - 1
src/tokenizer/parser.h

@@ -1,7 +1,7 @@
 #ifndef _PARSER_H_
 #define _PARSER_H_
 
-#include "common.h"
+#include "Common.h"
 #include "Scanner.h"
 
 /*

+ 12 - 12
src/ui/ui.cpp → src/ui/Ui.cpp

@@ -1,11 +1,11 @@
 #include <stdio.h>
 #include <stdarg.h>
-#include "ui.h"
+#include "Ui.h"
 #include "renderer.h"
 #include "Texture.h"
 #include "Resource.h"
 
-namespace ui {
+namespace Ui {
 
 
 /*
@@ -157,22 +157,22 @@ non static funcs
 
 // init
 // exec after init SDL
-void Init()
+void init()
 {
 	font_map = rsrc::textures.load( "gfx/fontmapa.tga" );
 	font_map->texParameter( GL_TEXTURE_MIN_FILTER, GL_LINEAR );
 	//font_map->texParameter( GL_TEXTURE_MAG_FILTER, GL_NEAREST );
 	shader = rsrc::shaders.load( "shaders/txt.glsl" );
-	SetPos( 0.0f, 0.0f );
-	SetFontWidth( 0.05f );
-	SetColor( Vec4(1.0f, 1.0f, 1.0f, 1.0f) );
+	setPos( 0.0f, 0.0f );
+	setFontWidth( 0.05f );
+	setColor( Vec4(1.0f, 1.0f, 1.0f, 1.0f) );
 	italic = false;
 }
 
 
-// SetFontWidth
+// setFontWidth
 // sets font width from the given param and the height fron the aspect ratio
-void SetFontWidth( float w_ )
+void setFontWidth( float w_ )
 {
 	// width
 	font_w = w_;
@@ -181,15 +181,15 @@ void SetFontWidth( float w_ )
 }
 
 
-// SetColor
-void SetColor( const Vec4& color_ )
+// setColor
+void setColor( const Vec4& color_ )
 {
 	for( int i=0; i<4; i++ )
 		color[i] = color_[i];
 }
 
-// SetPos
-void SetPos( float x_, float y_ )
+// setPos
+void setPos( float x_, float y_ )
 {
 	initial_x = crnt_x = x_;
 	crnt_y = y_;

+ 22 - 0
src/ui/Ui.h

@@ -0,0 +1,22 @@
+#ifndef _UI_H_
+#define _UI_H_
+
+#include "Common.h"
+
+namespace M {
+	class Vec4;
+}
+
+namespace Ui { // begin namespace
+
+
+extern void init(); // exec after init SDL
+extern void setColor( const M::Vec4& color );
+extern void setPos( float x_, float y_ );
+extern void setFontWidth( float w_ );
+extern void printf( const char* format, ... );
+extern void print( const char* str );
+
+
+} // end namespace
+#endif

+ 0 - 22
src/ui/ui.h

@@ -1,22 +0,0 @@
-#ifndef _UI_H_
-#define _UI_H_
-
-#include "common.h"
-
-namespace M {
-	class Vec4;
-}
-
-namespace ui { // begin namespace
-
-
-extern void Init(); // exec after init SDL
-extern void SetColor( const M::Vec4& color );
-extern void SetPos( float x_, float y_ );
-extern void SetFontWidth( float w_ );
-extern void printf( const char* format, ... );
-extern void print( const char* str );
-
-
-} // end namespace
-#endif

+ 1 - 1
src/uncategorized/collision.h

@@ -9,7 +9,7 @@ The normal shows the direction we have to move bvolume2 in order to seperate the
 move bvolume2 for the seperation. The impact_point is a point between inside the collision area.
 */
 
-#include "common.h"
+#include "Common.h"
 #include "Math.h"
 
 class lineseg_t;

+ 0 - 30
src/uncategorized/engine_class.cpp

@@ -1,30 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <cstring>
-#include "engine_class.h"
-
-char nc_t::unamed[] = "unamed";
-
-// nc_t
-nc_t::nc_t()
-{
-	name = unamed; // the default value of name
-}
-
-// ~nc_t
-nc_t::~nc_t()
-{
-	if( name != unamed ) free(name);
-}
-
-// SetName
-void nc_t::SetName( const char* name_ )
-{
-	if( name != unamed ) free(name);
-
-	name = (char*)malloc( (strlen(name_) + 1) * sizeof(char) );
-	strcpy( name, name_ );
-
-	if( strlen(name) > 30 )
-		WARNING( "Big name for: \"" << name << '\"' );
-}

+ 0 - 29
src/uncategorized/engine_class.h

@@ -1,29 +0,0 @@
-#ifndef _ENGINE_CLASS_H_
-#define _ENGINE_CLASS_H_
-
-#include "common.h"
-
-// nc_t
-/// class with name
-class nc_t
-{
-	protected:
-		char* name;
-		static char unamed[]; ///< The default string that the nc_t::name takes
-
-	public:
-		 nc_t();
-		~nc_t();
-
-		void SetName( const char* name_ );
-		const char* GetName() const { return name; }
-};
-
-
-// data_user_class_t
-class data_user_class_t: public nc_t
-{};
-
-
-
-#endif

+ 0 - 30
src/uncategorized/input.h

@@ -1,30 +0,0 @@
-#ifndef _INPUT_H_
-#define _INPUT_H_
-
-#include <SDL/SDL.h>
-#include "common.h"
-#include "app.h"
-#include "Math.h"
-
-/// input namespace
-namespace i {
-
-
-extern void Reset();
-extern void HandleEvents();
-
-// keys and btns
-extern short keys [];  ///< Shows the current key state. 0: unpressed, 1: pressed once, n is >1: kept pressed 'n' times continucely
-extern short mouse_btns [];    ///< Mouse btns. Supporting 3 btns & wheel. Works the same as above
-
-// mouse stuff
-extern Vec2 mouse_pos_ndc; ///< The coords are in the NDC space
-extern Vec2 mouse_pos;     ///< The coords are in the window space. (0,0) is in the uper left corner
-extern Vec2 mouse_velocity;
-extern bool warp_mouse;
-extern bool hide_cursor;
-
-
-
-} // end namespace
-#endif

+ 1 - 1
src/uncategorized/map.h

@@ -1,7 +1,7 @@
 #ifndef _MAP_H_
 #define _MAP_H_
 
-#include "common.h"
+#include "Common.h"
 #include "collision.h"
 
 class Mesh;

+ 1 - 1
src/uncategorized/memory.h

@@ -1,7 +1,7 @@
 #ifndef _MEMORY_H_
 #define _MEMORY_H_
 
-#include "common.h"
+#include "Common.h"
 
 #define MEGABYTE 1048576
 #define KILOBYTE 1024

+ 1 - 1
src/uncategorized/particles.cpp

@@ -22,7 +22,7 @@ void particle_t::render()
 	--life;
 
 	// calc new pos
-	float dt = ( float(app::timer_tick)/1000 );
+	float dt = ( float(App::timerTick)/1000 );
 	Vec3 s_vel; // sigma velocity
 	s_vel = Vec3( 0.0, 0.0, 0.0 );
 	for( int i=0; i<PARTICLE_VELS_NUM; i++ )

+ 2 - 2
src/uncategorized/particles.h

@@ -2,9 +2,9 @@
 #ifndef _PARTICLES_H_
 #define _PARTICLES_H_
 
-#include "common.h"
+#include "Common.h"
 #include "Math.h"
-#include "app.h"
+#include "App.h"
 #include "object.h"
 
 #define PARTICLE_VELS_NUM 2

+ 1 - 1
src/uncategorized/skybox.cpp

@@ -62,7 +62,7 @@ void skybox_t::Render( const Mat3& rotation )
 	glUniform1i( shader->getUniLoc("colormap"), 0 );
 	shader->locTexUnit( shader->getUniLoc("noisemap"), *noise, 1 );
 	glUniform1f( shader->getUniLoc("timer"), (rotation_ang/(2*PI))*100 );
-	glUniform3fv( shader->getUniLoc("scene_ambient_color"), 1, &(Vec3( 1.0, 1.0, 1.0 ) / scene::GetAmbientColor())[0] );
+	glUniform3fv( shader->getUniLoc("scene_ambient_color"), 1, &(Vec3( 1.0, 1.0, 1.0 ) / Scene::getAmbientColor())[0] );
 
 	// set the rotation matrix
 	Mat3 tmp( rotation );

+ 1 - 1
src/uncategorized/skybox.h

@@ -1,7 +1,7 @@
 #ifndef _SKYBOX_H_
 #define _SKYBOX_H_
 
-#include "common.h"
+#include "Common.h"
 #include "Texture.h"
 #include "Math.h"
 

+ 15 - 15
src/utility/app.cpp → src/utility/App.cpp

@@ -1,16 +1,16 @@
 #include <GL/glew.h>
-#include "app.h"
+#include "App.h"
 
-namespace app { // begin of namespace
+namespace App { // begin of namespace
 
 
-static SDL_Surface* main_surf;
-static SDL_Surface* icon_image;
+static SDL_Surface* mainSurf;
+static SDL_Surface* iconImage;
 
 uint windowW = 1280;
 uint windowH = 800;
 
-uint timer_tick = 1000/40; // in ms. 1000/Hz
+uint timerTick = 1000/40; // in ms. 1000/Hz
 static uint time = 0;
 
 uint desktopW;
@@ -45,16 +45,16 @@ void initWindow()
 	desktopH = info->current_h;
 
 	// the icon
-	icon_image = SDL_LoadBMP("gfx/icon.bmp");
-	if( icon_image == NULL )
+	iconImage = SDL_LoadBMP("gfx/icon.bmp");
+	if( iconImage == NULL )
 	{
 		ERROR( "Cannot load window icon" );
 	}
 	else
 	{
-		Uint32 colorkey = SDL_MapRGB( icon_image->format, 255, 0, 255 );
-		SDL_SetColorKey( icon_image, SDL_SRCCOLORKEY, colorkey );
-		SDL_WM_SetIcon( icon_image, NULL );
+		Uint32 colorkey = SDL_MapRGB( iconImage->format, 255, 0, 255 );
+		SDL_SetColorKey( iconImage, SDL_SRCCOLORKEY, colorkey );
+		SDL_WM_SetIcon( iconImage, NULL );
 	}
 
 	// set GL attribs
@@ -63,7 +63,7 @@ void initWindow()
 	SDL_GL_SetAttribute( SDL_GL_ACCELERATED_VISUAL, 1 );
 
 	// set the surface
-	main_surf = SDL_SetVideoMode( windowW, windowH, 24, SDL_HWSURFACE | SDL_OPENGL );
+	mainSurf = SDL_SetVideoMode( windowW, windowH, 24, SDL_HWSURFACE | SDL_OPENGL );
 
 	// move the window
 #ifdef WIN32
@@ -90,7 +90,7 @@ togleFullScreen
 */
 void togleFullScreen()
 {
-	SDL_WM_ToggleFullScreen( main_surf );
+	SDL_WM_ToggleFullScreen( mainSurf );
 }
 
 
@@ -101,7 +101,7 @@ quitApp
 */
 void quitApp( int code )
 {
-	SDL_FreeSurface( main_surf );
+	SDL_FreeSurface( mainSurf );
 	SDL_Quit();
 	exit(code);
 }
@@ -116,10 +116,10 @@ void waitForNextFrame()
 {
 	uint now = SDL_GetTicks();
 
-	if( now - time < timer_tick )
+	if( now - time < timerTick )
 	{
 		// the new time after the SDL_Delay will be...
-		time += timer_tick;
+		time += timerTick;
 		// sleep a little
 		SDL_Delay( time - now);
 	}

+ 3 - 3
src/utility/app.h → src/utility/App.h

@@ -2,12 +2,12 @@
 #define _APP_H_
 
 #include <SDL/SDL.h>
-#include "common.h"
+#include "Common.h"
 
-namespace app {
+namespace App {
 
 
-extern uint timer_tick;
+extern uint timerTick;
 
 extern uint desktopW;
 extern uint desktopH;

+ 2 - 0
src/utility/Common.cpp

@@ -0,0 +1,2 @@
+
+

+ 6 - 11
src/utility/common.h → src/utility/Common.h

@@ -34,11 +34,6 @@ typedef unsigned long int ulong;
 #endif
 
 
-//=====================================================================================================================================
-// misc funcs                                                                                                                         =
-//=====================================================================================================================================
-template<typename Type> class Vec;
-
 
 //=====================================================================================================================================
 // MACROS                                                                                                                             =
@@ -184,28 +179,28 @@ template<typename Type> class Vec: public vector<Type>
 
 #include <malloc.h>
 
-typedef struct mallinfo mallinfo_t; 
+typedef struct mallinfo Mallinfo; 
 
-inline mallinfo_t GetMallInfo()
+inline Mallinfo GetMallInfo()
 {
 	return mallinfo();
 }
 
-inline void printMallInfo( const mallinfo_t& minfo )
+inline void printMallInfo( const Mallinfo& minfo )
 {
 	PRINT( "used:" << minfo.uordblks << " free:" << minfo.fordblks << " total:" << minfo.arena );
 }
 
-inline void printMallInfoDiff( const mallinfo_t& prev, const mallinfo_t& now )
+inline void printMallInfoDiff( const Mallinfo& prev, const Mallinfo& now )
 {
-	mallinfo_t diff;
+	Mallinfo diff;
 	diff.uordblks = now.uordblks-prev.uordblks;
 	diff.fordblks = now.fordblks-prev.fordblks;
 	diff.arena = now.arena-prev.arena;
 	printMallInfo( diff );
 }
 
-#define MALLINFO_BEGIN mallinfo_t __m__ = GetMallInfo();
+#define MALLINFO_BEGIN Mallinfo __m__ = GetMallInfo();
 
 #define MALLINFO_END printMallInfoDiff( __m__, GetMallInfo() ); 
 

+ 32 - 32
src/uncategorized/input.cpp → src/utility/Input.cpp

@@ -1,8 +1,8 @@
-#include "input.h"
+#include "Input.h"
 #include "renderer.h"
 
 
-namespace i {
+namespace I {
 
 
 
@@ -12,37 +12,37 @@ data vars
 =======================================================================================================================================
 */
 short keys [SDLK_LAST];  // shows the current key state. 0: unpressed, 1: pressed once, n is >1: kept pressed 'n' times continucely
-short mouse_btns [8];    // mouse btns. Supporting 3 btns & wheel. Works the same as above
-Vec2 mouse_pos_ndc;    // the coords are in the ndc space
-Vec2 mouse_pos;        // the coords are in the window space
-Vec2 mouse_velocity;
+short mouseBtns [8];    // mouse btns. Supporting 3 btns & wheel. Works the same as above
+Vec2 mousePosNdc;    // the coords are in the ndc space
+Vec2 mousePos;        // the coords are in the window space
+Vec2 mouseVelocity;
 
-bool warp_mouse = false;
-bool hide_cursor = true;
+bool warpMouse = false;
+bool hideCursor = true;
 
 
 /*
 =======================================================================================================================================
-Reset                                                                                                                                 =
+reset                                                                                                                                 =
 =======================================================================================================================================
 */
 void Reset( void )
 {
 	memset( keys, 0, sizeof(keys) );
-	memset(mouse_btns, 0, sizeof(mouse_btns) );
-	mouse_pos_ndc.setZero();
-	mouse_velocity.setZero();
+	memset(mouseBtns, 0, sizeof(mouseBtns) );
+	mousePosNdc.setZero();
+	mouseVelocity.setZero();
 }
 
 
 /*
 =======================================================================================================================================
-HandleEvents                                                                                                                          =
+handleEvents                                                                                                                          =
 =======================================================================================================================================
 */
-void HandleEvents()
+void handleEvents()
 {
-	if( hide_cursor ) SDL_ShowCursor( SDL_DISABLE );
+	if( hideCursor ) SDL_ShowCursor( SDL_DISABLE );
 	else              SDL_ShowCursor( SDL_ENABLE );
 
 	// add the times a key is bying pressed
@@ -52,11 +52,11 @@ void HandleEvents()
 	}
 	for( int x=0; x<8; x++ )
 	{
-		if( mouse_btns[x] ) ++mouse_btns[x];
+		if( mouseBtns[x] ) ++mouseBtns[x];
 	}
 
 
-	mouse_velocity.setZero();
+	mouseVelocity.setZero();
 
 	SDL_Event event_;
 	while( SDL_PollEvent(&event_) )
@@ -72,46 +72,46 @@ void HandleEvents()
 				break;
 
 			case SDL_MOUSEBUTTONDOWN:
-				mouse_btns[event_.button.button] = 1;
+				mouseBtns[event_.button.button] = 1;
 				break;
 
 			case SDL_MOUSEBUTTONUP:
-				mouse_btns[event_.button.button] = 0;
+				mouseBtns[event_.button.button] = 0;
 				break;
 
 			case SDL_MOUSEMOTION:
 			{
-				Vec2 prev_mouse_pos_ndc( mouse_pos_ndc );
+				Vec2 prev_mouse_pos_ndc( mousePosNdc );
 
-				mouse_pos.x = event_.button.x;
-				mouse_pos.y = event_.button.y;
+				mousePos.x = event_.button.x;
+				mousePos.y = event_.button.y;
 
-				mouse_pos_ndc.x = (2.0f * mouse_pos.x) / (float)app::windowW - 1.0f;
-				mouse_pos_ndc.y = 1.0f - (2.0f * mouse_pos.y) / (float)app::windowH;
+				mousePosNdc.x = (2.0f * mousePos.x) / (float)App::windowW - 1.0f;
+				mousePosNdc.y = 1.0f - (2.0f * mousePos.y) / (float)App::windowH;
 
-				if( warp_mouse )
+				if( warpMouse )
 				{
 					// the SDL_WarpMouse pushes an event in the event queue. This check is so we wont process the event of the...
 					// ...SDL_WarpMouse function
-					if( mouse_pos_ndc == Vec2::getZero() ) break;
+					if( mousePosNdc == Vec2::getZero() ) break;
 
-					SDL_WarpMouse( app::windowW/2, app::windowH/2);
+					SDL_WarpMouse( App::windowW/2, App::windowH/2);
 				}
 
-				mouse_velocity = mouse_pos_ndc - prev_mouse_pos_ndc;
+				mouseVelocity = mousePosNdc - prev_mouse_pos_ndc;
 				break;
 			}
 
 			case SDL_QUIT:
-				app::quitApp(1);
+				App::quitApp(1);
 				break;
 		}
 	}
 
-	//cout << fixed << " velocity: " << mouse_velocity.x() << ' ' << mouse_velocity.y() << endl;
-	//cout << fixed << mouse_pos_ndc.x() << ' ' << mouse_pos_ndc.y() << endl;
+	//cout << fixed << " velocity: " << mouseVelocity.x() << ' ' << mouseVelocity.y() << endl;
+	//cout << fixed << mousePosNdc.x() << ' ' << mousePosNdc.y() << endl;
 	//cout << crnt_keys[SDLK_m] << ' ' << prev_keys[SDLK_m] << "      " << keys[SDLK_m] << endl;
-	//cout << mouse_btns[SDL_BUTTON_LEFT] << endl;
+	//cout << mouseBtns[SDL_BUTTON_LEFT] << endl;
 
 }
 

+ 30 - 0
src/utility/Input.h

@@ -0,0 +1,30 @@
+#ifndef _INPUT_H_
+#define _INPUT_H_
+
+#include <SDL/SDL.h>
+#include "Common.h"
+#include "App.h"
+#include "Math.h"
+
+/// input namespace
+namespace I {
+
+
+extern void reset();
+extern void handleEvents();
+
+// keys and btns
+extern short keys [];  ///< Shows the current key state. 0: unpressed, 1: pressed once, n is >1: kept pressed 'n' times continucely
+extern short mouseBtns [];    ///< Mouse btns. Supporting 3 btns & wheel. Works the same as above
+
+// mouse stuff
+extern Vec2 mousePosNdc; ///< The coords are in the NDC space
+extern Vec2 mousePos;     ///< The coords are in the window space. (0,0) is in the uper left corner
+extern Vec2 mouseVelocity;
+extern bool warpMouse;
+extern bool hideCursor;
+
+
+
+} // end namespace
+#endif

+ 1 - 1
src/utility/Util.cpp

@@ -86,7 +86,7 @@ char* cutPath( const char* path )
 
 
 //=====================================================================================================================================
-// getPath                                                                                                                            =
+// getRsrcPath                                                                                                                            =
 //=====================================================================================================================================
 string getPath( const char* path )
 {

+ 1 - 1
src/utility/Util.h

@@ -1,7 +1,7 @@
 #ifndef _UTIL_H_
 #define _UTIL_H_
 
-#include "common.h"
+#include "Common.h"
 
 namespace Util {
 

+ 0 - 23
src/utility/common.cpp

@@ -1,23 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <cstring>
-#include <time.h>
-#include <string>
-#include <math.h>
-#include "common.h"
-
-
-
-/*
-=======================================================================================================================================
-HudprintMemInfo                                                                                                                       =
-=======================================================================================================================================
-*/
-void HudprintMemInfo()
-{
-	/*hud::printf( "==== Mem ===\n" );
-	hud::printf( "Buffer:\nfree:%ldb total:%ldb\n", mem::free_size, mem::buffer_size );
-	hud::printf( "Calls count:\n" );
-	hud::printf( "m:%ld c:%ld r:%ld\nf:%ld n:%ld d:%ld\n", mem::malloc_called_num, mem::calloc_called_num, mem::realloc_called_num, mem::free_called_num, mem::new_called_num, mem::delete_called_num );*/
-}
-

+ 0 - 430
src/utility/u_string.h

@@ -1,430 +0,0 @@
-#ifndef _U_STRING_H_
-#define _U_STRING_H_
-
-#include <iostream>
-#include <cstdlib>
-#include <string.h>
-#include <climits>
-#include <cmath>
-#include "common.h"
-
-using namespace std;
-
-/// class string_t
-class string_t
-{
-	private:
-		// friends
-		friend ostream& operator <<( ostream& output, const string_t& str );
-		friend string_t operator +( const string_t& a, const string_t& b );
-		friend string_t operator +( const char* a, const string_t& b );
-		friend string_t operator +( char a, const string_t& b );
-		friend string_t operator +( const string_t& a, const char* b );
-		friend string_t operator +( const string_t& a, char b );
-		friend bool operator ==( const string_t& a, const string_t& b );
-		friend bool operator ==( const string_t& a, const char* b );
-		friend bool operator ==( const char* a, const string_t& b );
-		
-		// data
-		char* data;
-		bool const_data; ///< false means that we have allocated memory
-		uint length;
-		
-		// private funcs
-		template<typename Type> string_t ConvertT( Type t, const char* format )
-		{
-			string_t out;
-			char tmps [1024];
-			int n = sprintf( tmps, format, t );
-			out.length = n;
-			out.const_data = false;
-			out.data = malloc( (length+1)*sizeof(char) );
-			memcpy( out.data, tmps, length+1 );
-			return out;
-		}
-
-	public:
-		static const uint npos = UINT_MAX;  // ToDo: change it when C++0x becomes standard
-		
-		// constructor []
-		string_t(): data(NULL), const_data(true), length(0) {}
-				
-		// constructor [const char*] 
-		string_t( const char* pchar )
-		{
-			data = const_cast<char*>(pchar);
-			const_data = true;
-			length = strlen(pchar);
-		}		
-		
-		// constructor [char*]
-		string_t( char* pchar )
-		{
-			length = strlen( pchar );
-			const_data = false;
-			data = (char*) malloc( (length+1)*sizeof(char) );
-			memcpy( data, pchar, length+1 );
-		}		
-		
-		// constructor [string_t]
-		string_t( const string_t& b )
-		{
-			const_data = b.const_data;
-			length = b.length;
-			if( b.const_data )
-				data = b.data;
-			else
-			{
-				data = (char*) malloc( (length+1)*sizeof(char) );
-				memcpy( data, b.data, length+1 );
-			}
-		}	
-		
-		// constructor [char]
-		string_t( char c )
-		{
-			DEBUG_ERR( c == '\0' );
-			length = 1;
-			data = (char*) malloc( 2*sizeof(char) );
-			const_data = false;
-			data[0] = c;
-			data[1] = '\0';
-		}
-		
-		// destructor
-		virtual ~string_t()
-		{
-			if( length!=0 && !const_data )
-				free( data );
-		}
-		
-		// []
-		const char& operator []( uint i ) const { DEBUG_ERR(i>=length); return data[i]; }
-		char& operator []( uint i ) { DEBUG_ERR(i>=length); return data[i]; }
-		
-		
-		//================================================================================================================================
-		// operator =                                                                                                                    =
-		//================================================================================================================================
-		
-		// = [string_t]
-		string_t& operator =( const string_t& b )
-		{
-			if( !const_data ) free( data );
-			const_data = b.const_data;
-			length = b.length;
-			if( b.const_data )
-				data = b.data;
-			else
-			{
-				data = (char*) malloc( (length+1)*sizeof(char) );
-				memcpy( data, b.data, length+1 );
-			}
-			return (*this);
-		}
-			
-		// = [char*]
-		string_t& operator =( char* pchar )
-		{
-			if( !const_data ) free( data );
-			length = strlen( pchar );
-			const_data = false;
-			data = (char*) malloc( (length+1)*sizeof(char) );
-			memcpy( data, pchar, length+1 );
-			return (*this);
-		}
-		
-		// = [const char*]
-		string_t& operator =( const char* pchar )
-		{
-			if( !const_data ) free( data );
-			data = const_cast<char*>(pchar);
-			const_data = true;
-			length = strlen(pchar);
-			return (*this);
-		}
-		
-		// = [char]
-		string_t& operator =( char c )
-		{
-			if( !const_data ) free( data );
-			DEBUG_ERR( c == '\0' );
-			data = (char*) malloc( 2*sizeof(char) );
-			data[0] = c;
-			data[1] = '\0';
-			return (*this);
-		}
-		
-		
-		//================================================================================================================================
-		// operator +=                                                                                                                   =
-		//================================================================================================================================
-		
-		// += [string_t]
-		string_t& operator +=( const string_t& str )
-		{
-			if( const_data )
-			{
-				char* data_ = (char*) malloc( (length+str.length+1)*sizeof(char) );
-				memcpy( data_, data, length );
-				data = data_;
-				const_data = false;
-			}
-			else
-			{
-				data = (char*) realloc( data, (length+str.length+1)*sizeof(char) );
-			}
-			memcpy( data+length, str.data, (str.length+1)/sizeof(char) );
-			length += str.length;
-			return (*this);
-		}
-			
-		// += [char*]
-		string_t& operator +=( const char* pchar )
-		{
-			uint pchar_len = strlen( pchar );
-			if( const_data )
-			{
-				char* data_ = (char*) malloc( (length+pchar_len+1)*sizeof(char) );
-				memcpy( data_, data, length );
-				data = data_;
-				const_data = false;
-			}
-			else
-			{
-				data = (char*) realloc( data, (length+pchar_len+1)*sizeof(char) );
-			}
-			memcpy( data+length, pchar, (pchar_len+1)/sizeof(char) );
-			length += pchar_len;
-			return (*this);
-		}
-		
-		// += [char]
-		string_t& operator +=( const char char_ )
-		{
-			if( const_data )
-			{
-				char* data_ = (char*) malloc( (length+2)*sizeof(char) );
-				memcpy( data_, data, length );
-				data = data_;
-				const_data = false;
-			}
-			else
-			{
-				data = (char*) realloc( data, (length+2)*sizeof(char) );
-			}
-			data[length] = char_;
-			data[length+1] = '\0';
-			++length;
-			return (*this);
-		}
-		
-		
-		//================================================================================================================================
-		// misc                                                                                                                          =
-		//================================================================================================================================
-		
-		// Convert
-		static string_t Convert( int i, const char* format = "%d" )
-		{
-			return ConvertT( i, format );
-		}
-		
-		// Convert [uint]
-		static string_t Convert( uint u, const char* format = "%u"  )
-		{
-			return ConvertT( u, format );
-		}
-
-		// Convert [float]
-		static string_t Convert( float f, const char* format = "%f"  )
-		{
-			return ConvertT( f, format );
-		}
-		
-		// Convert [double]
-		static string_t Convert( double d, const char* format = "%f"  )
-		{
-			return ConvertT( d, format );
-		}
-		
-		// Clear
-		void Clear()
-		{
-			DEBUG_ERR( (data==NULL && length!=0) || (data!=NULL && length==0) ); // not my bug
-			if( data != NULL )
-			{
-				if( !const_data )
-					free( data );
-				const_data = true;
-				length = 0;
-				data = NULL;
-			}
-		}
-			
-		// CStr
-		const char* CStr() const
-		{
-			DEBUG_ERR( data == NULL ); // not my bug
-			return data;
-		}
-		
-		// getLength
-		uint Length() const
-		{
-			DEBUG_ERR( data!=NULL && length!=strlen(data) );
-			return length;
-		}
-		
-		// Find [char]
-		uint Find( char c, uint pos = 0 ) const
-		{
-			DEBUG_ERR( pos >= length ); // not my bug
-			char* pc = data + pos;
-			while( *pc!=c && *pc!='\0' )
-			{
-				++pc;
-			}
-			uint diff = pc - data; 
-			return (diff == length) ? npos : diff;
-		}
-		
-		// RFind [char]
-		uint RFind( char c, uint pos = npos ) const
-		{
-			DEBUG_ERR( pos >= length && pos!=npos ); // not my bug
-			if( pos==npos ) pos = length-1;
-			char* pc = data + pos;
-			while( pc!=data-1 && *pc!=c )
-			{
-				--pc;
-			}
-			return (pc == data-1) ? npos : pc - data;
-		}
-		
-		// Find [string_t]
-		uint Find( const string_t& str, uint pos = 0 ) const
-		{
-			DEBUG_ERR( pos >= length ); // not my bug
-			char* pc = strstr( data+pos, str.data );
-			return (pc == NULL) ? npos : pc-data;
-		}
-		
-		// Find [char*]
-		uint Find( const char* pc, uint pos = 0 ) const
-		{
-			DEBUG_ERR( pos >= length ); // not my bug
-			char* pc_ = strstr( data+pos, pc );
-			return (pc_ == NULL) ? npos : pc_-data;
-		}
-};
-
-
-//================================================================================================================================
-// operator +                                                                                                                    =
-//================================================================================================================================
-
-/// string_t + string_t
-inline string_t operator +( const string_t& a, const string_t& b )
-{
-	string_t out;
-	out.const_data = false;
-	out.data = (char*) malloc( (a.length+b.length+1)*sizeof(char) );
-	memcpy( out.data, a.data, a.length );
-	memcpy( out.data+a.length, b.data, b.length+1 );
-	out.length = a.length+b.length;
-	return out;
-}
-
-/// char* + string_t
-inline string_t operator +( const char* a, const string_t& b )
-{
-	DEBUG_ERR( strlen(a)<1 || b.length<1 ); // not my bug
-	string_t out;
-	uint a_length = strlen( a );
-	out.length = a_length+b.length;
-	out.const_data = false;
-	out.data = (char*) malloc( (out.length+1)*sizeof(char) );
-	memcpy( out.data, a, a_length );
-	if( b.length > 0 )
-		memcpy( out.data+a_length, b.data, b.length+1 );
-	else
-		out.data[out.length] = '\0';
-	return out;
-}
-
-/// char + string_t
-inline string_t operator +( char a, const string_t& b )
-{
-	string_t out;
-	out.const_data = false;
-	out.data = (char*) malloc( (b.length+2)*sizeof(char) );
-	out.data[0] = a;
-	memcpy( out.data+1, b.data, b.length+1 );
-	out.length = 1+b.length;
-	return out;
-}
-
-/// string_t + char*
-inline string_t operator +( const string_t& a, const char* b )
-{
-	DEBUG_ERR( a.length<1 || strlen(b)<1 ); // not my bug
-	string_t out;
-	uint b_length = strlen( b );
-	out.const_data = false;
-	out.length = a.length+b_length;
-	out.data = (char*) malloc( (out.length+1)*sizeof(char) );
-	memcpy( out.data, a.data, a.length );
-	memcpy( out.data+a.length, b, b_length+1 );
-	return out;
-}
-
-/// string_t + char
-inline string_t operator +( const string_t& a, char b )
-{
-	DEBUG_ERR( a.length<1 ); // not my bug
-	string_t out;
-	out.const_data = false;
-	out.data = (char*) malloc( (a.length+2)*sizeof(char) );
-	memcpy( out.data, a.data, a.length );
-	out.data[a.length] = b;
-	out.data[a.length+1] = '\0';
-	out.length = a.length+1;
-	return out;
-}
-
-
-//================================================================================================================================
-// operator ==                                                                                                                   =
-//================================================================================================================================
-
-/// string_t == string_t
-inline bool operator ==( const string_t& a, const string_t& b )
-{
-	return strcmp( a.data, b.data ) == 0;
-}
-
-/// string_t == char*
-inline bool operator ==( const string_t& a, const char* b )
-{
-	return strcmp( a.data, b ) == 0;
-}
-
-/// char* == string_t
-inline bool operator ==( const char* a, const string_t& b )
-{
-	return strcmp( a, b.data ) == 0;
-}
-
-
-//================================================================================================================================
-// misc                                                                                                                          =
-//================================================================================================================================
-/// For cout support
-inline ostream& operator <<( ostream& output, const string_t& str ) 
-{
-	output << str.data;
-	return output;
-}
-
-#endif

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.