Beispiel #1
0
void Menu::Init() {
	CreateChar(ARROW_LEFT, arrowLeft);
	CreateChar(ARROW_RIGHT, arrowRight);
	CreateChar(WRENCH, wrench);
	CreateChar(CLOCK, clock);
	CreateChar(CAMERA, camera);

	m_lcd->clear();
	GotoFirstItem();
}
Beispiel #2
0
void GSAvatarMod::OnActive()
{
  GSGui::OnActive();

  m_gui = LoadGui("gui-avatarmod.txt");
  Assert(m_gui);
  
  m_gui->GetElementByName("ok-button")->SetCommand(Amju::OnOkButton);
  m_gui->GetElementByName("cancel-button")->SetCommand(Amju::OnCancelButton);
  m_gui->GetElementByName("type-prev-button")->SetCommand(Amju::OnTypePrevButton);
  m_gui->GetElementByName("type-next-button")->SetCommand(Amju::OnTypeNextButton);
//  m_gui->GetElementByName("colour-prev-button")->SetCommand(Amju::OnColourPrevButton);
//  m_gui->GetElementByName("colour-next-button")->SetCommand(Amju::OnColourNextButton);

  GetGuiSceneGraph()->Clear();
  GetGuiSceneGraph()->SetRootNode(SceneGraph::AMJU_OPAQUE, new SceneNode);

  // TODO Horribly hardcoded here, use constants
  m_currentChar = GetLocalPlayer()->GetVal("avatar");
  if (m_currentChar.empty())
  {
std::cout << "No avatar set for local player ???\n";
    m_currentChar = "marge";
  }
  if (!TheAvatarManager::Instance()->GetIndex(m_currentChar, &m_current))
  {
    std::cout << "Couldn't find name in Avatar Manager: " << m_currentChar << "\n";
    Assert(0);
  }
  CreateChar();
  CheckAvailable();
}
C2DFighterScene::C2DFighterScene(void)
{
	m_currentTime = 0.0f;
	m_pCurrentBG = NULL;
	m_pCurrentChar = NULL;

	CreateBG();
	CreateChar();
}
Beispiel #4
0
void GSAvatarMod::OnPrevType()
{
  AvatarManager* am = TheAvatarManager::Instance();
  m_current--;
  if (m_current < 0)
  {
    m_current = am->GetNumNames() - 1;
  }

  m_currentChar = am->GetName(m_current);
  CreateChar();
  CheckAvailable();
}
Beispiel #5
0
void GSAvatarMod::OnNextType()
{
  AvatarManager* am = TheAvatarManager::Instance();
  m_current++;
  if (m_current == am->GetNumNames())
  {
    m_current = 0;
  }

  m_currentChar = am->GetName(m_current);
  CreateChar();
  CheckAvailable();
}
Beispiel #6
0
bool CFreeTypeFont::LoadFont(const std::string& file, int px_size)
{
    bool bError = FT_Init_FreeType(&ft_lib_);
    
    if(bError)
    {
        return false;
    }
    
    bError = FT_New_Face(ft_lib_, file.c_str(), 0, &ft_face_);
    
    if(bError)
    {
        return false;
    }
    FT_Set_Pixel_Sizes(ft_face_, px_size, px_size);
    loaded_pixel_size = px_size;
    
    glGenVertexArrays(1, &vao_);
    glBindVertexArray(vao_);
    vbo_data_.CreateVBO();
    vbo_data_.BindVBO();
    
    for(auto i = 0; i < 128; i++)
    {
        CreateChar(i);
    }
    
    bLoaded_ = true;
    
    FT_Done_Face(ft_face_);
    FT_Done_FreeType(ft_lib_);
    
    vbo_data_.UploadDataToGPU(GL_STATIC_DRAW);
    glEnableVertexAttribArray(0);
    glVertexAttribPointer(0,2,GL_FLOAT, GL_FALSE, sizeof(glm::vec2)*2,0);
    glEnableVertexAttribArray(1);
    glVertexAttribPointer(1,2,GL_FLOAT, GL_FALSE, sizeof(glm::vec2)*2, (void*)(sizeof(glm::vec2)));
    
    return true;
}