From 398ee1b4d599e6b7ee9136b1082e436a6f3a1f85 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sun, 29 Jun 2014 09:55:03 +0000 Subject: [PATCH] base: use lol::array in most places. --- demos/tutorial/01_triangle.cpp | 2 +- demos/tutorial/02_cube.cpp | 4 ++-- demos/tutorial/03_noise.cpp | 2 +- demos/tutorial/04_texture.cpp | 4 ++-- demos/tutorial/05_easymesh.cpp | 2 +- demos/tutorial/06_sprite.cpp | 2 +- demos/tutorial/07_input.cpp | 4 ++-- demos/tutorial/08_fbo.cpp | 2 +- demos/tutorial/11_fractal.cpp | 2 +- demos/tutorial/12_voronoi.cpp | 8 +++---- test/btphystest.cpp | 2 +- test/btphystest.h | 12 +++++------ test/meshviewer.cpp | 12 +++++------ test/nacl_phystest.h | 12 +++++------ test/physicobject.h | 6 +++--- test/physics/easyphysics.h | 4 ++-- test/physics/lolphysics.h | 24 ++++++++++----------- test/scenesetup.h | 4 ++-- test/unit/array.cpp | 38 +++++++++++++++++----------------- test/unit/quat.cpp | 2 +- tools/lolremez/matrix.h | 2 +- tools/lolremez/solver.cpp | 12 +++++------ tools/lolremez/solver.h | 6 +++--- tools/vimlol/vimlol.vim | 2 +- 24 files changed, 85 insertions(+), 85 deletions(-) diff --git a/demos/tutorial/01_triangle.cpp b/demos/tutorial/01_triangle.cpp index a2cc1766..364821e0 100644 --- a/demos/tutorial/01_triangle.cpp +++ b/demos/tutorial/01_triangle.cpp @@ -60,7 +60,7 @@ public: } private: - Array m_vertices; + array m_vertices; Shader *m_shader; ShaderAttrib m_coord; VertexDeclaration *m_vdecl; diff --git a/demos/tutorial/02_cube.cpp b/demos/tutorial/02_cube.cpp index 6916cef1..2b4c44e8 100644 --- a/demos/tutorial/02_cube.cpp +++ b/demos/tutorial/02_cube.cpp @@ -118,8 +118,8 @@ public: private: float m_angle; mat4 m_matrix; - Array m_mesh; - Array m_lines_indices, m_faces_indices; + array m_mesh; + array m_lines_indices, m_faces_indices; Shader *m_shader; ShaderAttrib m_coord, m_color; diff --git a/demos/tutorial/03_noise.cpp b/demos/tutorial/03_noise.cpp index 8f28254f..8e2035f2 100644 --- a/demos/tutorial/03_noise.cpp +++ b/demos/tutorial/03_noise.cpp @@ -68,7 +68,7 @@ public: } private: - Array m_vertices; + array m_vertices; Shader *m_shader; ShaderAttrib m_coord; ShaderUniform m_time_uni; diff --git a/demos/tutorial/04_texture.cpp b/demos/tutorial/04_texture.cpp index f9b32407..e7d2f3cf 100644 --- a/demos/tutorial/04_texture.cpp +++ b/demos/tutorial/04_texture.cpp @@ -96,14 +96,14 @@ public: } private: - Array m_vertices; + array m_vertices; Texture *m_texture; Shader *m_shader; ShaderAttrib m_coord; ShaderUniform m_texture_uni; VertexDeclaration *m_vdecl; VertexBuffer *m_vbo; - Array m_heightmap; + array m_heightmap; int m_frames; bool m_ready; }; diff --git a/demos/tutorial/05_easymesh.cpp b/demos/tutorial/05_easymesh.cpp index 9fd3e8ca..5196d795 100644 --- a/demos/tutorial/05_easymesh.cpp +++ b/demos/tutorial/05_easymesh.cpp @@ -144,7 +144,7 @@ public: private: Shader* m_custom_shader; - Array m_gears; + array m_gears; float m_angle; mat4 m_mat; Camera *m_camera; diff --git a/demos/tutorial/06_sprite.cpp b/demos/tutorial/06_sprite.cpp index f1eb0ee3..fa715a50 100644 --- a/demos/tutorial/06_sprite.cpp +++ b/demos/tutorial/06_sprite.cpp @@ -88,7 +88,7 @@ private: static int const SPRITE_COUNT = 192; static int const FRAME_COUNT = 16; - Array m_sprites; + array m_sprites; bool m_ready; }; diff --git a/demos/tutorial/07_input.cpp b/demos/tutorial/07_input.cpp index 2f4ffa75..677bf2c9 100644 --- a/demos/tutorial/07_input.cpp +++ b/demos/tutorial/07_input.cpp @@ -218,8 +218,8 @@ private: float m_pitch_angle; float m_yaw_angle; mat4 m_matrix; - Array m_mesh; - Array m_lines_indices, m_faces_indices; + array m_mesh; + array m_lines_indices, m_faces_indices; Shader *m_shader; ShaderAttrib m_coord, m_color; diff --git a/demos/tutorial/08_fbo.cpp b/demos/tutorial/08_fbo.cpp index a7f283a8..a77f687d 100644 --- a/demos/tutorial/08_fbo.cpp +++ b/demos/tutorial/08_fbo.cpp @@ -128,7 +128,7 @@ public: } private: - Array m_vertices; + array m_vertices; Shader *m_shader; ShaderAttrib m_coord; ShaderUniform m_uni_flag, m_uni_point, m_uni_color, m_uni_texture; diff --git a/demos/tutorial/11_fractal.cpp b/demos/tutorial/11_fractal.cpp index a766ed99..8db5a711 100644 --- a/demos/tutorial/11_fractal.cpp +++ b/demos/tutorial/11_fractal.cpp @@ -532,7 +532,7 @@ private: ivec2 m_size, m_window_size, m_oldmouse; double m_window2world; dvec2 m_texel2world; - Array m_pixels, m_palette; + array m_pixels, m_palette; Shader *m_shader; ShaderAttrib m_vertexattrib, m_texattrib; diff --git a/demos/tutorial/12_voronoi.cpp b/demos/tutorial/12_voronoi.cpp index 496de434..4cb5b8e6 100644 --- a/demos/tutorial/12_voronoi.cpp +++ b/demos/tutorial/12_voronoi.cpp @@ -113,7 +113,7 @@ public: for (int i = 0; i < MaxFboType; ++i) { - m_fbos.Push(new Framebuffer(Video::GetSize()), 0, Array(), Array() ); + m_fbos.Push(new Framebuffer(Video::GetSize()), 0, array(), array() ); if (i == SrcVoronoiFbo) { @@ -394,8 +394,8 @@ public: private: Controller* m_controller; - Array voronoi_points; - Array m_vertices; + array voronoi_points; + array m_vertices; Shader *m_screen_shader; ShaderAttrib m_screen_coord; ShaderUniform m_screen_texture; @@ -403,7 +403,7 @@ private: VertexDeclaration *m_vdecl; VertexBuffer *m_vbo; - Array, Array > m_fbos; + array, array > m_fbos; Framebuffer *temp_buffer; int mode; diff --git a/test/btphystest.cpp b/test/btphystest.cpp index 50777803..cb83c6b2 100644 --- a/test/btphystest.cpp +++ b/test/btphystest.cpp @@ -272,7 +272,7 @@ void BtPhysTest::InitApp() #if USE_ROPE { - Array RopeElements; + array RopeElements; for (int i = 0; i < 14; i++) { PhysicsObject* new_physobj = new PhysicsObject(m_simulation, 1000.f, diff --git a/test/btphystest.h b/test/btphystest.h index 524aeac6..0cd0c88a 100644 --- a/test/btphystest.h +++ b/test/btphystest.h @@ -68,12 +68,12 @@ private: bool m_ready; lol::phys::Simulation* m_simulation; - Array m_constraint_list; - Array m_physobj_list; - Array m_ground_list; - Array m_platform_list; - Array m_character_list; - Array m_stairs_list; + array m_constraint_list; + array m_physobj_list; + array m_ground_list; + array m_platform_list; + array m_character_list; + array m_stairs_list; float m_loop_value; float m_target_timer; diff --git a/test/meshviewer.cpp b/test/meshviewer.cpp index 413cbe53..46e6a141 100644 --- a/test/meshviewer.cpp +++ b/test/meshviewer.cpp @@ -165,7 +165,7 @@ public: } } - Array m_targets; + array m_targets; }; class MeshViewer : public WorldEntity @@ -581,7 +581,7 @@ public: if (new_ssetup->Compile(mesh.C()) && new_ssetup->m_lights.Count()) { //Store current light datas, in World - Array light_datas; + array light_datas; for (int i = 0; i < m_ssetup->m_lights.Count(); ++i) light_datas << LightData(m_ssetup->m_lights[i]->GetPosition(), m_ssetup->m_lights[i]->GetColor()); @@ -890,7 +890,7 @@ public: private: SceneSetup* m_ssetup; - Array m_light_datas; + array m_light_datas; Controller* m_controller; short m_input_usage; mat4 m_mat; @@ -927,12 +927,12 @@ private: int m_mesh_render; int m_mesh_id; float m_mesh_id1; - Array m_meshes; - Array m_gizmos; + array m_meshes; + array m_gizmos; //File data String m_file_name; - Array m_cmdlist; + array m_cmdlist; float m_stream_update_time; float m_stream_update_timer; diff --git a/test/nacl_phystest.h b/test/nacl_phystest.h index 64bad1f6..855c8903 100644 --- a/test/nacl_phystest.h +++ b/test/nacl_phystest.h @@ -43,12 +43,12 @@ private: bool m_ready; //lol::phys::Simulation* m_simulation; - //Array m_constraint_list; - //Array m_physobj_list; - //Array m_ground_list; - //Array m_platform_list; - //Array m_character_list; - //Array m_stairs_list; + //array m_constraint_list; + //array m_physobj_list; + //array m_ground_list; + //array m_platform_list; + //array m_character_list; + //array m_stairs_list; float m_loop_value; float m_target_timer; diff --git a/test/physicobject.h b/test/physicobject.h index 7894217e..b3956f06 100644 --- a/test/physicobject.h +++ b/test/physicobject.h @@ -130,9 +130,9 @@ public: m_is_character(false), m_is_phys(false) { - Array MeshRand; - Array MeshLimit; - Array MeshType; + array MeshRand; + array MeshLimit; + array MeshType; MeshLimit << 0; diff --git a/test/physics/easyphysics.h b/test/physics/easyphysics.h index de43201c..15216414 100644 --- a/test/physics/easyphysics.h +++ b/test/physics/easyphysics.h @@ -142,13 +142,13 @@ protected: Simulation* m_owner_simulation; //Base/Attachment logic - Array m_based_physic_list; //List of objects based on this : this object moves, its based object MoveStep with it. + array m_based_physic_list; //List of objects based on this : this object moves, its based object MoveStep with it. EasyPhysic* m_base_physic; //Base for this object : The base moves, the object moves with it. bool m_base_lock_location; //when this is TRUE, location moves with rotation change. bool m_base_lock_rotation; //when this is TRUE, rotation moves with rotation change. //Touch logic - Array m_touching_physic; //Maintained by ghost objects + array m_touching_physic; //Maintained by ghost objects }; } /* namespace phys */ diff --git a/test/physics/lolphysics.h b/test/physics/lolphysics.h index 0cd0bfda..716afff8 100644 --- a/test/physics/lolphysics.h +++ b/test/physics/lolphysics.h @@ -48,10 +48,10 @@ struct RayCastResult m_hit_fraction_list.Empty(); } - Array m_collider_list; - Array m_hit_normal_list; - Array m_hit_point_list; - Array m_hit_fraction_list; + array m_collider_list; + array m_hit_normal_list; + array m_hit_point_list; + array m_hit_fraction_list; short int m_collision_filter_group; short int m_collision_filter_mask; @@ -334,7 +334,7 @@ private: //Adds the given EasyPhysic to the correct list. void ObjectRegistration(bool AddObject, EasyPhysic* NewEP, eEasyPhysicType CurType) { - Array* SearchList = NULL; + array* SearchList = NULL; switch(CurType) { case EEPT_Dynamic: @@ -388,7 +388,7 @@ private: } void ObjectRegistration(bool AddObject, EasyConstraint* NewEC) { - Array* SearchList = NULL; + array* SearchList = NULL; SearchList = &m_constraint_list; if (AddObject) @@ -411,12 +411,12 @@ private: } //Easy Physics body List - Array m_dynamic_list; - Array m_static_list; - Array m_ghost_list; - Array m_collision_object_list; - Array m_character_controller_list; - Array m_constraint_list; + array m_dynamic_list; + array m_static_list; + array m_ghost_list; + array m_collision_object_list; + array m_character_controller_list; + array m_constraint_list; //Easy Physics data storage float m_timestep; diff --git a/test/scenesetup.h b/test/scenesetup.h index e2ac1a3d..52417aa6 100644 --- a/test/scenesetup.h +++ b/test/scenesetup.h @@ -40,8 +40,8 @@ public: //-- vec4 m_clear_color; - Array m_lights; - Array m_custom_cmd; + array m_lights; + array m_custom_cmd; bool m_show_gizmo; bool m_show_lights; }; diff --git a/test/unit/array.cpp b/test/unit/array.cpp index dd75ca14..2c50877e 100644 --- a/test/unit/array.cpp +++ b/test/unit/array.cpp @@ -38,7 +38,7 @@ LOLUNIT_FIXTURE(ArrayTest) LOLUNIT_TEST(ArrayPush) { - Array a; + array a; a.Push(0); a.Push(1); a.Push(2); @@ -52,19 +52,19 @@ LOLUNIT_FIXTURE(ArrayTest) LOLUNIT_TEST(ArrayInitializer) { - Array a({ 2, 4, 6 }); + array a({ 2, 4, 6 }); LOLUNIT_ASSERT_EQUAL(a[0], 2); LOLUNIT_ASSERT_EQUAL(a[1], 4); LOLUNIT_ASSERT_EQUAL(a[2], 6); - Array b = { 2, 4, 6 }; + array b = { 2, 4, 6 }; LOLUNIT_ASSERT_EQUAL(b[0], 2); LOLUNIT_ASSERT_EQUAL(b[1], 4); LOLUNIT_ASSERT_EQUAL(b[2], 6); - Array c = { { 2, 3.0f }, + array c = { { 2, 3.0f }, { 4, 5.0f }, { 6, 7.0f } }; @@ -78,7 +78,7 @@ LOLUNIT_FIXTURE(ArrayTest) LOLUNIT_TEST(ArrayPushWithShift) { - Array a; + array a; a << 0 << 1 << 2 << 3; LOLUNIT_ASSERT_EQUAL(a[0], 0); @@ -89,10 +89,10 @@ LOLUNIT_FIXTURE(ArrayTest) LOLUNIT_TEST(ArrayCopy) { - Array a; + array a; a << 0 << 1 << 2 << 3; - Array b = a; + array b = a; LOLUNIT_ASSERT_EQUAL(b[0], 0); LOLUNIT_ASSERT_EQUAL(b[1], 1); @@ -102,7 +102,7 @@ LOLUNIT_FIXTURE(ArrayTest) LOLUNIT_TEST(ArrayRemove) { - Array a; + array a; a << 0 << 1 << 2 << 3; a.Remove(1); @@ -111,7 +111,7 @@ LOLUNIT_FIXTURE(ArrayTest) LOLUNIT_ASSERT_EQUAL(a[1], 2); LOLUNIT_ASSERT_EQUAL(a[2], 3); - Array b; + array b; b << 0 << 1 << 2 << 3; b.Remove(-2); @@ -123,7 +123,7 @@ LOLUNIT_FIXTURE(ArrayTest) LOLUNIT_TEST(ArrayRemoveSwap) { - Array a; + array a; a << 0 << 1 << 2 << 3; a.RemoveSwap(1); @@ -132,7 +132,7 @@ LOLUNIT_FIXTURE(ArrayTest) LOLUNIT_ASSERT_EQUAL(a[1], 3); LOLUNIT_ASSERT_EQUAL(a[2], 2); - Array b; + array b; b << 0 << 1 << 2 << 3; b.Remove(1, 2); @@ -143,7 +143,7 @@ LOLUNIT_FIXTURE(ArrayTest) LOLUNIT_TEST(EightElements) { - Array a; + array a; a.Push(1, 2, 3.f, 4.0, 5, 'a', true, 0); LOLUNIT_ASSERT_EQUAL(a[0].m1, 1); @@ -158,7 +158,7 @@ LOLUNIT_FIXTURE(ArrayTest) LOLUNIT_TEST(ArraySwap) { - Array a; + array a; a.Push(10, 20); a.Push(30, 40); a.Swap(0, 1); @@ -171,7 +171,7 @@ LOLUNIT_FIXTURE(ArrayTest) LOLUNIT_TEST(ArrayInsert) { - Array a; + array a; a << 1 << 2; a.Insert(5, 0); @@ -195,11 +195,11 @@ LOLUNIT_FIXTURE(ArrayTest) LOLUNIT_TEST(ArrayConcat) { - Array a, b; + array a, b; a << 0 << 1; b << 2 << 3; - Array c = a + b; + array c = a + b; LOLUNIT_ASSERT_EQUAL(c[0], 0); LOLUNIT_ASSERT_EQUAL(c[1], 1); LOLUNIT_ASSERT_EQUAL(c[2], 2); @@ -208,7 +208,7 @@ LOLUNIT_FIXTURE(ArrayTest) LOLUNIT_TEST(ArrayAppend) { - Array a, b; + array a, b; a << 0 << 1; b << 2 << 3; @@ -232,7 +232,7 @@ LOLUNIT_FIXTURE(ArrayTest) TrackedObj::m_ctor = 0; TrackedObj::m_dtor = 0; { - Array a; + array a; a.Push(TrackedObj()); } @@ -241,7 +241,7 @@ LOLUNIT_FIXTURE(ArrayTest) TrackedObj::m_ctor = 0; TrackedObj::m_dtor = 0; { - Array a; + array a; a.Resize(2); a.Resize(4); diff --git a/test/unit/quat.cpp b/test/unit/quat.cpp index e67827e3..2f81cf7f 100644 --- a/test/unit/quat.cpp +++ b/test/unit/quat.cpp @@ -536,7 +536,7 @@ LOLUNIT_FIXTURE(QuaternionTest) } private: - Array m_vectorpairs; + array m_vectorpairs; }; } /* namespace lol */ diff --git a/tools/lolremez/matrix.h b/tools/lolremez/matrix.h index e60bc1c7..08b66ab1 100644 --- a/tools/lolremez/matrix.h +++ b/tools/lolremez/matrix.h @@ -106,6 +106,6 @@ template struct Matrix int m_cols, m_rows; private: - Array m_data; + array m_data; }; diff --git a/tools/lolremez/solver.cpp b/tools/lolremez/solver.cpp index 86e7ba41..3a4d73c9 100644 --- a/tools/lolremez/solver.cpp +++ b/tools/lolremez/solver.cpp @@ -96,7 +96,7 @@ void RemezSolver::Init() m_control.Resize(m_order + 2); /* Pick up x_i where error will be 0 and compute f(x_i) */ - Array fxn; + array fxn; for (int i = 0; i < m_order + 1; i++) { m_zeroes[i] = (real)(2 * i - m_order) / (real)(m_order + 1); @@ -109,7 +109,7 @@ void RemezSolver::Init() for (int i = 0; i < m_order + 1; i++) { /* Compute the powers of x_i */ - Array powers; + array powers; powers.Push(real(1.0)); for (int n = 1; n < m_order + 1; n++) powers.Push(powers.Last() * m_zeroes[i]); @@ -239,7 +239,7 @@ real RemezSolver::FindExtrema() void RemezSolver::Step() { /* Pick up x_i where error will be 0 and compute f(x_i) */ - Array fxn; + array fxn; for (int i = 0; i < m_order + 2; i++) fxn.Push(EvalFunc(m_control[i])); @@ -249,7 +249,7 @@ void RemezSolver::Step() for (int i = 0; i < m_order + 2; i++) { /* Compute the powers of x_i */ - Array powers; + array powers; powers.Push(real(1.0)); for (int n = 1; n < m_order + 1; n++) powers.Push(powers.Last() * m_control[i]); @@ -307,7 +307,7 @@ void RemezSolver::PrintPoly() /* Transform Chebyshev polynomial weights into powers of X^i * in the [-1..1] range. */ - Array bn; + array bn; for (int i = 0; i < m_order + 1; i++) { @@ -319,7 +319,7 @@ void RemezSolver::PrintPoly() /* Transform a polynomial in the [-1..1] range into a polynomial * in the [a..b] range. */ - Array k1p, k2p, an; + array k1p, k2p, an; for (int i = 0; i < m_order + 1; i++) { diff --git a/tools/lolremez/solver.h b/tools/lolremez/solver.h index 7cb5173c..45980814 100644 --- a/tools/lolremez/solver.h +++ b/tools/lolremez/solver.h @@ -44,9 +44,9 @@ private: private: int m_order; - lol::Array m_coeff; - lol::Array m_zeroes; - lol::Array m_control; + lol::array m_coeff; + lol::array m_zeroes; + lol::array m_control; RealFunc *m_func, *m_weight; lol::real m_k1, m_k2, m_invk1, m_invk2, m_epsilon; diff --git a/tools/vimlol/vimlol.vim b/tools/vimlol/vimlol.vim index c50c81a1..66cc41a7 100644 --- a/tools/vimlol/vimlol.vim +++ b/tools/vimlol/vimlol.vim @@ -18,7 +18,7 @@ au Syntax cpp " Some custom container types au Syntax cpp \ syn keyword cType - \ hash map array2d array3d + \ array array2d array3d hash map " GLSL types and the Lol Engine extensions au Syntax cpp