| 1 |
– |
/* Copyright (c) 1992 Regents of the University of California */ |
| 2 |
– |
|
| 1 |
|
#ifndef lint |
| 2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
| 2 |
> |
static const char RCSid[] = "$Id$"; |
| 3 |
|
#endif |
| 6 |
– |
|
| 4 |
|
/* |
| 5 |
|
* Free memory associated with object(s) |
| 6 |
+ |
* |
| 7 |
+ |
* External symbols declared in ray.h |
| 8 |
|
*/ |
| 9 |
|
|
| 10 |
< |
#include "standard.h" |
| 11 |
< |
#include "object.h" |
| 10 |
> |
#include "copyright.h" |
| 11 |
> |
|
| 12 |
> |
#include "ray.h" |
| 13 |
|
#include "otypes.h" |
| 14 |
+ |
#include "face.h" |
| 15 |
+ |
#include "cone.h" |
| 16 |
+ |
#include "instance.h" |
| 17 |
+ |
#include "data.h" |
| 18 |
+ |
#include "font.h" |
| 19 |
|
|
| 20 |
|
|
| 21 |
|
int |
| 42 |
|
case OBJ_INSTANCE: /* octree instance */ |
| 43 |
|
freeinstance(op); |
| 44 |
|
return(1); |
| 45 |
+ |
case OBJ_MESH: /* mesh instance */ |
| 46 |
+ |
freemeshinst(op); |
| 47 |
+ |
return(1); |
| 48 |
|
case PAT_BTEXT: /* monochromatic text */ |
| 49 |
|
case PAT_CTEXT: /* colored text */ |
| 50 |
|
case MIX_TEXT: /* mixing text */ |
| 51 |
|
freetext(op); |
| 52 |
|
return(1); |
| 53 |
|
case MAT_CLIP: /* clipping surface */ |
| 54 |
< |
free(op->os); |
| 54 |
> |
case MAT_SPOT: /* spot light source */ |
| 55 |
> |
free((void *)op->os); |
| 56 |
|
op->os = NULL; |
| 57 |
|
return(1); |
| 58 |
< |
case MAT_SPOT: /* spot light source */ |
| 50 |
< |
return(0); |
| 51 |
< |
default: |
| 58 |
> |
} |
| 59 |
|
#ifdef DEBUG |
| 60 |
< |
objerror(op, WARNING, "cannot free structure"); |
| 60 |
> |
objerror(op, WARNING, "cannot free structure"); |
| 61 |
|
#endif |
| 62 |
< |
return(0); |
| 56 |
< |
} |
| 62 |
> |
return(0); |
| 63 |
|
} |
| 64 |
|
|
| 65 |
|
|
| 80 |
|
} |
| 81 |
|
|
| 82 |
|
|
| 83 |
+ |
void |
| 84 |
|
free_objmem() /* free all object cache memory */ |
| 85 |
|
{ |
| 86 |
|
free_objs(0, nobjects); |
| 87 |
|
freedata(NULL); |
| 81 |
– |
freepict(NULL); |
| 88 |
|
freefont(NULL); |
| 89 |
|
} |