From 648ee61ae84216d0236e0dbc211addc13b2cfa3a Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Fri, 6 Jul 2012 11:52:06 -0700 Subject: Expand tabs --- .../RDGE/src/core/script/objectManager.js | 120 ++++++++++----------- 1 file changed, 60 insertions(+), 60 deletions(-) (limited to 'js/helper-classes/RDGE/src/core/script/objectManager.js') diff --git a/js/helper-classes/RDGE/src/core/script/objectManager.js b/js/helper-classes/RDGE/src/core/script/objectManager.js index 66e06cde..cb9847e6 100755 --- a/js/helper-classes/RDGE/src/core/script/objectManager.js +++ b/js/helper-classes/RDGE/src/core/script/objectManager.js @@ -33,66 +33,66 @@ var RDGE = RDGE || {}; /* generic handle-based object manager */ RDGE.objectManager = function() { - this.guidCounter = 0; - this.objects = []; - this.numObjects = 0; - this.freelist = []; - - this.reset = function() { - this.objects = []; - this.freelist = []; - this.guidCounter = 0; - } - - // validHandle - this.validHandle = function(h) { - return this.handleToIndex(h) != -1; - } - - // handleToIndex - this.handleToIndex = function(h) { - var index = ( h >> 16 ) & 0xFFFF; - if( this.objects[index] != null && h == this.objects[index].handle ) { - return index; - } - return -1; - } + this.guidCounter = 0; + this.objects = []; + this.numObjects = 0; + this.freelist = []; + + this.reset = function() { + this.objects = []; + this.freelist = []; + this.guidCounter = 0; + } + + // validHandle + this.validHandle = function(h) { + return this.handleToIndex(h) != -1; + } + + // handleToIndex + this.handleToIndex = function(h) { + var index = ( h >> 16 ) & 0xFFFF; + if( this.objects[index] != null && h == this.objects[index].handle ) { + return index; + } + return -1; + } - // handleToObject - this.handleToObject = function(h) { - var index = this.handleToIndex( h ); - if( index != -1 ) { - return this.objects[index]; - } - return null; - } - - // add object - this.addObject = function(ob) { - var index = this.objects.length; + // handleToObject + this.handleToObject = function(h) { + var index = this.handleToIndex( h ); + if( index != -1 ) { + return this.objects[index]; + } + return null; + } + + // add object + this.addObject = function(ob) { + var index = this.objects.length; - if( this.freelist.length > 0 ) { - index = this.freelist.pop(); - } - if( ++this.guidCounter >= 0xFFFF ) { - // wrap the counter, zero is reserved for invalid handles. - this.guidCounter = 1; - } - ob.handle = ( index << 16 | ++this.guidCounter ); - this.objects[index] = ob; - - return ob.handle; - } - - // remove object - this.removeObject = function(h) { - var index = this.handleToIndex( h ); - if( index != -1 ) { - if( this.objects[index].onremove != undefined ) { - this.objects[index].onremove(); - } - this.objects[index] = null; - this.freelist.push(index); - } - } + if( this.freelist.length > 0 ) { + index = this.freelist.pop(); + } + if( ++this.guidCounter >= 0xFFFF ) { + // wrap the counter, zero is reserved for invalid handles. + this.guidCounter = 1; + } + ob.handle = ( index << 16 | ++this.guidCounter ); + this.objects[index] = ob; + + return ob.handle; + } + + // remove object + this.removeObject = function(h) { + var index = this.handleToIndex( h ); + if( index != -1 ) { + if( this.objects[index].onremove != undefined ) { + this.objects[index].onremove(); + } + this.objects[index] = null; + this.freelist.push(index); + } + } } -- cgit v1.2.3 From 04343eda8c2f870b0da55cfdc8003c99fe1cc4de Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Fri, 6 Jul 2012 11:53:10 -0700 Subject: Remove trailing spaces --- .../RDGE/src/core/script/objectManager.js | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'js/helper-classes/RDGE/src/core/script/objectManager.js') diff --git a/js/helper-classes/RDGE/src/core/script/objectManager.js b/js/helper-classes/RDGE/src/core/script/objectManager.js index cb9847e6..768768ff 100755 --- a/js/helper-classes/RDGE/src/core/script/objectManager.js +++ b/js/helper-classes/RDGE/src/core/script/objectManager.js @@ -37,18 +37,18 @@ RDGE.objectManager = function() { this.objects = []; this.numObjects = 0; this.freelist = []; - + this.reset = function() { this.objects = []; this.freelist = []; this.guidCounter = 0; } - + // validHandle this.validHandle = function(h) { return this.handleToIndex(h) != -1; } - + // handleToIndex this.handleToIndex = function(h) { var index = ( h >> 16 ) & 0xFFFF; @@ -58,35 +58,35 @@ RDGE.objectManager = function() { return -1; } - // handleToObject + // handleToObject this.handleToObject = function(h) { - var index = this.handleToIndex( h ); + var index = this.handleToIndex( h ); if( index != -1 ) { return this.objects[index]; } return null; } - + // add object this.addObject = function(ob) { var index = this.objects.length; if( this.freelist.length > 0 ) { - index = this.freelist.pop(); + index = this.freelist.pop(); } if( ++this.guidCounter >= 0xFFFF ) { // wrap the counter, zero is reserved for invalid handles. this.guidCounter = 1; } - ob.handle = ( index << 16 | ++this.guidCounter ); + ob.handle = ( index << 16 | ++this.guidCounter ); this.objects[index] = ob; - + return ob.handle; } - + // remove object - this.removeObject = function(h) { - var index = this.handleToIndex( h ); + this.removeObject = function(h) { + var index = this.handleToIndex( h ); if( index != -1 ) { if( this.objects[index].onremove != undefined ) { this.objects[index].onremove(); -- cgit v1.2.3 From 3644cb6def4f681c99959e5729e78ea353441fad Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Fri, 6 Jul 2012 12:34:53 -0700 Subject: Normalize to unix line terminators --- .../RDGE/src/core/script/objectManager.js | 196 ++++++++++----------- 1 file changed, 98 insertions(+), 98 deletions(-) (limited to 'js/helper-classes/RDGE/src/core/script/objectManager.js') diff --git a/js/helper-classes/RDGE/src/core/script/objectManager.js b/js/helper-classes/RDGE/src/core/script/objectManager.js index 768768ff..63ace409 100755 --- a/js/helper-classes/RDGE/src/core/script/objectManager.js +++ b/js/helper-classes/RDGE/src/core/script/objectManager.js @@ -1,98 +1,98 @@ -/* -Copyright (c) 2012, Motorola Mobility, Inc -All Rights Reserved. -BSD License. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of Motorola Mobility nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - */ - -// RDGE namespaces -var RDGE = RDGE || {}; - -/* generic handle-based object manager */ -RDGE.objectManager = function() { - this.guidCounter = 0; - this.objects = []; - this.numObjects = 0; - this.freelist = []; - - this.reset = function() { - this.objects = []; - this.freelist = []; - this.guidCounter = 0; - } - - // validHandle - this.validHandle = function(h) { - return this.handleToIndex(h) != -1; - } - - // handleToIndex - this.handleToIndex = function(h) { - var index = ( h >> 16 ) & 0xFFFF; - if( this.objects[index] != null && h == this.objects[index].handle ) { - return index; - } - return -1; - } - - // handleToObject - this.handleToObject = function(h) { - var index = this.handleToIndex( h ); - if( index != -1 ) { - return this.objects[index]; - } - return null; - } - - // add object - this.addObject = function(ob) { - var index = this.objects.length; - - if( this.freelist.length > 0 ) { - index = this.freelist.pop(); - } - if( ++this.guidCounter >= 0xFFFF ) { - // wrap the counter, zero is reserved for invalid handles. - this.guidCounter = 1; - } - ob.handle = ( index << 16 | ++this.guidCounter ); - this.objects[index] = ob; - - return ob.handle; - } - - // remove object - this.removeObject = function(h) { - var index = this.handleToIndex( h ); - if( index != -1 ) { - if( this.objects[index].onremove != undefined ) { - this.objects[index].onremove(); - } - this.objects[index] = null; - this.freelist.push(index); - } - } -} +/* +Copyright (c) 2012, Motorola Mobility, Inc +All Rights Reserved. +BSD License. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + - Neither the name of Motorola Mobility nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + */ + +// RDGE namespaces +var RDGE = RDGE || {}; + +/* generic handle-based object manager */ +RDGE.objectManager = function() { + this.guidCounter = 0; + this.objects = []; + this.numObjects = 0; + this.freelist = []; + + this.reset = function() { + this.objects = []; + this.freelist = []; + this.guidCounter = 0; + } + + // validHandle + this.validHandle = function(h) { + return this.handleToIndex(h) != -1; + } + + // handleToIndex + this.handleToIndex = function(h) { + var index = ( h >> 16 ) & 0xFFFF; + if( this.objects[index] != null && h == this.objects[index].handle ) { + return index; + } + return -1; + } + + // handleToObject + this.handleToObject = function(h) { + var index = this.handleToIndex( h ); + if( index != -1 ) { + return this.objects[index]; + } + return null; + } + + // add object + this.addObject = function(ob) { + var index = this.objects.length; + + if( this.freelist.length > 0 ) { + index = this.freelist.pop(); + } + if( ++this.guidCounter >= 0xFFFF ) { + // wrap the counter, zero is reserved for invalid handles. + this.guidCounter = 1; + } + ob.handle = ( index << 16 | ++this.guidCounter ); + this.objects[index] = ob; + + return ob.handle; + } + + // remove object + this.removeObject = function(h) { + var index = this.handleToIndex( h ); + if( index != -1 ) { + if( this.objects[index].onremove != undefined ) { + this.objects[index].onremove(); + } + this.objects[index] = null; + this.freelist.push(index); + } + } +} -- cgit v1.2.3 From fdbec324dad4ab33d97282ab021d2c1661bc097c Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Mon, 9 Jul 2012 16:27:52 -0700 Subject: BSD License --- .../RDGE/src/core/script/objectManager.js | 23 +++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'js/helper-classes/RDGE/src/core/script/objectManager.js') diff --git a/js/helper-classes/RDGE/src/core/script/objectManager.js b/js/helper-classes/RDGE/src/core/script/objectManager.js index 63ace409..d2f74472 100755 --- a/js/helper-classes/RDGE/src/core/script/objectManager.js +++ b/js/helper-classes/RDGE/src/core/script/objectManager.js @@ -1,24 +1,25 @@ /* -Copyright (c) 2012, Motorola Mobility, Inc +Copyright (c) 2012, Motorola Mobility LLC. All Rights Reserved. -BSD License. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of Motorola Mobility nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of Motorola Mobility LLC nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- cgit v1.2.3