| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 */ | 114 */ |
| 115 o3d.writeScriptTag_ = function(src) { | 115 o3d.writeScriptTag_ = function(src) { |
| 116 var doc = o3d.global.document; | 116 var doc = o3d.global.document; |
| 117 if (typeof doc != 'undefined') { | 117 if (typeof doc != 'undefined') { |
| 118 doc.write('<script type="text/javascript" src="' + | 118 doc.write('<script type="text/javascript" src="' + |
| 119 src + '"></' + 'script>'); | 119 src + '"></' + 'script>'); |
| 120 } | 120 } |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 /** | 123 /** |
| 124 * Filters any "o3d." prefix from the given type name. |
| 125 * @param {string} type_name The type name to filter. |
| 126 * @return {string} Filtered type name. |
| 127 * @private |
| 128 */ |
| 129 o3d.filterTypeName_ = function(type_name) { |
| 130 if (type_name.length >= 4 && type_name.substr(0, 4) == 'o3d.') { |
| 131 type_name = type_name.substr(4); |
| 132 } |
| 133 return type_name; |
| 134 }; |
| 135 |
| 136 /** |
| 124 * Includes the file indicated by the rule by adding a script tag. | 137 * Includes the file indicated by the rule by adding a script tag. |
| 125 * @param {string} rule Rule to include, in the form o3d.package.part. | 138 * @param {string} rule Rule to include, in the form o3d.package.part. |
| 126 */ | 139 */ |
| 127 o3d.include = function(rule) { | 140 o3d.include = function(rule) { |
| 128 var parts = rule.split('.'); | 141 var parts = rule.split('.'); |
| 129 var path = parts[parts.length - 1] + '.js'; | 142 var path = parts[parts.length - 1] + '.js'; |
| 130 o3d.writeScriptTag_(o3d.basePath + path); | 143 o3d.writeScriptTag_(o3d.basePath + path); |
| 131 }; | 144 }; |
| 132 | 145 |
| 133 | 146 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 o3d.include('draw_element'); | 226 o3d.include('draw_element'); |
| 214 o3d.include('element'); | 227 o3d.include('element'); |
| 215 o3d.include('field'); | 228 o3d.include('field'); |
| 216 o3d.include('buffer'); | 229 o3d.include('buffer'); |
| 217 o3d.include('stream'); | 230 o3d.include('stream'); |
| 218 o3d.include('stream_bank'); | 231 o3d.include('stream_bank'); |
| 219 o3d.include('primitive'); | 232 o3d.include('primitive'); |
| 220 o3d.include('shape'); | 233 o3d.include('shape'); |
| 221 o3d.include('effect'); | 234 o3d.include('effect'); |
| 222 o3d.include('material'); | 235 o3d.include('material'); |
| 236 o3d.include('archive_request'); |
| 223 | 237 |
| 224 | 238 |
| OLD | NEW |