//--------------------------------------------------------------------------- DeltaElement::DeltaElement (MemoryPtr _shape, long _x, long _y, long frame, bool rev, MemoryPtr fTable, bool noScale, bool upScale) : Element(-_y) { shapeTable = _shape; x = _x; y = _y; frameNum = frame; reverse = rev; fadeTable = fTable; noScaleDraw = noScale; scaleUp = upScale; //------------------------------------- // Integrity Check here. #ifdef _DEBUG long result = VFX_shape_count(shapeTable); if (result <= frameNum) { frameNum = result-1; } result = VFX_shape_bounds(shapeTable,frameNum); long xMax = result>>16; long yMax = result & 0x0000ffff; #define MAX_X 360 #define MAX_Y 360 if ((yMax * xMax) >= (MAX_Y * MAX_X)) { return; } #endif }
//--------------------------------------------------------------------------- void DeltaElement::draw (void) { { //---------------------------------------------------------------- // Check if shape is actually valid. if ((*(int*)shapeTable!=*(int*)"1.10")) return; //---------------------------------------------------- // DEBUG TEMP Until all are correct delta shapes!!!!!! long result = VFX_shape_count(shapeTable); if (result <= (frameNum+1)) frameNum = result - 2; if (!fadeTable) { AG_shape_draw(globalPane,shapeTable,0,x,y); //KeyFrame First!! AG_shape_draw(globalPane,shapeTable,frameNum+1,x,y); } else { AG_shape_lookaside(fadeTable); AG_shape_translate_draw(globalPane,shapeTable,0,x,y); //KeyFrame First!! AG_shape_translate_draw(globalPane,shapeTable,frameNum+1,x,y); } } }
//--------------------------------------------------------------------------- DeltaElement::DeltaElement(puint8_t _shape, int32_t _x, int32_t _y, int32_t frame, bool rev, puint8_t fTable, bool noScale, bool upScale) : Element(-_y) { shapeTable = _shape; x = _x; y = _y; frameNum = frame; reverse = rev; fadeTable = fTable; noScaleDraw = noScale; scaleUp = upScale; //------------------------------------- // Integrity Check here. #ifdef _DEBUG int32_t result = VFX_shape_count(shapeTable); if(result <= frameNum) { frameNum = result - 1; } result = VFX_shape_bounds(shapeTable, frameNum); int32_t xMax = result >> 16; int32_t yMax = result & 0x0000ffff; #define MAX_X 360 #define MAX_Y 360 if((yMax * xMax) >= (MAX_Y * MAX_X)) { return; } #endif }