From ce21abe9c4c58d7c7d986fb01824ab107081ad2f Mon Sep 17 00:00:00 2001 From: F1F7Y <64418963+F1F7Y@users.noreply.github.com> Date: Mon, 2 Sep 2024 17:50:37 +0200 Subject: vscript: Move squirrel types to their respective files (#788) Refactor logic to move Squirrel types to their own respective files and extend existing layouts in the process where applicable. Contains additional smaller fixes. --- primedev/scripts/scriptjson.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'primedev/scripts/scriptjson.cpp') diff --git a/primedev/scripts/scriptjson.cpp b/primedev/scripts/scriptjson.cpp index 8959bf47..91553ae3 100644 --- a/primedev/scripts/scriptjson.cpp +++ b/primedev/scripts/scriptjson.cpp @@ -9,8 +9,8 @@ #undef GetObject // fuck microsoft developers #endif -template void -DecodeJsonArray(HSquirrelVM* sqvm, rapidjson::GenericValue, rapidjson::MemoryPoolAllocator>* arr) +template +void DecodeJsonArray(HSQUIRRELVM sqvm, rapidjson::GenericValue, rapidjson::MemoryPoolAllocator>* arr) { g_pSquirrel->newarray(sqvm, 0); @@ -48,8 +48,8 @@ DecodeJsonArray(HSquirrelVM* sqvm, rapidjson::GenericValue } } -template void -DecodeJsonTable(HSquirrelVM* sqvm, rapidjson::GenericValue, rapidjson::MemoryPoolAllocator>* obj) +template +void DecodeJsonTable(HSQUIRRELVM sqvm, rapidjson::GenericValue, rapidjson::MemoryPoolAllocator>* obj) { g_pSquirrel->newtable(sqvm); @@ -107,7 +107,7 @@ template void EncodeJSONTable( { for (int i = 0; i < table->_numOfNodes; i++) { - tableNode* node = &table->_nodes[i]; + SQTable::_HashNode* node = &table->_nodes[i]; if (node->key._Type == OT_STRING) { rapidjson::GenericValue, rapidjson::MemoryPoolAllocator> newObj(rapidjson::kObjectType); @@ -240,7 +240,7 @@ ADD_SQFUNC( doc.SetObject(); // temp until this is just the func parameter type - HSquirrelVM* vm = (HSquirrelVM*)sqvm; + HSQUIRRELVM vm = (HSQUIRRELVM)sqvm; SQTable* table = vm->_stackOfCurrentFunction[1]._VAL.asTable; EncodeJSONTable(table, &doc, doc.GetAllocator()); -- cgit v1.2.3