void info_top(PALETA *paletas) { paleta(paletas); icon_save(); icon_file(); print_edit_colors(); print_user_color(RGB(0, 0, 0)); }
/** Loads the data for one particular powerup. For bowling ball, plunger, and * cake static members in the appropriate classes are called to store * additional information for those objects. * \param type The type of the powerup. * \param node The XML node with the data for this powerup. */ void PowerupManager::LoadPowerup(PowerupType type, const XMLNode &node) { std::string icon_file(""); node.get("icon", &icon_file); #ifdef DEBUG if (icon_file.size() == 0) { fprintf(stderr, "Cannot load powerup %i, no 'icon' attribute under XML node\n", type); assert(false); } #endif m_all_icons[type] = material_manager->getMaterial(icon_file, /* full_path */ false, /*make_permanent */ true); assert(m_all_icons[type] != NULL); assert(m_all_icons[type]->getTexture() != NULL); std::string model(""); node.get("model", &model); if(model.size()>0) { std::string full_path = file_manager->getModelFile(model); m_all_meshes[type] = irr_driver->getMesh(full_path); if(!m_all_meshes[type]) { std::ostringstream o; o<<"Can't load model '"<<model<<"' for powerup type '"<<type<<"', aborting."; throw std::runtime_error(o.str()); } m_all_meshes[type]->grab(); } else { m_all_meshes[type] = 0; m_all_extends[type] = btVector3(0.0f,0.0f,0.0f); } // Load special attributes for certain powerups switch (type) { case POWERUP_BOWLING: Bowling::init(node, m_all_meshes[type]); break; case POWERUP_PLUNGER: Plunger::init(node, m_all_meshes[type]); break; case POWERUP_CAKE: Cake::init(node, m_all_meshes[type]); break; case POWERUP_RUBBERBALL: RubberBall::init(node, m_all_meshes[type]); break; default:; } // switch } // LoadNode
error_code sceNpTrophyGetTrophyIcon(u32 context, u32 handle, s32 trophyId, vm::ptr<void> buffer, vm::ptr<u32> size) { sceNpTrophy.warning("sceNpTrophyGetTrophyIcon(context=0x%x, handle=0x%x, trophyId=%d, buffer=*0x%x, size=*0x%x)", context, handle, trophyId, buffer, size); if (!size) { return SCE_NP_TROPHY_ERROR_INVALID_ARGUMENT; } const auto ctxt = idm::get<trophy_context_t>(context); if (!ctxt) { return SCE_NP_TROPHY_ERROR_UNKNOWN_CONTEXT; } const auto hndl = idm::get<trophy_handle_t>(handle); if (!hndl) { return SCE_NP_TROPHY_ERROR_UNKNOWN_HANDLE; } if (ctxt->tropusr->GetTrophiesCount() <= (u32)trophyId) { return SCE_NP_TROPHY_ERROR_INVALID_TROPHY_ID; } if (!ctxt->tropusr->GetTrophyUnlockState(trophyId)) { bool hidden = false; // TODO obtain this value return hidden ? SCE_NP_TROPHY_ERROR_HIDDEN : SCE_NP_TROPHY_ERROR_LOCKED; } fs::file icon_file(vfs::get("/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name + fmt::format("/TROP%03d.PNG", trophyId))); if (!icon_file) { return SCE_NP_TROPHY_ERROR_UNKNOWN_FILE; } const u32 icon_size = ::size32(icon_file); if (buffer && *size >= icon_size) { icon_file.read(buffer.get_ptr(), icon_size); } *size = icon_size; return CELL_OK; }
static void create_tray(void){ GtkStatusIcon *icon; char menu_file[PATH_MAX]; char icon_f[PATH_MAX]; icon = create_icon(); g_signal_connect(G_OBJECT(icon),"button-press-event",G_CALLBACK(menu_popup),NULL); create_menu(menu_file); if(icon_file(menu_file,icon_f)!=NULL && access(icon_f,R_OK)==0){ g_print("Setting Fluxbox Tray Menu icon to %s\n",icon_f); gtk_status_icon_set_from_file(icon,icon_f); } }
error_code sceNpTrophyGetGameIcon(u32 context, u32 handle, vm::ptr<void> buffer, vm::ptr<u32> size) { sceNpTrophy.warning("sceNpTrophyGetGameIcon(context=0x%x, handle=0x%x, buffer=*0x%x, size=*0x%x)", context, handle, buffer, size); if (!size) { return SCE_NP_TROPHY_ERROR_INVALID_ARGUMENT; } const auto ctxt = idm::get<trophy_context_t>(context); if (!ctxt) { return SCE_NP_TROPHY_ERROR_UNKNOWN_CONTEXT; } const auto hndl = idm::get<trophy_handle_t>(handle); if (!hndl) { return SCE_NP_TROPHY_ERROR_UNKNOWN_HANDLE; } fs::file icon_file(vfs::get("/dev_hdd0/home/" + Emu.GetUsr() + "/trophy/" + ctxt->trp_name + "/ICON0.PNG")); if (!icon_file) { return SCE_NP_TROPHY_ERROR_UNKNOWN_FILE; } const u32 icon_size = ::size32(icon_file); if (buffer && *size >= icon_size) { icon_file.read(buffer.get_ptr(), icon_size); } *size = icon_size; return CELL_OK; }