| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2010, Google Inc. | 2 * Copyright 2010, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 o3d.ParamObject.prototype.createParam = | 102 o3d.ParamObject.prototype.createParam = |
| 103 function(param_name, param_type_name) { | 103 function(param_name, param_type_name) { |
| 104 if (this.params_[param_name]) | 104 if (this.params_[param_name]) |
| 105 return null; | 105 return null; |
| 106 param_type_name = o3d.filterTypeName_(param_type_name); | 106 param_type_name = o3d.filterTypeName_(param_type_name); |
| 107 if (!o3d.global.o3d[param_type_name]) | 107 if (!o3d.global.o3d[param_type_name]) |
| 108 throw ('Invalid param type name: ' + param_type_name); | 108 throw ('Invalid param type name: ' + param_type_name); |
| 109 var param = new o3d.global.o3d[param_type_name]; | 109 var param = new o3d.global.o3d[param_type_name]; |
| 110 param.gl = this.gl; | 110 param.gl = this.gl; |
| 111 param.owner_ = this; | 111 param.owner_ = this; |
| 112 param.name = param_name; |
| 112 this.params_[param_name] = param; | 113 this.params_[param_name] = param; |
| 113 return this.filterResult_(this.params_[param_name]); | 114 return this.filterResult_(this.params_[param_name]); |
| 114 }; | 115 }; |
| 115 | 116 |
| 116 | 117 |
| 117 /** | 118 /** |
| 118 * Searches by name for a Param defined in the object. | 119 * Searches by name for a Param defined in the object. |
| 119 * | 120 * |
| 120 * @param {string} param_name Name to search for. | 121 * @param {string} param_name Name to search for. |
| 121 * @return {!o3d.Param} The Param with the given name, or null otherwise. | 122 * @return {!o3d.Param} The Param with the given name, or null otherwise. |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 var param = this.getParam(o3dParamName); | 241 var param = this.getParam(o3dParamName); |
| 241 return param.value; | 242 return param.value; |
| 242 }); | 243 }); |
| 243 constructor.prototype.__defineSetter__(fieldName, | 244 constructor.prototype.__defineSetter__(fieldName, |
| 244 function(v) { | 245 function(v) { |
| 245 var param = this.getParam(o3dParamName); | 246 var param = this.getParam(o3dParamName); |
| 246 param.value = v; | 247 param.value = v; |
| 247 }); | 248 }); |
| 248 }; | 249 }; |
| 249 | 250 |
| OLD | NEW |