mirror of
https://github.com/CPunch/Cosmo.git
synced 2026-01-02 22:00:17 +00:00
Added CObj->proto support, state->protoObjects defines default protos for each COBJ type
a lot of refactoring in the VM
This commit is contained in:
@@ -32,7 +32,6 @@ CState *cosmoV_newState() {
|
||||
state->frameCount = 0;
|
||||
state->openUpvalues = NULL;
|
||||
|
||||
state->protoObj = NULL;
|
||||
state->error = NULL;
|
||||
|
||||
cosmoT_initTable(state, &state->strings, 8); // init string table
|
||||
@@ -62,6 +61,10 @@ CState *cosmoV_newState() {
|
||||
// set the IString flags
|
||||
for (int i = 0; i < ISTRING_MAX; i++)
|
||||
state->iStrings[i]->isIString = true;
|
||||
|
||||
// set default proto objects
|
||||
for (int i = 0; i < COBJ_MAX; i++)
|
||||
state->protoObjects[i] = NULL;
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user