static void copyFromClipboard(Sprite* sprite) { if(sprite->editPalette) pasteColor(sprite); s32 size = sprite->size * sprite->size * TIC_PALETTE_BPP / BITS_IN_BYTE; u8* buffer = malloc(size); if(buffer) { if(fromClipboard(buffer, size, true, false)) { tic_rect rect = getSpriteRect(sprite); s32 r = rect.x + rect.w; s32 b = rect.y + rect.h; for(s32 y = rect.y, i = 0; y < b; y++) for(s32 x = rect.x; x < r; x++) setSheetPixel(sprite, x, y, tic_tool_peek4(buffer, i++)); history_add(sprite->history); } free(buffer); } }
void clsTranslator::pasteLight(LPDIFLIGHT3D obj, FILE* file) { pasteName(obj, file); pasteRotation(obj, file); errno_t bErrorFlag; bErrorFlag = _ftprintf_s(file, _T("Power: %.3f\n"), obj->getPower() ); pasteColor(obj->getColor(), file); }
void clsTranslator::pasteCone(LPCONE3D obj, FILE* file) { errno_t bErrorFlag = _ftprintf_s(file, _T("------------------------------------- CONE --------------------------------------\n") ); pasteName(obj, file); pastePosition(obj, file); pasteRotation(obj, file); bErrorFlag = _ftprintf_s(file, _T("Height: %.3f\n"), obj->getHeight() ); bErrorFlag = _ftprintf_s(file, _T("Base radius: %.3f\n"), obj->getBRadius() ); bErrorFlag = _ftprintf_s(file, _T("Top radius: %.3f\n"), obj->getTRadius() ); bErrorFlag = _ftprintf_s(file, _T("Precision: %.3f\n"), obj->getPrecision() ); pasteColor(obj->getColor(), file); }
void clsTranslator::pastePyramid(LPPYRAMID3D obj, FILE* file) { errno_t bErrorFlag = _ftprintf_s(file, _T("------------------------------------- PYRAMID --------------------------------------\n") ); pasteName(obj, file); pastePosition(obj, file); pasteRotation(obj, file); bErrorFlag = _ftprintf_s(file, _T("Height: %.3f\n"), obj->getHeight() ); bErrorFlag = _ftprintf_s(file, _T("Base length: %.3f\n"), obj->getBLength() ); bErrorFlag = _ftprintf_s(file, _T("Base width: %.3f\n"), obj->getBWidth() ); bErrorFlag = _ftprintf_s(file, _T("Top length: %.3f\n"), obj->getTLength() ); bErrorFlag = _ftprintf_s(file, _T("Top width: %.3f\n"), obj->getTWidth() ); pasteColor(obj->getColor(), file); }
void clsTranslator::pasteTank(LPJAGDPANTHER3D obj, FILE* file) { errno_t bErrorFlag = _ftprintf_s(file, _T("------------------------------------- JAGDPANTHER --------------------------------------\n") ); pasteName(obj, file); pastePosition(obj, file); pasteRotation(obj, file); bErrorFlag = _ftprintf_s(file, _T("Body length: %.3f\n"), obj->getBodyLength() ); bErrorFlag = _ftprintf_s(file, _T("Body width: %.3f\n"), obj->getBodyWidth() ); bErrorFlag = _ftprintf_s(file, _T("Body height: %.3f\n"), obj->getBodyHeight() ); bErrorFlag = _ftprintf_s(file, _T("F-top slope: %.3f\n"), obj->getFTArmSlope() ); bErrorFlag = _ftprintf_s(file, _T("F-bottom slope: %.3f\n"), obj->getFBArmSlope() ); bErrorFlag = _ftprintf_s(file, _T("B-top slope: %.3f\n"), obj->getBTArmSlope() ); bErrorFlag = _ftprintf_s(file, _T("B-b slope: %.3f\n"), obj->getBBArmSlope() ); bErrorFlag = _ftprintf_s(file, _T("Top slope: %.3f\n"), obj->getTopArmSlope() ); bErrorFlag = _ftprintf_s(file, _T("Side slope: %.3f\n"), obj->getSideArmSlope() ); bErrorFlag = _ftprintf_s(file, _T("Cannon length: %.3f\n"), obj->getCannonLength() ); pasteColor(obj->getColor(), file); }
void clsTranslator::pasteMic(LPMICROPHONE3D obj, FILE* file) { errno_t bErrorFlag = _ftprintf_s(file, _T("------------------------------------- MICROPHONE --------------------------------------\n") ); pasteName(obj, file); pastePosition(obj, file); pasteRotation(obj, file); bErrorFlag = _ftprintf_s(file, _T("Total height: %.3f\n"), obj->getTotalHeight() ); bErrorFlag = _ftprintf_s(file, _T("Base radius: %.3f\n"), obj->getBaseRadius() ); bErrorFlag = _ftprintf_s(file, _T("Base height: %.3f\n"), obj->getBaseHeight() ); bErrorFlag = _ftprintf_s(file, _T("Button width: %.3f\n"), obj->getButtonWidth() ); bErrorFlag = _ftprintf_s(file, _T("Upright radius: %.3f\n"), obj->getUprightRadius() ); bErrorFlag = _ftprintf_s(file, _T("Upright height: %.3f\n"), obj->getUprightHeight() ); bErrorFlag = _ftprintf_s(file, _T("Upright gap: %.3f\n"), obj->getUprightGap() ); bErrorFlag = _ftprintf_s(file, _T("Handle indent: %.3f\n"), obj->getHandleIndent() ); bErrorFlag = _ftprintf_s(file, _T("Head radius: %.3f\n"), obj->getHeadRadius() ); bErrorFlag = _ftprintf_s(file, _T("Head deapth: %.3f\n"), obj->getHeadDepth() ); bErrorFlag = _ftprintf_s(file, _T("Core radius: %.3f\n"), obj->getCoreRadius() ); bErrorFlag = _ftprintf_s(file, _T("Precision: %.3f\n"), obj->getPrecision() ); pasteColor(obj->getColor(), file); }
static void drawRGBTools(Sprite* sprite, s32 x, s32 y) { { enum{Size = 5}; static const u8 Icon[] = { 0b11110000, 0b10010000, 0b10111000, 0b11101000, 0b00111000, 0b00000000, 0b00000000, 0b00000000, }; tic_rect rect = {x, y, Size, Size}; bool over = false; bool down = false; if(checkMousePos(&rect)) { setCursor(tic_cursor_hand); showTooltip("COPY PALETTE"); over = true; if(checkMouseDown(&rect, tic_mouse_left)) down = true; if(checkMouseClick(&rect, tic_mouse_left)) toClipboard(getBankPalette()->data, sizeof(tic_palette), false); } if(down) { drawBitIcon(rect.x, rect.y+1, Icon, (tic_color_light_blue)); } else { drawBitIcon(rect.x, rect.y+1, Icon, (tic_color_black)); drawBitIcon(rect.x, rect.y, Icon, (over ? tic_color_light_blue : tic_color_white)); } } { enum{Size = 5}; static const u8 Icon[] = { 0b01110000, 0b10001000, 0b11111000, 0b11011000, 0b11111000, 0b00000000, 0b00000000, 0b00000000, }; tic_rect rect = {x + 8, y, Size, Size}; bool over = false; bool down = false; if(checkMousePos(&rect)) { setCursor(tic_cursor_hand); showTooltip("PASTE PALETTE"); over = true; if(checkMouseDown(&rect, tic_mouse_left)) down = true; if(checkMouseClick(&rect, tic_mouse_left)) { pasteColor(sprite); } } if(down) { drawBitIcon(rect.x, rect.y+1, Icon, (tic_color_light_blue)); } else { drawBitIcon(rect.x, rect.y+1, Icon, (tic_color_black)); drawBitIcon(rect.x, rect.y, Icon, (over ? tic_color_light_blue : tic_color_white)); } } }