| 2114 | } |
| 2115 | |
| 2116 | void ClearScriptData() |
| 2117 | { |
| 2118 | memset(scriptCode, 0, SCRIPTDATA_COUNT * sizeof(int)); |
| 2119 | memset(jumpTable, 0, JUMPTABLE_COUNT * sizeof(int)); |
| 2120 | |
| 2121 | scriptFrameCount = 0; |
| 2122 | |
| 2123 | scriptCodePos = 0; |
| 2124 | jumpTablePos = 0; |
| 2125 | jumpTableStackPos = 0; |
| 2126 | functionStackPos = 0; |
| 2127 | |
| 2128 | scriptCodePos = 0; |
| 2129 | scriptCodeOffset = 0; |
| 2130 | jumpTablePos = 0; |
| 2131 | jumpTableOffset = 0; |
| 2132 | |
| 2133 | #if RETRO_USE_COMPILER |
| 2134 | scriptFunctionCount = 0; |
| 2135 | #endif |
| 2136 | |
| 2137 | aliasCount = COMMONALIAS_COUNT; |
| 2138 | lineID = 0; |
| 2139 | |
| 2140 | ClearGraphicsData(); |
| 2141 | ClearAnimationData(); |
| 2142 | |
| 2143 | for (int p = 0; p < PLAYER_COUNT; ++p) { |
| 2144 | playerList[p].animationFile = GetDefaultAnimationRef(); |
| 2145 | playerList[p].boundEntity = &objectEntityList[p]; |
| 2146 | } |
| 2147 | |
| 2148 | for (int o = 0; o < OBJECT_COUNT; ++o) { |
| 2149 | ObjectScript *scriptInfo = &objectScriptList[o]; |
| 2150 | scriptInfo->subMain.scriptCodePtr = SCRIPTDATA_COUNT - 1; |
| 2151 | scriptInfo->subMain.jumpTablePtr = JUMPTABLE_COUNT - 1; |
| 2152 | scriptInfo->subPlayerInteraction.scriptCodePtr = SCRIPTDATA_COUNT - 1; |
| 2153 | scriptInfo->subPlayerInteraction.jumpTablePtr = JUMPTABLE_COUNT - 1; |
| 2154 | scriptInfo->subDraw.scriptCodePtr = SCRIPTDATA_COUNT - 1; |
| 2155 | scriptInfo->subDraw.jumpTablePtr = JUMPTABLE_COUNT - 1; |
| 2156 | scriptInfo->subStartup.scriptCodePtr = SCRIPTDATA_COUNT - 1; |
| 2157 | scriptInfo->subStartup.jumpTablePtr = JUMPTABLE_COUNT - 1; |
| 2158 | scriptInfo->frameListOffset = 0; |
| 2159 | scriptInfo->spriteSheetID = 0; |
| 2160 | scriptInfo->animFile = GetDefaultAnimationRef(); |
| 2161 | scriptInfo->mobile = true; |
| 2162 | typeNames[o][0] = 0; |
| 2163 | } |
| 2164 | |
| 2165 | for (int f = 0; f < FUNCTION_COUNT; ++f) { |
| 2166 | scriptFunctionList[f].ptr.scriptCodePtr = SCRIPTDATA_COUNT - 1; |
| 2167 | scriptFunctionList[f].ptr.jumpTablePtr = JUMPTABLE_COUNT - 1; |
| 2168 | } |
| 2169 | |
| 2170 | SetObjectTypeName((char *)"Blank Object", 0); |
| 2171 | |
| 2172 | for (int s = 0; s < COLSTORE_COUNT; s++) { |
| 2173 | collisionStorage[s].entityNo = -1; |
no test coverage detected