From 92b0dcffffacf94eba75426cc143b9f549e30bab Mon Sep 17 00:00:00 2001 From: momo5502 Date: Mon, 5 Jun 2017 16:43:07 +0200 Subject: [PATCH] [Friends] Remove testing code --- src/Components/Modules/Friends.cpp | 50 ------------------------------ 1 file changed, 50 deletions(-) diff --git a/src/Components/Modules/Friends.cpp b/src/Components/Modules/Friends.cpp index 4b9b0920..89e9c869 100644 --- a/src/Components/Modules/Friends.cpp +++ b/src/Components/Modules/Friends.cpp @@ -722,56 +722,6 @@ namespace Components Friends::UpdateFriends(); }); - - Command::Add("testavatar", [](Command::Params*) - { - std::lock_guard _(Friends::Mutex); - - for (auto user : Friends::FriendsList) - { - Logger::Print("Fetching %s...\n", user.name.data()); - int index = Steam::Proxy::SteamFriends->GetMediumFriendAvatar(user.userId); - - - if (!Steam::Proxy::SteamUtils) return; - - static Game::GfxImage image = { nullptr }; - if (image.map) Game::Image_Release(&image); - static Game::Material* material = nullptr; - - unsigned int width, height; - Steam::Proxy::SteamUtils->GetImageSize(index, &width, &height); - Game::Image_Setup(&image, static_cast(width), static_cast(height), 1, 0x1000003, D3DFMT_A8R8G8B8); - Logger::Print("%dx%d\n", width, height); - - D3DLOCKED_RECT lockedRect; - image.map->LockRect(0, &lockedRect, nullptr, 0); - - unsigned char* buffer = static_cast(lockedRect.pBits); - Steam::Proxy::SteamUtils->GetImageRGBA(index, buffer, width * height * 4); - - // Swap red and blue channel - for (unsigned int i = 0; i < width * height * 4; i += 4) - { - std::swap(buffer[i + 0], buffer[i + 2]); - } - - image.map->UnlockRect(0); - - if (!material) - { - material = Materials::Create("avatar", &image); - - Scheduler::OnFrame([]() - { - float color[4] = { 1.0f, 1.0f, 1.0f, 1.0f }; - Game::CL_DrawStretchPicPhysical(10.0f, 10.0f, 100.0f, 100.0f, 0, 0, 1.0f, 1.0f, color, material); - }); - } - - break; - } - }); } Friends::~Friends()