Changeset 1369
 Timestamp:
 May 12, 2012, 1:51:43 PM (9 years ago)
 Location:
 trunk
 Files:

 4 edited
Legend:
 Unmodified
 Added
 Removed

trunk/monsterz/board.cpp
r1310 r1369 189 189 if (cur_cell.x < 0  cur_cell.x >= data>dim.x 190 190  cur_cell.y < 0  cur_cell.y >= data>dim.y 191  sqlen (cur_pos  cur_cell * data>size) > sqlen(data>size) / 8192  sqlen (cur_cell  data>src_cell) != 1)191  sqlength(cur_pos  cur_cell * data>size) > sqlength(data>size) / 8 192  sqlength(cur_cell  data>src_cell) != 1) 193 193 cur_cell = ivec2(1); 194 194 /* If potential target changed, update our cache. */ … … 222 222 /* Mouse released, or exited window, or dragged too far. */ 223 223 if (!buttons[0]  m_mousepos.x == 1  224 sqlen (data>src_cell * data>size  data>grabbed.piece>GetPos()224 sqlength(data>src_cell * data>size  data>grabbed.piece>GetPos() 225 225  data>grabbed.piece>GetOffset()) > 100 * 100) 226 226 { 
trunk/monsterz/piece.cpp
r1310 r1369 201 201 case PieceData::MOVE: 202 202 /* Only allow swaps when piece is close enough to its target cell. */ 203 if (sqlen (GetShift()) > sqlen(data>size) / 8)203 if (sqlength(GetShift()) > sqlength(data>size) / 8) 204 204 return 0; 205 205 /* Fall through */ … … 277 277 278 278 ivec2 trip = data>pos_dst  data>pos_src; 279 float pos_time = len (trip) / data>speed;279 float pos_time = length(trip) / data>speed; 280 280 float t = pos_time ? data>timer / pos_time : 1.0f; 281 281 if (t >= 1.0f) … … 283 283 data>pos = vec2(data>pos_src) + t * vec2(trip) + vec2(0.5f); 284 284 285 float off_time = len (data>off_src) / data>speed;285 float off_time = length(data>off_src) / data>speed; 286 286 t = off_time ? data>timer / off_time : 1.0f; 287 287 if (t >= 1.0f) … … 354 354 break; 355 355 case PieceData::UNGRAB: 356 if (sqlen (data>cell * data>size  data>pos_src)357 > sqlen (data>size) / 8)356 if (sqlength(data>cell * data>size  data>pos_src) 357 > sqlength(data>size) / 8) 358 358 off = 7; 359 359 z = 8; 
trunk/src/lol/math/vector.h
r1352 r1369 269 269 } 270 270 271 inline T norm() const { return len (*this); }271 inline T norm() const { return length(*this); } 272 272 #if !defined __ANDROID__ 273 273 template<typename U> … … 281 281 static inline Cmplx<T> re(Cmplx<T> const &val) 282 282 { 283 return ~val / sqlen (val);283 return ~val / sqlength(val); 284 284 } 285 285 … … 1003 1003 inline T norm(Quat<T> const &val) 1004 1004 { 1005 return sqlen (val);1005 return sqlength(val); 1006 1006 } 1007 1007 … … 1188 1188 \ 1189 1189 tprefix \ 1190 inline type sqlen (tname<type> const &a) \1190 inline type sqlength(tname<type> const &a) \ 1191 1191 { \ 1192 1192 type acc = 0; \ … … 1197 1197 \ 1198 1198 tprefix \ 1199 inline double len (tname<type> const &a) \1199 inline double length(tname<type> const &a) \ 1200 1200 { \ 1201 1201 using std::sqrt; \ 1202 return sqrt((double)sqlen (a)); \1202 return sqrt((double)sqlength(a)); \ 1203 1203 } \ 1204 1204 \ … … 1206 1206 inline tname<type> normalize(tname<type> const &val) \ 1207 1207 { \ 1208 type norm = (type)len (val); \1208 type norm = (type)length(val); \ 1209 1209 return norm ? val / norm : val * (type)0; \ 1210 1210 } 
trunk/test/tutorial/03_fractal.cpp
r1310 r1369 384 384 z3 = z2 * z2 + r0; 385 385 z0 = z3 * z3 + r0; 386 if (sqlen (z0) >= maxsqlen)386 if (sqlength(z0) >= maxsqlen) 387 387 break; 388 388 iter = 4; … … 393 393 if (iter) 394 394 { 395 double n = sqlen (z0);396 397 if (sqlen (z1) >= maxsqlen) { iter += 3; n = sqlen(z1); }398 else if (sqlen (z2) >= maxsqlen) { iter += 2; n = sqlen(z2); }399 else if (sqlen (z3) >= maxsqlen) { iter += 1; n = sqlen(z3); }395 double n = sqlength(z0); 396 397 if (sqlength(z1) >= maxsqlen) { iter += 3; n = sqlength(z1); } 398 else if (sqlength(z2) >= maxsqlen) { iter += 2; n = sqlength(z2); } 399 else if (sqlength(z3) >= maxsqlen) { iter += 1; n = sqlength(z3); } 400 400 401 401 if (n > maxsqlen * maxsqlen)
Note: See TracChangeset
for help on using the changeset viewer.