.string classname;
-entity vtblObject;
+entity Object_vtbl;
.string vtblname;
.entity vtblbase;
entity spawnVtbl(entity e, entity b)
entity e;
e = spawn();
e.classname = "Object";
- if(!vtblObject)
- vtblObject = spawnVtbl(e, null_entity);
+ if(!Object_vtbl)
+ Object_vtbl = spawnVtbl(e, null_entity);
return e;
}
#undef SUPER
#endif
-#define CLASS(cname) entity spawn##cname(); entity vtbl##cname;
+#define CLASS(cname) entity spawn##cname(); entity cname##_vtbl;
#define EXTENDS(base)
#define METHOD(cname,name,prototype) prototype cname##_##name; .prototype name;
#define ATTRIB(cname,name,type,val) .type name;
#endif
#define CLASS(cname) entity spawn##cname() { entity me;
-#define EXTENDS(base) me = spawn##base (); entity basevtbl; basevtbl = vtbl##base;
+#define EXTENDS(base) me = spawn##base (); entity basevtbl; basevtbl = base##_vtbl;
#define METHOD(cname,name,prototype) me.name = cname##_##name;
#define ATTRIB(cname,name,type,val) me.name = val;
#define ATTRIBARRAY(cname,name,type,cnt) me.name = me.name;
-#define ENDCLASS(cname) me.instanceOf##cname = 1; me.classname = #cname; if(!vtbl##cname) vtbl##cname = spawnVtbl(me, basevtbl); return me; }
+#define ENDCLASS(cname) me.instanceOf##cname = 1; me.classname = #cname; if(!cname##_vtbl) cname##_vtbl = spawnVtbl(me, basevtbl); return me; }
#define SUPER(cname)