void Effect15::Init() { for (int i = 0; i < 42; i++) { fx15Colors[i] = (int)MixColor((rand()%1000) / 1000.f, 0x83301F , 0x441910); fx15Durations[i] = (rand() % 500) + 800.f; fx15Phases[i] = (rand() % 6000) / 1000.f; } }
void CXTPHeaderCtrlThemeOffice2003::OnDrawBackground(LPDRAWITEMSTRUCT lpDIS) { CRect rcItem(lpDIS->rcItem); CDC* pDC = CDC::FromHandle(lpDIS->hDC); // fill background pDC->FillSolidRect(&rcItem, m_cr3DFace); rcItem.right += 2; // draw 3D borders. pDC->Draw3dRect(&rcItem, m_cr3DHighLight, MixColor(m_cr3DFace, m_cr3DShadow, 0.6)); CXTPPenDC penDC(lpDIS->hDC, MixColor(m_cr3DFace, m_cr3DShadow, 0.4)); pDC->MoveTo(rcItem.left, rcItem.bottom-2); pDC->LineTo(rcItem.right, rcItem.bottom-2); penDC.Color(MixColor(m_cr3DFace, m_cr3DShadow, 0.25)); pDC->MoveTo(rcItem.left, rcItem.bottom-3); pDC->LineTo(rcItem.right, rcItem.bottom-3); }
void Effect07::Do(float timer, int pos, int row) { DWORD color = MixColor(timer * 0.0004f, 0x00000000, 0xffffffff, true); color |= (DWORD)0xffffff; for (int i = 0; i < scene->spriteList[0]->nrSprites; i++) { scene->spriteList[0]->sprite[i].diffuse = color; } float z = -4; if (status == 1) { float timeDif = (timer - tempTimer[1]) * 0.001f; z += (timeDif * timeDif) * 0.7f; for (int i = 0; i < scene->spriteList[0]->nrSprites; i++) { scene->spriteList[0]->sprite[i].x = fx07Centers[i].x; scene->spriteList[0]->sprite[i].y = fx07Centers[i].y; scene->spriteList[0]->sprite[i].x += fx07Directions[i].x * (timeDif * timeDif) * 0.3f; scene->spriteList[0]->sprite[i].y += fx07Directions[i].y * (timeDif * timeDif) * 0.3f; } } scene->camera->SetLocation(0, 0, z); scene->camera->SetTarget(0, 0, z + 4); //pyramid->SetRenderTarget(renderChain->GetOriginal()); //pyramid->ClearBuffers(CLEAR_SCREEN | CLEAR_ZBUFFER, 0x0); scene->Render(); //pyramid->ResetRenderTarget(); //postProcessor->psBrightPass->SetLuminance(0.02f); //postProcessor->psBloom->SetBloomScale(0.8f); //postProcessor->chainGlow01->Render(); //pyramid->SetTexture(renderChain->GetSource(), 0); //drawer2D->BeginScene(BLEND_ADD); //drawer2D->DrawFullscreen(); //drawer2D->EndScene(); }
void CPainter::DrawPoint(const CPoint& Point, const CRGBColor& PointColor) { CPoint RealPoint = (m_pWindow != 0) ? Point + m_pWindow->GetClientRect().TopLeft() : Point; if (CRect(0, 0, m_pSurface->w, m_pSurface->h).HitTest(RealPoint) == CRect::RELPOS_INSIDE) { LockSurface(); Uint8* PixelOffset = static_cast<Uint8*>(m_pSurface->pixels) + m_pSurface->format->BytesPerPixel * RealPoint.XPos() + m_pSurface->pitch * RealPoint.YPos(); switch (m_pSurface->format->BytesPerPixel) { case 1: // 8 bpp *reinterpret_cast<Uint8*>(PixelOffset) = static_cast<Uint8>(MixColor(ReadPoint(Point), PointColor).SDLColor(m_pSurface->format)); break; case 2: // 16 bpp *reinterpret_cast<Uint16*>(PixelOffset) = static_cast<Uint16>(MixColor(ReadPoint(Point), PointColor).SDLColor(m_pSurface->format)); break; case 3: // 24 bpp { Uint32 PixelColor = MixColor(ReadPoint(Point), PointColor).SDLColor(m_pSurface->format); Uint8* pPixelSource = reinterpret_cast<Uint8*>(&PixelColor); Uint8* pPixelDest = reinterpret_cast<Uint8*>(PixelOffset); *pPixelDest = *pPixelSource; *(++pPixelDest) = *(++pPixelSource); *(++pPixelDest) = *(++pPixelSource); break; } case 4: // 32 bpp *reinterpret_cast<Uint32*>(PixelOffset) = static_cast<Uint32>(MixColor(ReadPoint(Point), PointColor).SDLColor(m_pSurface->format)); break; default: throw(Wg_Ex_SDL("CPainter::DrawPoint : Unrecognized BytesPerPixel.")); break; } UnlockSurface(); } }
void ConvertBmp32WithAlphaToBmp32WithoutAlpha (CBitmap& bmp, COLORREF clrBk) { int w, h; BITMAP bm; bmp.GetBitmap (&bm); h = bm.bmHeight; w = bm.bmWidth; DWORD* pdwBmp32plusA = new DWORD [w*h]; bmp.GetBitmapBits (w*h*4, pdwBmp32plusA); DWORD* pdwBmp32 = new DWORD [w*h]; for (int i = 0; i < h; i++) { for (int k = 0; k < w; k++) { BmpColor clr = MixColor (pdwBmp32plusA [i*w+k], clrBk); pdwBmp32 [(h-1)*w - i*w + k] = clr.clr; } } bmp.DeleteObject (); HDC dc = GetDC (NULL); bmp.CreateCompatibleBitmap (CDC::FromHandle (dc), w, h); BITMAPINFO bi; ZeroMemory (&bi, sizeof (bi)); bi.bmiHeader.biSize = sizeof (BITMAPINFOHEADER); bi.bmiHeader.biWidth = w; bi.bmiHeader.biHeight = h; bi.bmiHeader.biPlanes = 1; bi.bmiHeader.biCompression = BI_RGB; bi.bmiHeader.biBitCount = 32; SetDIBits (dc, bmp, 0, h, pdwBmp32, &bi, DIB_RGB_COLORS); delete [] pdwBmp32plusA; delete [] pdwBmp32; }
void CInformationPanel::DrawProgramInfoPrevNextButton( HDC hdc,const RECT &Rect,bool fNext,bool fEnabled,bool fHot) const { const TVTest::Theme::Style &Style= fEnabled && fHot?m_Theme.ButtonHotStyle:m_Theme.ButtonStyle; TVTest::Theme::Draw(hdc,Rect,Style.Back); HBRUSH hbr; POINT Points[3]; if (!fNext) { Points[0].x=Rect.right-5; Points[0].y=Rect.top+3; Points[1].x=Points[0].x; Points[1].y=Rect.bottom-4; Points[2].x=Rect.left+4; Points[2].y=Rect.top+(Rect.bottom-Rect.top)/2; } else { Points[0].x=Rect.left+4; Points[0].y=Rect.top+3; Points[1].x=Points[0].x; Points[1].y=Rect.bottom-4; Points[2].x=Rect.right-5; Points[2].y=Rect.top+(Rect.bottom-Rect.top)/2; } if (fEnabled) { hbr=::CreateSolidBrush(Style.Fore.Fill.GetSolidColor()); } else { hbr=::CreateSolidBrush(MixColor( Style.Back.Fill.GetSolidColor(), Style.Fore.Fill.GetSolidColor())); } HGDIOBJ hOldBrush=::SelectObject(hdc,hbr); HGDIOBJ hOldPen=::SelectObject(hdc,::GetStockObject(NULL_PEN)); ::Polygon(hdc,Points,3); ::SelectObject(hdc,hOldPen); ::SelectObject(hdc,hOldBrush); ::DeleteObject(hbr); }
void Effect17::Do(float timer, int pos, int row) { if (status == 5) { int index = 0; for (int i = 0; i < nrFx17Lines; i++) { DWORD color = MixColor((timer - tempTimer[5]) * 0.0005f, fx17FinalColors[i], 0xffffff); fx17Batch->vertex[index++].diffuse = color; fx17Batch->vertex[index++].diffuse = color; fx17Batch->vertex[index++].diffuse = color; fx17Batch->vertex[index++].diffuse = color; } } pyramid->SetTexture(NULL, 0); drawer2D->BeginScene(BLEND_NONE); drawer2D->DrawBatch(fx17Batch); drawer2D->EndScene(); }
void Effect13::Do(float timer, int pos, int row) { //if (timer > 2000 && status == 0) Receive(1, timer, 0, 0); //if (timer > 4000 && status == 1) Receive(2, timer, 0, 0); //if (timer > 6000 && status == 2) Receive(3, timer, 0, 0); float fadeOut = 0; if (status == 3) { fadeOut = (timer - tempTimer[3]) * 0.00045f; } background = 0; const DWORD color1 = 0x91853B; const DWORD color2 = 0xCBB330; float x1 = 10; float y1 = 20; float x2 = 800 - x1; float y2 = 600 - y1; pyramid->SetTexture(NULL, 0); drawer2D->BeginScene(BLEND_NONE); float xOffset = (x2 - x1) * timer * 0.0005f; float yOffset = (y2 - y1) * timer * 0.0005f; if (xOffset > (x2 - x1)) xOffset = x2 - x1; if (yOffset > (y2 - y1)) yOffset = y2 - y1; if (status >= 1) { DWORD color = MixColor(fadeOut, color1, 0x000000); float yy = y1 + (timer - tempTimer[1]) * 0.3f; if (yy > y2) yy = y2; drawer2D->Draw(x1, y1, color, x2, y1, color, x1, yy, color, x2, yy, color); } if (status >= 2) { DWORD color = MixColor(fadeOut, color2, 0x000000); for (int i = 0; i < 139; i++) { float yy = y1 + (i * 4) + 4; float xx = x1 + (timer - tempTimer[2]) * 0.3f; if (xx > x2) xx = x2; drawer2D->Draw(x1, yy, color, xx, yy, color, x1, yy + 1, color, xx, yy + 1, color); } } DWORD color = MixColor(fadeOut, 0xffffff, 0x000000); drawer2D->Draw(x1, y1, color, x1 + xOffset, y1, color, x1, y1 + 1, color, x1 + xOffset, y1 + 1, color); drawer2D->Draw( x2 - xOffset, y2 - 1, color, x2, y2 - 1, color, x2 - xOffset, y2, color, x2, y2, color); drawer2D->Draw(x1, y1, color, x1 + 1, y1, color, x1, y1 + yOffset, color, x1 + 1, y1 + yOffset, color); drawer2D->Draw(x2 - 1, y2 - yOffset, color, x2, y2 - yOffset, color, x2 - 1, y2, color, x2, y2, color); drawer2D->EndScene(); }
bool COSDManager::ShowChannelOSD(const CChannelInfo *pInfo,bool fChanging) { if (m_pEventHandler==NULL || pInfo==NULL) return false; CAppMain &App=GetAppClass(); CCoreEngine &CoreEngine=*App.GetCoreEngine(); HWND hwnd; RECT rc; bool fForcePseudoOSD=false; if (!m_pEventHandler->GetOSDWindow(&hwnd,&rc,&fForcePseudoOSD)) return false; COSDOptions::ChannelChangeType ChangeType=m_pOptions->GetChannelChangeType(); HBITMAP hbmLogo=NULL; int LogoWidth=0,LogoHeight=0; unsigned int ImageEffect=0; if (ChangeType!=COSDOptions::CHANNELCHANGE_TEXTONLY) { hbmLogo=App.GetLogoManager()->GetAssociatedLogoBitmap( pInfo->GetNetworkID(),pInfo->GetServiceID(),CLogoManager::LOGOTYPE_BIG); if (hbmLogo!=NULL) { #ifndef TVH264_FOR_1SEG LogoHeight=36; #else LogoHeight=18; #endif LogoWidth=LogoHeight*16/9; ImageEffect=fChanging? CPseudoOSD::IMAGEEFFECT_DARK:CPseudoOSD::IMAGEEFFECT_GLOSS; } if (ChangeType==COSDOptions::CHANNELCHANGE_LOGOONLY && hbmLogo!=NULL) { m_OSD.Create(hwnd,m_pOptions->GetLayeredWindow()); m_OSD.SetImage(hbmLogo,ImageEffect); m_OSD.SetPosition(rc.left+8,rc.top+8,LogoWidth,LogoHeight); m_OSD.SetOpacity(m_pOptions->GetOpacity()); m_OSD.Show(m_pOptions->GetFadeTime(), !fChanging && !m_OSD.IsVisible()); return true; } } TCHAR szText[4+MAX_CHANNEL_NAME]; int Length=0; if (pInfo->GetChannelNo()!=0) Length=StdUtil::snprintf(szText,lengthof(szText),TEXT("%d "),pInfo->GetChannelNo()); StdUtil::snprintf(szText+Length,lengthof(szText)-Length,TEXT("%s"),pInfo->GetName()); if (!m_pOptions->GetPseudoOSD() && !fForcePseudoOSD && CoreEngine.m_DtvEngine.m_MediaViewer.IsDrawTextSupported()) { if (hbmLogo!=NULL) { m_OSD.Create(hwnd,m_pOptions->GetLayeredWindow()); m_OSD.SetImage(hbmLogo,ImageEffect); m_OSD.SetPosition(rc.left+8,rc.top+8,LogoWidth,LogoHeight); m_OSD.SetOpacity(m_pOptions->GetOpacity()); m_OSD.Show(m_pOptions->GetFadeTime(), !fChanging && !m_OSD.IsVisible()); } if (ChangeType!=COSDOptions::CHANNELCHANGE_LOGOONLY) { RECT rcSrc; if (CoreEngine.m_DtvEngine.m_MediaViewer.GetSourceRect(&rcSrc)) { LOGFONT lf; HFONT hfont; ::GetObject(::GetStockObject(DEFAULT_GUI_FONT),sizeof(LOGFONT),&lf); lf.lfHeight=(rcSrc.right-rcSrc.left)/20; lf.lfWidth=0; lf.lfQuality=NONANTIALIASED_QUALITY; hfont=::CreateFontIndirect(&lf); int Rate,Factor; if (!App.GetUICore()->GetZoomRate(&Rate,&Factor)) { if ((rc.right-rc.left)/(rcSrc.right-rcSrc.left)< (rc.bottom-rc.top)/(rcSrc.bottom-rcSrc.top)) { Rate=rc.right-rc.left; Factor=rcSrc.right-rcSrc.left; } else { Rate=rc.bottom-rc.top; Factor=rcSrc.bottom-rcSrc.top; } } if (Rate!=0) { rcSrc.left+=8*Factor/Rate; rcSrc.top+=(rc.top+8)*Factor/Rate; if (hbmLogo!=NULL) rcSrc.left+=LogoWidth*Factor/Rate; } else { rcSrc.left+=16; rcSrc.top+=48; } if (CoreEngine.m_DtvEngine.m_MediaViewer.DrawText(szText, rcSrc.left,rcSrc.top,hfont, m_pOptions->GetTextColor(),m_pOptions->GetOpacity())) { if (m_pOptions->GetFadeTime()>0) m_pEventHandler->SetOSDHideTimer(m_pOptions->GetFadeTime()); } ::DeleteObject(hfont); } } } else { int TextHeight; SIZE sz; COLORREF cr; TextHeight=max((rc.right-rc.left)/24,12); m_OSD.Create(hwnd,m_pOptions->GetLayeredWindow()); m_OSD.SetTextHeight(TextHeight); m_OSD.SetText(szText,hbmLogo,LogoWidth,LogoHeight,ImageEffect); m_OSD.CalcTextSize(&sz); m_OSD.SetPosition(rc.left+8,rc.top+8, sz.cx+8+LogoWidth,max(sz.cy+8,LogoHeight)); if (fChanging) cr=MixColor(m_pOptions->GetTextColor(),RGB(0,0,0),160); else cr=m_pOptions->GetTextColor(); m_OSD.SetTextColor(cr); m_OSD.SetOpacity(m_pOptions->GetOpacity()); m_OSD.Show(m_pOptions->GetFadeTime(), !fChanging && !m_OSD.IsVisible()); } return true; }
void CSideBar::Draw(HDC hdc,const RECT &PaintRect) { RECT rcClient,rc; GetClientRect(&rcClient); rc=rcClient; if (m_fVertical) { rc.top=PaintRect.top; rc.bottom=PaintRect.bottom; } else { rc.left=PaintRect.left; rc.right=PaintRect.right; } TVTest::Theme::CThemeDraw ThemeDraw(BeginThemeDraw(hdc)); TVTest::Theme::BackgroundStyle BackStyle; BackStyle=m_Theme.ItemStyle.Back; if (!m_fVertical && BackStyle.Fill.Type==TVTest::Theme::FILL_GRADIENT) BackStyle.Fill.Gradient.Rotate(TVTest::Theme::GradientStyle::ROTATE_RIGHT); ThemeDraw.Draw(BackStyle,rc); HDC hdcMemory=::CreateCompatibleDC(hdc); HBITMAP hbmOld=static_cast<HBITMAP>(::GetCurrentObject(hdcMemory,OBJ_BITMAP)); for (int i=0;i<(int)m_ItemList.size();i++) { GetItemRect(i,&rc); if (m_ItemList[i].Command!=ITEM_SEPARATOR && rc.left<PaintRect.right && rc.right>PaintRect.left && rc.top<PaintRect.bottom && rc.bottom>PaintRect.top) { const bool fHot=m_HotItem==i; COLORREF ForeColor; BYTE Opacity=255; RECT rcItem; if (fHot) { TVTest::Theme::Style Style=m_Theme.HighlightItemStyle; if (!m_fVertical && Style.Back.Fill.Type==TVTest::Theme::FILL_GRADIENT) Style.Back.Fill.Gradient.Rotate(TVTest::Theme::GradientStyle::ROTATE_RIGHT); if (m_ItemList[i].IsChecked()) Style.Back.Border=m_Theme.CheckItemStyle.Back.Border; ThemeDraw.Draw(Style.Back,rc); ForeColor=m_Theme.HighlightItemStyle.Fore.Fill.GetSolidColor(); } else { if (m_ItemList[i].IsChecked()) { TVTest::Theme::Style Style=m_Theme.CheckItemStyle; if (!m_fVertical && Style.Back.Fill.Type==TVTest::Theme::FILL_GRADIENT) Style.Back.Fill.Gradient.Rotate(TVTest::Theme::GradientStyle::ROTATE_RIGHT); ThemeDraw.Draw(Style.Back,rc); ForeColor=m_Theme.CheckItemStyle.Fore.Fill.GetSolidColor(); } else { ForeColor=m_Theme.ItemStyle.Fore.Fill.GetSolidColor(); } if (m_ItemList[i].IsDisabled()) { #if 0 ForeColor=MixColor(ForeColor, m_Theme.ItemStyle.Fore.Fill.GetSolidColor()); #else Opacity=128; #endif } } rcItem.left=rc.left+m_Style.ItemPadding.Left; rcItem.top=rc.top+m_Style.ItemPadding.Top; rcItem.right=rcItem.left+m_Style.IconSize.Width; rcItem.bottom=rcItem.top+m_Style.IconSize.Height; bool fIconDrew=false; if (m_pEventHandler!=NULL) { DrawIconInfo Info; Info.Command=m_ItemList[i].Command; Info.State=m_ItemList[i].State; if (fHot) Info.State|=ITEM_STATE_HOT; Info.hdc=hdc; Info.IconRect=rcItem; Info.Color=ForeColor; Info.Opacity=Opacity; Info.hdcBuffer=hdcMemory; if (m_pEventHandler->DrawIcon(&Info)) fIconDrew=true; } if (!fIconDrew && m_ItemList[i].Icon>=0) { m_Icons.Draw(hdc,rcItem.left,rcItem.top, m_Style.IconSize.Width,m_Style.IconSize.Height, m_ItemList[i].Icon,ForeColor,Opacity); } } } ::SelectObject(hdcMemory,hbmOld); ::DeleteDC(hdcMemory); ThemeDraw.Draw(m_Theme.Border,rcClient); }
bool CColorScheme::Load(LPCTSTR pszFileName,bool fLegacy) { CSettings Settings; TCHAR szText[MAX_COLORSCHEME_NAME]; int i; if (!Settings.Open(pszFileName,TEXT("ColorScheme"),CSettings::OPEN_READ)) return false; if (Settings.Read(TEXT("Name"),szText,lengthof(szText))) SetName(szText); ::ZeroMemory(m_LoadedFlags,sizeof(m_LoadedFlags)); for (i=0;i<NUM_COLORS;i++) { if (Settings.ReadColor((fLegacy?m_ColorInfoLegacyList:m_ColorInfoList)[i].pszText,&m_ColorList[i])) SetLoadedFlag(i); } for (i=0;i<NUM_COLORS;i++) { if (IsLoaded(i)) { for (int j=0;j<NUM_GRADIENTS;j++) { if (m_GradientInfoList[j].Color1==i || m_GradientInfoList[j].Color2==i) { if (m_GradientInfoList[j].Color1==i && !IsLoaded(m_GradientInfoList[j].Color2)) { m_ColorList[m_GradientInfoList[j].Color2]=m_ColorList[i]; SetLoadedFlag(m_GradientInfoList[j].Color2); } m_GradientList[j].Type=Theme::GRADIENT_NORMAL; break; } } } else { static const struct { int To,From; } Map[] = { // {COLOR_STATUSBORDER, COLOR_STATUSBACK1}, {COLOR_STATUSBOTTOMITEMBACK1, COLOR_STATUSBACK2}, {COLOR_STATUSBOTTOMITEMBACK2, COLOR_STATUSBOTTOMITEMBACK1}, {COLOR_STATUSBOTTOMITEMTEXT, COLOR_STATUSTEXT}, {COLOR_STATUSBOTTOMITEMBORDER, COLOR_STATUSBOTTOMITEMBACK1}, }; static const struct { int To,From1,From2; } MixMap[] = { {COLOR_STATUSBORDER, COLOR_STATUSBACK1, COLOR_STATUSBACK2}, }; bool fFound=false; for (int j=0;j<lengthof(Map);j++) { if (Map[j].To==i && IsLoaded(Map[j].From)) { m_ColorList[i]=m_ColorList[Map[j].From]; SetLoadedFlag(i); fFound=true; break; } } if (!fFound) { for (int j=0;j<lengthof(MixMap);j++) { if (MixMap[j].To==i && IsLoaded(MixMap[j].From1) && IsLoaded(MixMap[j].From2)) { m_ColorList[i]=MixColor(m_ColorList[MixMap[j].From1],m_ColorList[MixMap[j].From2]); SetLoadedFlag(i); break; } } } } } for (i=0;i<NUM_GRADIENTS;i++) { if (Settings.Read(m_GradientInfoList[i].pszText,szText,lengthof(szText))) { if (szText[0]=='\0' || ::lstrcmpi(szText,TEXT("normal"))==0) m_GradientList[i].Type=Theme::GRADIENT_NORMAL; else if (::lstrcmpi(szText,TEXT("glossy"))==0) m_GradientList[i].Type=Theme::GRADIENT_GLOSSY; else if (::lstrcmpi(szText,TEXT("interlaced"))==0) m_GradientList[i].Type=Theme::GRADIENT_INTERLACED; } TCHAR szName[128]; ::wsprintf(szName,TEXT("%sDirection"),m_GradientInfoList[i].pszText); m_GradientList[i].Direction=m_GradientInfoList[i].Direction; if (Settings.Read(szName,szText,lengthof(szText))) { for (int j=0;j<lengthof(GradientDirectionList);j++) { if (::lstrcmpi(szText,GradientDirectionList[j])==0) { m_GradientList[i].Direction=(Theme::GradientDirection)j; break; } } } } Settings.Close(); for (i=0;i<NUM_BORDERS;i++) m_BorderList[i]=m_BorderInfoList[i].DefaultType; if (Settings.Open(pszFileName,TEXT("Style"),CSettings::OPEN_READ)) { for (i=0;i<NUM_BORDERS;i++) { if (Settings.Read(m_BorderInfoList[i].pszText,szText,lengthof(szText))) { if (::lstrcmpi(szText,TEXT("none"))==0) { if (!m_BorderInfoList[i].fAlways) m_BorderList[i]=Theme::BORDER_NONE; } else if (::lstrcmpi(szText,TEXT("solid"))==0) m_BorderList[i]=Theme::BORDER_SOLID; else if (::lstrcmpi(szText,TEXT("sunken"))==0) m_BorderList[i]=Theme::BORDER_SUNKEN; else if (::lstrcmpi(szText,TEXT("raised"))==0) m_BorderList[i]=Theme::BORDER_RAISED; } } Settings.Close(); } SetFileName(pszFileName); return true; }
void Effect14::Do(float timer, int pos, int row) { int nrSprites = sizeof(logo01SpriteList) / (sizeof(float) * 4); float speed = 0.2f; // group 01 int xAdd = 0, yAdd = 0; if (status >= 0) { xAdd = 650 - (timer * speed); if (xAdd < 0) xAdd = 0; yAdd = -43; for (int i = 0; i < (sizeof(logo01Group01) / 4); i++) { int index = logo01Group01[i]; logo01SpriteListMoved[index].x = logo01SpriteList[index].x + xAdd; logo01SpriteListMoved[index].y = logo01SpriteList[index].y + yAdd; } } if (status >= 1) { yAdd = -350 + ((timer - tempTimer[1]) * speed); if (yAdd > 0) yAdd = 0; for (int i = 0; i < (sizeof(logo01Group02) / 4); i++) { int index = logo01Group02[i]; logo01SpriteListMoved[index].x = logo01SpriteList[index].x; logo01SpriteListMoved[index].y = logo01SpriteList[index].y + yAdd; } } if (status >= 2) { xAdd = 400 - ((timer - tempTimer[2]) * speed); if (xAdd < 0) xAdd = 0; for (int i = 0; i < (sizeof(logo01Group03) / 4); i++) { int index = logo01Group03[i]; logo01SpriteListMoved[index].x = logo01SpriteList[index].x + xAdd; } } if (status >= 3) { yAdd = 350 +- ((timer - tempTimer[3]) * speed); if (yAdd < 0) yAdd = 0; for (int i = 0; i < (sizeof(logo01Group04) / 4); i++) { int index = logo01Group04[i]; logo01SpriteListMoved[index].x = logo01SpriteList[index].x; logo01SpriteListMoved[index].y = logo01SpriteList[index].y + yAdd; } } if (status >= 4) { yAdd = -43 + ((timer - tempTimer[4]) * speed * 0.5f); if (yAdd > 0) yAdd = 0; for (int i = 0; i < (sizeof(logo01Group01) / 4); i++) { int index = logo01Group01[i]; logo01SpriteListMoved[index].y = logo01SpriteList[index].y + yAdd; } } if (status >= 5) { xAdd = -650 + ((timer - tempTimer[5]) * speed); if (xAdd > 0) xAdd = 0; for (int i = 0; i < (sizeof(logo01Group05) / 4); i++) { int index = logo01Group05[i]; logo01SpriteListMoved[index].x = logo01SpriteList[index].x + xAdd; } } pyramid->SetTexture(NULL, 0); drawer2D->BeginScene(BLEND_NONE); int color = 0x000000; if (status == 10) { color = MixColor((timer - tempTimer[10]) * 0.001f, color, 0xffffff); } color = MixColor((timer - tempTimer[30]) * 0.001f, 0xA0A0A0, color); for (int i = 0; i < nrSprites; i++) { Logo01Sprite* sprite = &logo01SpriteListMoved[i]; drawer2D->Draw(sprite->x, sprite->y, color, sprite->x + sprite->w, sprite->y, color, sprite->x, sprite->y + sprite->h, color, sprite->x + sprite->w, sprite->y + sprite->h, color); } // draw the dot if (status >= 6) { float x1 = LOGO01_LETTER7_X; float y1 = LOGO01_LETTER_Y; float x2 = x1 + 15; float y2 = y1 + 15; DWORD color = MixColor((timer - tempTimer[6]) * 0.0003f, 0xffffff, 0x000000); if (status == 10) { color = MixColor((timer - tempTimer[10]) * 0.001f, color, 0xffffff); } color = MixColor((timer - tempTimer[30]) * 0.001f, 0xA0A0A0, color); drawer2D->Draw(x1, y1, color, x2, y1, color, x1, y2, color, x2, y2, color); } drawer2D->EndScene(); }
void Effect15::Do(float timer, int pos, int row) { //if (timer > 2000 && status == 0) Receive(1, timer, 0, 0); //if (timer > 4000 && status == 1) Receive(2, timer, 0, 0); //if (timer > 6000 && status == 2) Receive(3, timer, 0, 0); background = 0; const DWORD color1 = 0x312221; pyramid->SetTexture(NULL, 0); drawer2D->BeginScene(BLEND_NONE); int color = MixColor(timer / 2000.f, 0x000000, color1); if (status == 1) { color = MixColor((timer - tempTimer[1]) / 2000.f, color1, 0x000000); } for (int i = 0; i < 7; i++) { float x1 = 0; float x2 = 800; float y1 = i * 98; float y2 = y1 + 12; drawer2D->Draw(x1, y1, color, x2, y1, color, x1, y2, color, x2, y2, color); } for (int i = 0; i < 8; i++) { float x1 = i * 112.571428f; float x2 = x1 + 12; float y1 = 0; float y2 = 600; drawer2D->Draw(x1, y1, color, x2, y1, color, x1, y2, color, x2, y2, color); } for (int j = 0; j < 6; j++) { for (int i = 0; i < 7; i++) { //color = MixColor(timer / 2000.f, 0x000000, fx15Colors[j * 7 + i]); color = MixColor(sin((timer / fx15Durations[j * 7 + i]) + fx15Phases[j * 7 + i]) * 0.5f + 0.5f, 0x5b2115 , 0x33130c); color = MixColor(timer / 2000.f, 0x000000, color); if (status == 1) { color = MixColor((timer - tempTimer[1]) / 2000.f, color, 0x000000); } float x1 = 12.f + i * 112.571428f; float x2 = x1 + 112.571428f - 12.f; float y1 = 12.f + j * 98; float y2 = y1 + + 98 - 12.f; drawer2D->Draw(x1, y1, color, x2, y1, color, x1, y2, color, x2, y2, color); } } drawer2D->EndScene(); }