1 | /* |
1 | /* |
2 | * static char *rcsid_utils_c = |
2 | * static char *rcsid_utils_c = |
3 | * "$Id: utils.C,v 1.4 2006/09/04 11:07:59 root Exp $"; |
3 | * "$Id: utils.C,v 1.6 2006/09/08 16:51:43 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
304 | |
304 | |
305 | /* set the materialname and type for an item */ |
305 | /* set the materialname and type for an item */ |
306 | void set_materialname(object *op, int difficulty, materialtype_t *nmt) |
306 | void set_materialname(object *op, int difficulty, materialtype_t *nmt) |
307 | { |
307 | { |
308 | materialtype_t *mt, *lmt; |
308 | materialtype_t *mt, *lmt; |
|
|
309 | #ifdef NEW_MATERIAL_CODE |
309 | int j; |
310 | int j; |
|
|
311 | #endif |
310 | |
312 | |
311 | if (op->materialname != NULL) |
313 | if (op->materialname != NULL) |
312 | return; |
314 | return; |
313 | |
315 | |
314 | |
316 | |
… | |
… | |
487 | |
489 | |
488 | //TODO: overhead due to specifying size twice |
490 | //TODO: overhead due to specifying size twice |
489 | void * |
491 | void * |
490 | zero_initialised::operator new (size_t s) |
492 | zero_initialised::operator new (size_t s) |
491 | { |
493 | { |
|
|
494 | printf ("new(%d)\n", s);//D |
492 | return g_slice_alloc0 (s); |
495 | return g_slice_alloc0 (s); |
493 | } |
496 | } |
494 | |
497 | |
495 | void * |
498 | void * |
496 | zero_initialised::operator new [] (size_t s) |
499 | zero_initialised::operator new [] (size_t s) |
497 | { |
500 | { |
|
|
501 | printf ("new[](%d)\n", s);//D |
498 | return g_slice_alloc0 (s); |
502 | return g_slice_alloc0 (s); |
499 | } |
503 | } |
500 | |
504 | |
501 | void |
505 | void |
502 | zero_initialised::operator delete (void *p, size_t s) |
506 | zero_initialised::operator delete (void *p, size_t s) |