void Game_Player::Refresh() { Game_Actor* actor; if (Main_Data::game_party->GetActors().empty()) { SetSpriteName(""); return; } actor = Main_Data::game_party->GetActors()[0]; SetSpriteName(actor->GetSpriteName()); SetSpriteIndex(actor->GetSpriteIndex()); }
void Game_Player::Refresh() { Game_Actor* actor; if (Main_Data::game_party->GetActors().empty()) { SetSpriteName(""); return; } actor = Main_Data::game_party->GetActors()[0]; SetSpriteName(actor->GetSpriteName()); SetSpriteIndex(actor->GetSpriteIndex()); if (location.aboard) GetVehicle()->SyncWithPlayer(); }
void Window_ShopParty::OnCharsetSpriteReady(FileRequestResult* /* result */, int party_index) { Game_Actor *actor = Main_Data::game_party->GetActors()[party_index]; const std::string& sprite_name = actor->GetSpriteName(); int sprite_id = actor->GetSpriteIndex(); BitmapRef bm = Cache::Charset(sprite_name); int width = bm->GetWidth() / 4 / 3; int height = bm->GetHeight() / 2 / 4; for (int j = 0; j < 3; j++) { int sx = ((sprite_id % 4) * 3 + j) * width; int sy = ((sprite_id / 4) * 4 + 2) * height; Rect src(sx, sy, width, height); for (int k = 0; k < 2; k++) { BitmapRef bm2 = Bitmap::Create(width, height, true); bm2->Clear(); bm2->Blit(0, 0, *bm, src, 255); if (k == 0) bm2->ToneBlit(0, 0, *bm2, bm2->GetRect(), Tone(128, 128, 128, 0), Opacity::opaque); bitmaps[party_index][j][k] = bm2; } } }