3 Copyright (C) 2010 celeron55, Perttu Ahola <celeron55@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 (c) 2010 Perttu Ahola <celeron55@gmail.com>
25 #include "irrlichtwrapper.h"
27 TimeTaker::TimeTaker(const char *name, IrrlichtWrapper *irrlicht, u32 *result)
30 m_irrlicht = irrlicht;
38 m_time1 = m_irrlicht->getTime();
41 u32 TimeTaker::stop(bool quiet)
45 if(m_irrlicht == NULL)
48 std::cout<<"Couldn't measure time for "<<m_name
49 <<": irrlicht==NULL"<<std::endl;*/
52 u32 time2 = m_irrlicht->getTime();
53 u32 dtime = time2 - m_time1;
61 std::cout<<m_name<<" took "<<dtime<<"ms"<<std::endl;
69 const v3s16 g_26dirs[26] =
71 // +right, +top, +back
72 v3s16( 0, 0, 1), // back
73 v3s16( 0, 1, 0), // top
74 v3s16( 1, 0, 0), // right
75 v3s16( 0, 0,-1), // front
76 v3s16( 0,-1, 0), // bottom
77 v3s16(-1, 0, 0), // left
79 v3s16(-1, 1, 0), // top left
80 v3s16( 1, 1, 0), // top right
81 v3s16( 0, 1, 1), // top back
82 v3s16( 0, 1,-1), // top front
83 v3s16(-1, 0, 1), // back left
84 v3s16( 1, 0, 1), // back right
85 v3s16(-1, 0,-1), // front left
86 v3s16( 1, 0,-1), // front right
87 v3s16(-1,-1, 0), // bottom left
88 v3s16( 1,-1, 0), // bottom right
89 v3s16( 0,-1, 1), // bottom back
90 v3s16( 0,-1,-1), // bottom front
92 v3s16(-1, 1, 1), // top back-left
93 v3s16( 1, 1, 1), // top back-right
94 v3s16(-1, 1,-1), // top front-left
95 v3s16( 1, 1,-1), // top front-right
96 v3s16(-1,-1, 1), // bottom back-left
97 v3s16( 1,-1, 1), // bottom back-right
98 v3s16(-1,-1,-1), // bottom front-left
99 v3s16( 1,-1,-1), // bottom front-right