(String path)
| 324 | * return the file content as byte[] |
| 325 | */ |
| 326 | public static byte[] LoadFile(String path) { |
| 327 | // TODO hack for bad strings (fuck \0) |
| 328 | int index = path.indexOf('\0'); |
| 329 | if (index != -1) |
| 330 | path = path.substring(0, index); |
| 331 | |
| 332 | try { |
| 333 | QuakeFile file = FOpenFile(path); |
| 334 | if (file == null) { |
| 335 | file = FOpenFile(path.toLowerCase()); |
| 336 | if (file != null) { |
| 337 | // some mods mess up the case |
| 338 | Com.Printf("Found file by lowercase: " + path + "\n"); |
| 339 | } else { |
| 340 | return null; |
| 341 | } |
| 342 | } |
| 343 | return file.toBytes(); |
| 344 | } catch (IOException e) { |
| 345 | Com.Error(Defines.ERR_FATAL, e.toString()); |
| 346 | return null; |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | /** |
| 351 | * Filename are relative to the quake search path a null buffer will just |
no test coverage detected