///////////// // Methods // ///////////// color environmentMap::evaluate(const ray& r) const { // inverse transform the ray ray transformedRay(r); transformedRay.inverseTransform(_transformation); // convert ray direction to texture coordinate float theta = acos(transformedRay.direction().z); float phi = atan2(transformedRay.direction().y, transformedRay.direction().x); if(phi < 0.0f) phi += 2.0f * M_PI; theta /= M_PI; phi /= 2.0f * M_PI; // get texel coordinate float texelU = std::min(phi * (_texture.width()-1), (float)(_texture.width()-1)); float texelV = std::min(theta * (_texture.height()-1), (float)(_texture.height()-1)); // compute corners float left = floor(texelU); float right = ceil(texelU); float top = floor(texelV); float bottom = ceil(texelV); // linear interpolate along X float w = texelU - left; color topColor = _texture(left,top)*(1.0f-w) + _texture(right,top)*w; color bottomColor = _texture(left,bottom)*(1.0f-w) + _texture(right,bottom)*w; // linear interlate along Y w = texelV - top; return (1.0f - w)*topColor + w*bottomColor; }
osg::Image* Widget::_getImage() const { const osg::Texture* texture = _texture(); if(texture) return const_cast<osg::Image*>(texture->getImage(0)); return 0; }
void CMenu::_initCodeMenu() { _addUserLabels(m_codeLblUser, ARRAY_SIZE(m_codeLblUser), "CODE"); m_codeBg = _texture("CODE/BG", "texture", theme.bg, false); m_codeLblTitle = _addLabel("CODE/CODE", theme.titleFont, L"_ _ _ _", 0, 10, 640, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE); m_codeBtnKey[0] = _addButton("CODE/0_BTN", theme.btnFont, L"0", 270, 320, 100, 50, theme.btnFontColor); m_codeBtnErase = _addButton("CODE/ERASE_BTN", theme.btnFont, L"", 20, 400, 200, 48, theme.btnFontColor); m_codeBtnBack = _addButton("CODE/BACK_BTN", theme.btnFont, L"", 420, 400, 200, 48, theme.btnFontColor); m_codeBtnAge = _addButton("CODE/AGE_BTN", theme.btnFont, L"", 220, 400, 200, 48, theme.btnFontColor); m_codeLblAge = _addLabel("CODE/AGE", theme.lblFont, L"", 220, 412, 200, 20, theme.lblFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE); for (int i = 0; i < 10; ++i) { char *codeText = fmt_malloc("CODE/%i_BTN", i); if(codeText == NULL) continue; if (i > 0) { int x = i - 1; int y = x / 3; x %= 3; x = 160 + x * 110; y = 240 - y * 80; m_codeBtnKey[i] = _addButton(codeText, theme.btnFont, wfmt(L"%i", i), x, y, 100, 50, theme.btnFontColor); } _setHideAnim(m_codeBtnKey[i], codeText, 0, 0, 0.f, 0.f); MEM2_free(codeText); } _setHideAnim(m_codeBtnErase, "CODE/ERASE_BTN", 0, 0, -2.f, 0.f); _setHideAnim(m_codeBtnBack, "CODE/BACK_BTN", 0, 0, 1.f, -1.f); _setHideAnim(m_codeBtnAge, "CODE/AGE_BTN", 0, 0, -2.f, 0.f); _hideCode(true); _textCode(); }
void CMenu::_initConfig4Menu() { _addUserLabels(m_config4LblUser, ARRAY_SIZE(m_config4LblUser), "CONFIG4"); m_config4Bg = _texture("CONFIG4/BG", "texture", theme.bg, false); m_config4LblHome = _addLabel("CONFIG4/WIIMENU", theme.lblFont, L"", 20, 125, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_config4BtnHome = _addButton("CONFIG4/WIIMENU_BTN", theme.btnFont, L"", 420, 130, 200, 48, theme.btnFontColor); m_config4LblSaveFavMode = _addLabel("CONFIG4/SAVE_FAVMODE", theme.lblFont, L"", 20, 185, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_config4BtnSaveFavMode = _addButton("CONFIG4/SAVE_FAVMODE_BTN", theme.btnFont, L"", 420, 190, 200, 48, theme.btnFontColor); m_config4LblPathManager = _addLabel("CONFIG4/PATH_MANAGER", theme.lblFont, L"", 20, 245, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_config4BtnPathManager = _addButton("CONFIG4/PATH_MANAGER_BTN", theme.btnFont, L"", 420, 250, 200, 48, theme.btnFontColor); m_config4LblReturnTo = _addLabel("CONFIG4/RETURN_TO", theme.lblFont, L"", 20, 305, 290, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_config4LblReturnToVal = _addLabel("CONFIG4/RETURN_TO_BTN", theme.btnFont, L"", 468, 310, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC); m_config4BtnReturnToM = _addPicButton("CONFIG4/RETURN_TO_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 420, 310, 48, 48); m_config4BtnReturnToP = _addPicButton("CONFIG4/RETURN_TO_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 572, 310, 48, 48); // _setHideAnim(m_config4LblPathManager, "CONFIG4/PATH_MANAGER", 50, 0, -2.f, 0.f); _setHideAnim(m_config4BtnPathManager, "CONFIG4/PATH_MANAGER_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_config4LblSaveFavMode, "CONFIG4/SAVE_FAVMODE", 50, 0, -2.f, 0.f); _setHideAnim(m_config4BtnSaveFavMode, "CONFIG4/SAVE_FAVMODE_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_config4LblHome, "CONFIG4/WIIMENU", 50, 0, -2.f, 0.f); _setHideAnim(m_config4BtnHome, "CONFIG4/WIIMENU_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_config4LblReturnTo, "CONFIG4/RETURN_TO", 50, 0, -2.f, 0.f); _setHideAnim(m_config4LblReturnToVal, "CONFIG4/RETURN_TO_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_config4BtnReturnToM, "CONFIG4/RETURN_TO_MINUS", -50, 0, 1.f, 0.f); _setHideAnim(m_config4BtnReturnToP, "CONFIG4/RETURN_TO_PLUS", -50, 0, 1.f, 0.f); _hideConfig4(true); _textConfig4(); }
void CMenu::_initSystemMenu() { _addUserLabels(m_systemLblUser, ARRAY_SIZE(m_systemLblUser), "SYSTEM"); m_systemBg = _texture("SYSTEM/BG", "texture", theme.bg, false); m_systemLblTitle = _addTitle("SYSTEM/TITLE", theme.titleFont, L"", 0, 10, 640, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE); m_systemLblVersionTxt = _addLabel("SYSTEM/VERSION_TXT", theme.lblFont, L"", 20, 207, 220, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_systemLblVersion = _addLabel("SYSTEM/VERSION", theme.lblFont, L"", 230, 207, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_systemBtnDownload = _addButton("SYSTEM/DOWNLOAD_BTN", theme.btnFont, L"", 20, 400, 200, 48, theme.btnFontColor); m_systemBtnBack = _addButton("SYSTEM/BACK_BTN", theme.btnFont, L"", 420, 400, 200, 48, theme.btnFontColor); m_systemLblInfo = _addText("SYSTEM/INFO", theme.txtFont, L"", 20, 300, 600, 280, theme.txtFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_TOP); m_systemLblVerSelectVal = _addLabel("SYSTEM/VER_SELECT_BTN", theme.btnFont, L"", 468, 210, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC); m_systemBtnVerSelectM = _addPicButton("SYSTEM/VER_SELECT_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 420, 210, 48, 48); m_systemBtnVerSelectP = _addPicButton("SYSTEM/VER_SELECT_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 572, 210, 48, 48); // _setHideAnim(m_systemLblTitle, "SYSTEM/TITLE", 0, 0, -2.f, 0.f); _setHideAnim(m_systemBtnDownload, "SYSTEM/DOWNLOAD_BTN", 0, 0, 1.f, -1.f); _setHideAnim(m_systemBtnBack, "SYSTEM/BACK_BTN", 0, 0, 1.f, -1.f); _setHideAnim(m_systemLblVersionTxt, "SYSTEM/VERSION_TXT", -50, 0, -2.f, 0.f); _setHideAnim(m_systemLblVersion, "SYSTEM/VERSION", 50, 0, -2.f, 0.f); _setHideAnim(m_systemLblInfo, "SYSTEM/INFO", 0, 100, 0.f, 0.f); _setHideAnim(m_systemLblVerSelectVal, "SYSTEM/VER_SELECT_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_systemBtnVerSelectM, "SYSTEM/VER_SELECT_MINUS", -50, 0, 1.f, 0.f); _setHideAnim(m_systemBtnVerSelectP, "SYSTEM/VER_SELECT_PLUS", -50, 0, 1.f, 0.f); // _hideSystem(true); _textSystem(); }
///////////// // Methods // ///////////// color bilinearTexturedAlbedo::evaluate(const vec2d& textureCoord) const { // HW6: Implement this. // Exactly the same as texturedAlbedo, but it now return the bilinearly interpolated texel color. double x = textureCoord.u * (_texture.width()-1); double y = textureCoord.v*(_texture.height()-1); double x1 = floor(x); double x2= x1+1; double y1 = floor(y); double y2 = y1+1; double dx = x - x1; double dy = y - y1; //clamp values if(x1 < 0) { x1 = 0.0f; } else if(x1 > _texture.width() - 1) { x1 = _texture.width() - 1; } if(x2 < 0) { x2 = 0.0f; } else if(x2 > _texture.width() - 1) { x2 = _texture.width() - 1; } if(y1 < 0) { y1 = 0.0f; } else if(y1 > _texture.width() - 1) { y1 = _texture.width() - 1; } if(y2 < 0) { y2 = 0.0f; } else if(y2 > _texture.width() - 1){ y2 = _texture.width() - 1; } color a = _texture(x1,y1) * (1-dx) + _texture(x2,y1)*dx; color b = _texture(x1,y2) * (1-dx) + _texture(x2,y2)*dx; color result = a*(1-dy) + b*dy; return result; }
void CMenu::_initHomeAndExitToMenu() { _addUserLabels(m_homeLblUser, ARRAY_SIZE(m_homeLblUser), "HOME"); //Home Menu m_homeBg = _texture("HOME/BG", "texture", theme.bg, false); m_homeLblTitle = _addTitle("HOME/TITLE", theme.titleFont, L"", 0, 10, 640, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE); _setHideAnim(m_homeLblTitle, "HOME/TITLE", 0, 0, -2.f, 0.f); m_homeBtnSettings = _addButton("HOME/SETTINGS", theme.btnFont, L"", 60, 100, 250, 48, theme.btnFontColor); m_homeBtnReloadCache = _addButton("HOME/RELOAD_CACHE", theme.btnFont, L"", 60, 180, 250, 48, theme.btnFontColor); m_homeBtnUpdate = _addButton("HOME/UPDATE", theme.btnFont, L"", 60, 260, 250, 48, theme.btnFontColor); m_homeBtnExplorer = _addButton("HOME/EXPLORER", theme.btnFont, L"", 60, 340, 250, 48, theme.btnFontColor); m_homeBtnInstall = _addButton("HOME/INSTALL", theme.btnFont, L"", 330, 100, 250, 48, theme.btnFontColor); m_homeBtnAbout = _addButton("HOME/ABOUT", theme.btnFont, L"", 330, 180, 250, 48, theme.btnFontColor); m_homeBtnExitTo = _addButton("HOME/EXIT_TO", theme.btnFont, L"", 330, 260, 250, 48, theme.btnFontColor); m_homeBtnFTP = _addButton("HOME/FTP", theme.btnFont, L"", 330, 340, 250, 48, theme.btnFontColor); m_homeLblBattery = _addLabel("HOME/BATTERY", theme.btnFont, L"", 0, 420, 640, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC); _setHideAnim(m_homeBtnSettings, "HOME/SETTINGS", 50, 0, 1.f, 0.f); _setHideAnim(m_homeBtnReloadCache, "HOME/RELOAD_CACHE", 50, 0, 1.f, 0.f); _setHideAnim(m_homeBtnUpdate, "HOME/UPDATE", 50, 0, 1.f, 0.f); _setHideAnim(m_homeBtnExplorer, "HOME/EXPLORER", 50, 0, 1.f, 0.f); _setHideAnim(m_homeBtnInstall, "HOME/INSTALL", -50, 0, 1.f, 0.f); _setHideAnim(m_homeBtnAbout, "HOME/ABOUT", -50, 0, 1.f, 0.f); _setHideAnim(m_homeBtnExitTo, "HOME/EXIT_TO", -50, 0, 1.f, 0.f); _setHideAnim(m_homeBtnFTP, "HOME/FTP", -50, 0, 1.f, 0.f); _setHideAnim(m_homeLblBattery, "HOME/BATTERY", 0, 0, -2.f, 0.f); _textHome(); _hideHome(true); //ExitTo Menu _addUserLabels(m_exittoLblUser, ARRAY_SIZE(m_exittoLblUser), "EXIT_TO"); m_exittoLblTitle = _addTitle("EXIT_TO/TITLE", theme.titleFont, L"", 0, 10, 640, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE); _setHideAnim(m_exittoLblTitle, "EXIT_TO/TITLE", 0, 0, -2.f, 0.f); m_homeBtnExitToHBC = _addButton("EXIT_TO/HBC", theme.btnFont, L"", 185, 120, 270, 48, theme.btnFontColor); m_homeBtnExitToMenu = _addButton("EXIT_TO/MENU", theme.btnFont, L"", 185, 180, 270, 48, theme.btnFontColor); m_homeBtnExitToPriiloader = _addButton("EXIT_TO/PRIILOADER", theme.btnFont, L"", 185, 240, 270, 48, theme.btnFontColor); m_homeBtnExitToBootmii = _addButton("EXIT_TO/BOOTMII", theme.btnFont, L"", 185, 300, 270, 48, theme.btnFontColor); m_homeBtnExitToNeek = _addButton("EXIT_TO/NEEK", theme.btnFont, L"", 185, 360, 270, 48, theme.btnFontColor); _setHideAnim(m_homeBtnExitToHBC, "EXIT_TO/HBC", 0, 0, -4.f, 0.f); _setHideAnim(m_homeBtnExitToMenu, "EXIT_TO/MENU", 0, 0, -4.f, 0.f); _setHideAnim(m_homeBtnExitToPriiloader, "EXIT_TO/PRIILOADER", 0, 0, -4.f, 0.f); _setHideAnim(m_homeBtnExitToBootmii, "EXIT_TO/BOOTMII", 0, 0, -4.f, 0.f); _setHideAnim(m_homeBtnExitToNeek, "EXIT_TO/NEEK", 0, 0, -4.f, 0.f); _textExitTo(); _hideExitTo(true); }
void Widget::setTexCoordWrapVertical() { osg::Image* image = _image(); osg::Texture* texture = _texture(); if(!image || !texture || image->t() == 0.0f) return; texture->setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT); setTexCoord(0.0f, getHeight() / image->t(), UPPER_LEFT); setTexCoord(1.0f, getHeight() / image->t(), UPPER_RIGHT); }
void Widget::setTexCoordWrapHorizontal() { osg::Image* image = _image(); osg::Texture* texture = _texture(); if(!image || !texture || image->s() == 0.0f) return; texture->setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT); setTexCoord(getWidth() / image->s(), 0.0f, LOWER_RIGHT); setTexCoord(getWidth() / image->s(), 1.0f, UPPER_RIGHT); }
///////////// // Methods // ///////////// color bilinearTexturedAlbedo::evaluate(const vec2d& textureCoord) const { // get texel coordinate float texelU = std::min(textureCoord.u * (_texture.width()-1), (float)(_texture.width()-1)); float texelV = std::min(textureCoord.v * (_texture.height()-1), (float)(_texture.height()-1)); // compute corners float left = floor(texelU); float right = ceil(texelU); float top = floor(texelV); float bottom = ceil(texelV); // linear interpolate along X float w = texelU - left; color topColor = _texture(left,top)*(1.0f-w) + _texture(right,top)*w; color bottomColor = _texture(left,bottom)*(1.0f-w) + _texture(right,bottom)*w; // linear interlate along Y w = texelV - top; return (1.0f - w)*topColor + w*bottomColor; }
void CMenu::_initLangSettingsMenu() { _addUserLabels(m_LangSettingsLblUser, ARRAY_SIZE(m_LangSettingsLblUser), "LANGUAGE"); m_LangSettingsLblTitle = _addTitle("LANGUAGE/TITLE", theme.titleFont, L"", 0, 10, 640, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE); m_LangSettingsBg = _texture("LANGUAGE/BG", "texture", theme.bg, false); m_LangSettingsLblLanguage = _addLabel("LANGUAGE/LANGUAGE", theme.lblFont, L"", 20, 125, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_LangSettingsLblCurLanguage = _addLabel("LANGUAGE/LANGUAGE_BTN", theme.btnFont, L"", 468, 130, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC); m_LangSettingsBtnCurLanguageM = _addPicButton("LANGUAGE/LANGUAGE_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 420, 130, 48, 48); m_LangSettingsBtnCurLanguageP = _addPicButton("LANGUAGE/LANGUAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 572, 130, 48, 48); m_LangSettingsLblGetLanguages = _addLabel("LANGUAGE/GET_LANG", theme.lblFont, L"", 20, 185, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_LangSettingsBtnGetLanguages = _addButton("LANGUAGE/GET_LANG_BTN", theme.btnFont, L"", 420, 190, 200, 48, theme.btnFontColor); m_LangSettingsLblDlLang = _addLabel("LANGUAGE/DL_LANG", theme.lblFont, L"", 20, 245, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_LangSettingsLblCurDLLang = _addLabel("LANGUAGE/DL_LANG_BTN", theme.btnFont, L"", 468, 250, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC); m_LangSettingsBtnCurDlLangM = _addPicButton("LANGUAGE/DL_LANG_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 420, 250, 48, 48); m_LangSettingsBtnCurDlLangP = _addPicButton("LANGUAGE/DL_LANG_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 572, 250, 48, 48); m_LangSettingsLblDownload = _addLabel("LANGUAGE/DOWNLOAD", theme.lblFont, L"", 20, 305, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_LangSettingsBtnDownload = _addButton("LANGUAGE/DOWNLOAD_BTN", theme.btnFont, L"", 420, 310, 200, 48, theme.btnFontColor); m_LangSettingsBtnBack = _addButton("LANGUAGE/BACK_BTN", theme.btnFont, L"", 420, 400, 200, 48, theme.btnFontColor); _setHideAnim(m_LangSettingsLblTitle, "LANGUAGE/TITLE", 0, 0, -2.f, 0.f); _setHideAnim(m_LangSettingsLblLanguage, "LANGUAGE/LANGUAGE", 50, 0, -2.f, 0.f); _setHideAnim(m_LangSettingsLblCurLanguage, "LANGUAGE/LANGUAGE_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_LangSettingsBtnCurLanguageM, "LANGUAGE/LANGUAGE_MINUS", -50, 0, 1.f, 0.f); _setHideAnim(m_LangSettingsBtnCurLanguageP, "LANGUAGE/LANGUAGE_PLUS", -50, 0, 1.f, 0.f); _setHideAnim(m_LangSettingsLblGetLanguages, "LANGUAGE/GET_LANG", 50, 0, -2.f, 0.f); _setHideAnim(m_LangSettingsBtnGetLanguages, "LANGUAGE/GET_LANG_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_LangSettingsLblDlLang, "LANGUAGE/DL_LANG", 50, 0, -2.f, 0.f); _setHideAnim(m_LangSettingsLblCurDLLang, "LANGUAGE/DL_LANG_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_LangSettingsBtnCurDlLangM, "LANGUAGE/DL_LANG_MINUS", -50, 0, 1.f, 0.f); _setHideAnim(m_LangSettingsBtnCurDlLangP, "LANGUAGE/DL_LANG_PLUS", -50, 0, 1.f, 0.f); _setHideAnim(m_LangSettingsLblDownload, "LANGUAGE/DOWNLOAD", 50, 0, -2.f, 0.f); _setHideAnim(m_LangSettingsBtnDownload, "LANGUAGE/DOWNLOAD_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_LangSettingsBtnBack, "LANGUAGE/BACK_BTN", 0, 0, 1.f, -1.f); _hideLangSettings(true); _textLangSettings(); }
void CMenu::_initGameInfoMenu(CMenu::SThemeData &theme) { STexture emptyTex; _addUserLabels(theme, m_gameinfoLblUser, 0, 1, "GAMEINFO"); _addUserLabels(theme, m_gameinfoLblUser, 2, 1, "GAMEINFO"); m_gameinfoBg = _texture(theme.texSet, "GAMEINFO/BG", "texture", theme.bg); m_gameinfoLblID = _addLabel(theme, "GAMEINFO/GAMEID", 125, 10, 420, 75, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE); m_gameinfoLblGenre = _addText(theme, "GAMEINFO/GENRE", 40, 140, 560, 56, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_TOP); m_gameinfoLblDev = _addText(theme, "GAMEINFO/DEVELOPER", 40, 170, 560, 56, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_TOP); m_gameinfoLblPublisher = _addText(theme, "GAMEINFO/PUBLISHER", 40, 200, 560, 56, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_TOP); m_gameinfoLblRlsdate = _addText(theme, "GAMEINFO/RLSDATE", 40, 230, 560, 56, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_TOP); m_gameinfoLblRegion = _addText(theme, "GAMEINFO/REGION", 40, 260, 560, 56, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_TOP); m_gameinfoLblRating = _addLabel(theme, "GAMEINFO/RATING", 550, 380, 48, 60, 0, m_rating); m_gameinfoLblSynopsis = _addText(theme, "GAMEINFO/SYNOPSIS", 40, 120, 560, 320, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_TOP); m_gameinfoLblWifiplayers = _addLabel(theme, "GAMEINFO/WIFIPLAYERS", 550, 110, 68, 60, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_TOP, m_wifi); _addUserLabels(theme, m_gameinfoLblUser, 1, 1, "GAMEINFO"); _addUserLabels(theme, m_gameinfoLblUser, 3, 2, "GAMEINFO"); m_gameinfoLblTitle = _addLabel(theme, "GAMEINFO/TITLE", 20, 37, 600, 75, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE); for (u8 i = 0; i < ARRAY_SIZE(m_gameinfoLblControlsReq); ++i) { string dom(sfmt("GAMEINFO/CONTROLSREQ%i", i + 1)); m_gameinfoLblControlsReq[i] = _addLabel(theme, dom.c_str(), 40 + (i*60), 310, 60, 40, 0, emptyTex); _setHideAnim(m_gameinfoLblControlsReq[i], dom.c_str(), 0, -100, 0.f, 0.f); } for (u8 i = 0; i < ARRAY_SIZE(m_gameinfoLblControls); ++i) { string dom(sfmt("GAMEINFO/CONTROLS%i", i + 1)); m_gameinfoLblControls[i] = _addLabel(theme, dom.c_str(), 40 + (i*60), 380, 60, 40, 0, emptyTex); _setHideAnim(m_gameinfoLblControls[i], dom.c_str(), 0, -100, 0.f, 0.f); } // _setHideAnim(m_gameinfoLblID, "GAMEINFO/GAMEID",0, -100, 0.f, 0.f); _setHideAnim(m_gameinfoLblTitle, "GAMEINFO/TITLE", 0, -100, 0.f, 0.f); _setHideAnim(m_gameinfoLblRating, "GAMEINFO/RATING", 100, 0, 0.f, 0.f); _setHideAnim(m_gameinfoLblSynopsis, "GAMEINFO/SYNOPSIS", 0, 100, 0.f, 0.f); _setHideAnim(m_gameinfoLblRegion, "GAMEINFO/REGION", 0, -100, 0.f, 0.f); _setHideAnim(m_gameinfoLblDev, "GAMEINFO/DEVELOPER", 0, -100, 0.f, 0.f); _setHideAnim(m_gameinfoLblPublisher, "GAMEINFO/PUBLISHER", 0, -100, 0.f, 0.f); _setHideAnim(m_gameinfoLblRlsdate, "GAMEINFO/RLSDATE", 0, -100, 0.f, 0.f); _setHideAnim(m_gameinfoLblGenre, "GAMEINFO/GENRE", 0, -100, 0.f, 0.f); _setHideAnim(m_gameinfoLblWifiplayers, "GAMEINFO/WIFIPLAYERS", 0, -100, 0.f, 0.f); // _hideGameInfo(true); }
void CMenu::_initErrorMenu(CMenu::SThemeData &theme) { STexture texIcon; texIcon.fromPNG(error_png); _addUserLabels(theme, m_errorLblUser, ARRAY_SIZE(m_errorLblUser), "ERROR"); m_errorBg = _texture(theme.texSet, "ERROR/BG", "texture", theme.bg); m_errorLblMessage = _addLabel(theme, "ERROR/MESSAGE", theme.lblFont, L"", 112, 20, 500, 440, CColor(0xFFFFFFFF), FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_errorLblIcon = _addLabel(theme, "ERROR/ICON", theme.lblFont, L"", 40, 200, 64, 64, CColor(0xFFFFFFFF), 0, texIcon); // _setHideAnim(m_errorLblMessage, "ERROR/MESSAGE", 0, 0, 0.f, 0.f); _setHideAnim(m_errorLblIcon, "ERROR/ICON", -50, 0, 0.f, 0.f); // _hideError(true); _textError(); }
///////////// // Methods // ///////////// color texturedAlbedo::evaluate(const vec2d& textureCoord) const { // get pixel coord map to the nearest edge if outside signed int u= textureCoord.u * _texture.width(); signed int v= textureCoord.v * _texture.height(); if(u < 0) u = 0.0f; else if(u > _texture.width() - 1) u = _texture.width() - 1; if(v < 0) v = 0.0f; else if(v > _texture.height() - 1) v = _texture.height() - 1; // Done. return _texture(u,v); }
void CMenu::_initConfigScreenMenu() { _addUserLabels(m_configScreenLblUser, ARRAY_SIZE(m_configScreenLblUser), "SCREEN"); m_configScreenBg = _texture("SCREEN/BG", "texture", theme.bg, false); m_configScreenLblTVWidth = _addLabel("SCREEN/TVWIDTH", theme.lblFont, L"", 20, 125, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_configScreenLblTVWidthVal = _addLabel("SCREEN/TVWIDTH_BTN", theme.btnFont, L"", 468, 130, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC); m_configScreenBtnTVWidthM = _addPicButton("SCREEN/TVWIDTH_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 420, 130, 48, 48); m_configScreenBtnTVWidthP = _addPicButton("SCREEN/TVWIDTH_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 572, 130, 48, 48); m_configScreenLblTVHeight = _addLabel("SCREEN/TVHEIGHT", theme.lblFont, L"", 20, 185, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_configScreenLblTVHeightVal = _addLabel("SCREEN/TVHEIGHT_BTN", theme.btnFont, L"", 468, 190, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC); m_configScreenBtnTVHeightM = _addPicButton("SCREEN/TVHEIGHT_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 420, 190, 48, 48); m_configScreenBtnTVHeightP = _addPicButton("SCREEN/TVHEIGHT_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 572, 190, 48, 48); m_configScreenLblTVX = _addLabel("SCREEN/TVX", theme.lblFont, L"", 20, 245, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_configScreenLblTVXVal = _addLabel("SCREEN/TVX_BTN", theme.btnFont, L"", 468, 250, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC); m_configScreenBtnTVXM = _addPicButton("SCREEN/TVX_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 420, 250, 48, 48); m_configScreenBtnTVXP = _addPicButton("SCREEN/TVX_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 572, 250, 48, 48); m_configScreenLblTVY = _addLabel("SCREEN/TVY", theme.lblFont, L"", 20, 305, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_configScreenLblTVYVal = _addLabel("SCREEN/TVY_BTN", theme.btnFont, L"", 468, 310, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC); m_configScreenBtnTVYM = _addPicButton("SCREEN/TVY_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 420, 310, 48, 48); m_configScreenBtnTVYP = _addPicButton("SCREEN/TVY_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 572, 310, 48, 48); // _setHideAnim(m_configScreenLblTVWidth, "SCREEN/TVWIDTH", 50, 0, -2.f, 0.f); _setHideAnim(m_configScreenLblTVWidthVal, "SCREEN/TVWIDTH_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_configScreenBtnTVWidthM, "SCREEN/TVWIDTH_MINUS", -50, 0, 1.f, 0.f); _setHideAnim(m_configScreenBtnTVWidthP, "SCREEN/TVWIDTH_PLUS", -50, 0, 1.f, 0.f); _setHideAnim(m_configScreenLblTVHeight, "SCREEN/TVHEIGHT", 50, 0, -2.f, 0.f); _setHideAnim(m_configScreenLblTVHeightVal, "SCREEN/TVHEIGHT_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_configScreenBtnTVHeightM, "SCREEN/TVHEIGHT_MINUS", -50, 0, 1.f, 0.f); _setHideAnim(m_configScreenBtnTVHeightP, "SCREEN/TVHEIGHT_PLUS", -50, 0, 1.f, 0.f); _setHideAnim(m_configScreenLblTVX, "SCREEN/TVX", 50, 0, -2.f, 0.f); _setHideAnim(m_configScreenLblTVXVal, "SCREEN/TVX_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_configScreenBtnTVXM, "SCREEN/TVX_MINUS", -50, 0, 1.f, 0.f); _setHideAnim(m_configScreenBtnTVXP, "SCREEN/TVX_PLUS", -50, 0, 1.f, 0.f); _setHideAnim(m_configScreenLblTVY, "SCREEN/TVY", 50, 0, -2.f, 0.f); _setHideAnim(m_configScreenLblTVYVal, "SCREEN/TVY_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_configScreenBtnTVYM, "SCREEN/TVY_MINUS", -50, 0, 1.f, 0.f); _setHideAnim(m_configScreenBtnTVYP, "SCREEN/TVY_PLUS", -50, 0, 1.f, 0.f); _hideConfigScreen(true); _textConfigScreen(); }
///////////// // Methods // ///////////// color texturedAlbedo::evaluate(const vec2d& textureCoord) const { //std::cout << "textured albedo, texture coord is: " << textureCoord<< std::endl; // get pixel coord map to the nearest edge if outside signed int u= textureCoord.u * _texture.width(); signed int v= textureCoord.v * _texture.height(); //std::cout << "textured albedo, u is: " << u<< " v is: " << v<< std::endl; if(u < 0) u = 0.0f; else if(u > _texture.width() - 1) u = _texture.width() - 1; if(v < 0) v = 0.0f; else if(v > _texture.height() - 1) v = _texture.height() - 1; // Done. return _texture(u,v); }
void CMenu::_initCheatSettingsMenu(CMenu::SThemeData &theme) { _addUserLabels(theme, m_cheatLblUser, ARRAY_SIZE(m_cheatLblUser), "CHEAT"); m_cheatBg = _texture(theme.texSet, "CHEAT/BG", "texture", theme.bg); m_cheatLblTitle = _addLabel(theme, "CHEAT/TITLE", theme.lblFont, L"Cheats", 20, 30, 600, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE); m_cheatBtnBack = _addButton(theme, "CHEAT/BACK_BTN", theme.btnFont, L"", 460, 410, 150, 56, theme.btnFontColor); m_cheatBtnApply = _addButton(theme, "CHEAT/APPLY_BTN", theme.btnFont, L"", 240, 410, 150, 56, theme.btnFontColor); m_cheatBtnDownload = _addButton(theme, "CHEAT/DOWNLOAD_BTN", theme.btnFont, L"", 240, 410, 200, 56, theme.btnFontColor); m_cheatLblPage = _addLabel(theme, "CHEAT/PAGE_BTN", theme.btnFont, L"", 76, 410, 80, 56, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC); m_cheatBtnPageM = _addPicButton(theme, "CHEAT/PAGE_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 20, 410, 56, 56); m_cheatBtnPageP = _addPicButton(theme, "CHEAT/PAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 156, 410, 56, 56); m_cheatLblItem[0] = _addLabel(theme, "CHEAT/ITEM_0", theme.lblFont, L"", 40, 100, 460, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_cheatBtnItem[0] = _addButton(theme, "CHEAT/ITEM_0_BTN", theme.btnFont, L"", 500, 100, 120, 56, theme.btnFontColor); m_cheatLblItem[1] = _addLabel(theme, "CHEAT/ITEM_1", theme.lblFont, L"", 40, 160, 460, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_cheatBtnItem[1] = _addButton(theme, "CHEAT/ITEM_1_BTN", theme.btnFont, L"", 500, 160, 120, 56, theme.btnFontColor); m_cheatLblItem[2] = _addLabel(theme, "CHEAT/ITEM_2", theme.lblFont, L"", 40, 220, 460, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_cheatBtnItem[2] = _addButton(theme, "CHEAT/ITEM_2_BTN", theme.btnFont, L"", 500, 220, 120, 56, theme.btnFontColor); m_cheatLblItem[3] = _addLabel(theme, "CHEAT/ITEM_3", theme.lblFont, L"", 40, 280, 460, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_cheatBtnItem[3] = _addButton(theme, "CHEAT/ITEM_3_BTN", theme.btnFont, L"", 500, 280, 120, 56, theme.btnFontColor); m_cheatLblItem[4] = _addLabel(theme, "CHEAT/ITEM_4", theme.lblFont, L"", 40, 340, 460, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_cheatBtnItem[4] = _addButton(theme, "CHEAT/ITEM_4_BTN", theme.btnFont, L"", 500, 340, 120, 56, theme.btnFontColor); _setHideAnim(m_cheatBtnApply, "CHEAT/APPLY_BTN", 0, 0, -2.f, 0.f); _setHideAnim(m_cheatBtnBack, "CHEAT/BACK_BTN", 0, 0, -2.f, 0.f); _setHideAnim(m_cheatBtnDownload, "CHEAT/DOWNLOAD_BTN", 0, 0, -2.f, 0.f); _setHideAnim(m_cheatLblPage, "CHEAT/PAGE_BTN", 0, 200, 1.f, 0.f); _setHideAnim(m_cheatBtnPageM, "CHEAT/PAGE_MINUS", 0, 200, 1.f, 0.f); _setHideAnim(m_cheatBtnPageP, "CHEAT/PAGE_PLUS", 0, 200, 1.f, 0.f); for (int i=0;i<CHEATSPERPAGE;++i) { _setHideAnim(m_cheatBtnItem[i], sfmt("CHEAT/ITEM_%i_BTN", i).c_str(), 200, 0, 1.f, 0.f); _setHideAnim(m_cheatLblItem[i], sfmt("CHEAT/ITEM_%i_BTN", i).c_str(), -200, 0, 1.f, 0.f); } _hideCheatSettings(true); _textCheatSettings(); }
void CMenu::_initPluginSettingsMenu() { _addUserLabels(m_pluginLblUser, ARRAY_SIZE(m_pluginLblUser), "PLUGIN"); m_pluginBg = _texture("PLUGIN/BG", "texture", theme.bg, false); m_pluginLblTitle = _addTitle("PLUGIN/TITLE", theme.titleFont, L"", 0, 10, 640, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE); m_pluginBtnBack = _addButton("PLUGIN/BACK_BTN", theme.btnFont, L"", 420, 400, 200, 48, theme.btnFontColor); m_pluginLblPage = _addLabel("PLUGIN/PAGE_BTN", theme.btnFont, L"", 68, 400, 104, 48, theme.btnFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE, theme.btnTexC); m_pluginBtnPageM = _addPicButton("PLUGIN/PAGE_MINUS", theme.btnTexMinus, theme.btnTexMinusS, 20, 400, 48, 48); m_pluginBtnPageP = _addPicButton("PLUGIN/PAGE_PLUS", theme.btnTexPlus, theme.btnTexPlusS, 172, 400, 48, 48); m_pluginBtnCat[0] = _addPicButton("PLUGIN/PLUGIN_0_BTN", theme.checkboxoff, theme.checkboxoffs, 270, 394, 44, 48); m_pluginBtnCats[0] = _addPicButton("PLUGIN/PLUGIN_0_BTNS", theme.checkboxon, theme.checkboxons, 270, 394, 44, 48); m_pluginLblCat[0] = _addLabel("PLUGIN/PLUGIN_0", theme.lblFont, L"", 325, 397, 100, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); for(int i = 1; i < 6; ++i) { // Page 1 m_pluginBtnCat[i] = _addPicButton(fmt("PLUGIN/PLUGIN_%i_BTN", i), theme.checkboxoff, theme.checkboxoffs, 30, (39+i*58), 44, 48); m_pluginBtnCats[i] = _addPicButton(fmt("PLUGIN/PLUGIN_%i_BTNS", i), theme.checkboxon, theme.checkboxons, 30, (39+i*58), 44, 48); m_pluginLblCat[i] = _addLabel(fmt("PLUGIN/PLUGIN_%i", i), theme.lblFont, L"", 85, (42+i*58), 230, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); // right half m_pluginBtnCat[i+5] = _addPicButton(fmt("PLUGIN/PLUGIN_%i_BTN", i+5), theme.checkboxoff, theme.checkboxoffs, 325, (39+i*58), 44, 48); m_pluginBtnCats[i+5] = _addPicButton(fmt("PLUGIN/PLUGIN_%i_BTNS", i+5), theme.checkboxon, theme.checkboxons, 325, (39+i*58), 44, 48); m_pluginLblCat[i+5] = _addLabel(fmt("PLUGIN/PLUGIN_%i", i+5), theme.txtFont, L"", 380, (42+i*58), 230, 48, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); } _setHideAnim(m_pluginLblTitle, "PLUGIN/TITLE", 0, 0, -2.f, 0.f); _setHideAnim(m_pluginLblPage, "PLUGIN/PAGE_BTN", 0, 0, 1.f, -1.f); _setHideAnim(m_pluginBtnPageM, "PLUGIN/PAGE_MINUS", 0, 0, 1.f, -1.f); _setHideAnim(m_pluginBtnPageP, "PLUGIN/PAGE_PLUS", 0, 0, 1.f, -1.f); _setHideAnim(m_pluginBtnBack, "PLUGIN/BACK_BTN", 0, 0, 1.f, -1.f); for(u8 i = 0; i < 11; ++i) { _setHideAnim(m_pluginBtnCat[i], fmt("PLUGIN/PLUGIN_%i_BTN", i), 0, 0, 1.f, 0.f); _setHideAnim(m_pluginBtnCats[i], fmt("PLUGIN/PLUGIN_%i_BTNS", i), 0, 0, 1.f, 0.f); _setHideAnim(m_pluginLblCat[i], fmt("PLUGIN/PLUGIN_%i", i), 0, 0, 1.f, 0.f); m_pluginBtn[i] = m_pluginBtnCat[i]; } _hidePluginSettings(true); _textPluginSettings(); }