ManaPlus
Functions | Variables
testlauncher.cpp File Reference

(986a3bf)

#include "test/testlauncher.h"
#include "graphicsmanager.h"
#include "settings.h"
#include "soundmanager.h"
#include "fs/virtfs/rwops.h"
#include "gui/skin.h"
#include "gui/theme.h"
#include "gui/fonts/font.h"
#include "utils/pnglib.h"
#include "utils/stringutils.h"
#include "render/graphics.h"
#include "render/vertexes/imagecollection.h"
#include "resources/openglimagehelper.h"
#include "resources/screenshothelper.h"
#include "resources/surfaceimagehelper.h"
#include "resources/wallpaper.h"
#include "resources/dye/dye.h"
#include "resources/image/image.h"
#include <SDL_gfxBlitFunc.h>
#include <unistd.h>
#include <sys/time.h>
#include "localconsts.h"
#include "resources/sdlgfxblitfunc.h"
#include "debug.h"

Go to the source code of this file.

Functions

 PRAGMA45 (GCC diagnostic push) PRAGMA45(GCC diagnostic ignored "-Wunused-result") int TestLauncher
 

Variables

FontboldFont
 

Function Documentation

◆ PRAGMA45()

PRAGMA45 ( GCC diagnostic  push)

Definition at line 182 of file testlauncher.cpp.

186 {
187  timeval start;
188  timeval end;
189 
191  Wallpaper::getWallpaper(800, 600);
192  Image *img[5];
193  const int sz = 4;
194 
195  img[0] = Theme::getImageFromTheme("graphics/sprites/arrow_up.png");
196  img[1] = Theme::getImageFromTheme(
197  "graphics/gui/target-cursor-normal-l.png");
198  img[2] = Theme::getImageFromTheme("themes/wood/window.png");
199  img[3] = Theme::getImageFromTheme("themes/pink/window.png");
200  img[4] = Theme::getImageFromTheme("graphics/images/login_wallpaper.png");
201  int idx = 0;
202 
203  const int cnt = 50;
204 
205  gettimeofday(&start, nullptr);
206  for (int k = 0; k < cnt; k ++)
207  {
208  for (int x = 0; x < 800; x += 30)
209  {
210  for (int y = 0; y < 600; y += 50)
211  {
212  mainGraphics->drawImage(img[idx], x, y);
213  idx ++;
214  if (idx > sz)
215  idx = 0;
216  mainGraphics->drawImage(img[idx], x, y);
217  idx ++;
218  if (idx > sz)
219  idx = 0;
220  }
221  }
223  }
224 
225  gettimeofday(&end, nullptr);
226  const int tFps = calcFps(start, end, cnt);
227  file << mTest << std::endl;
228  file << tFps << std::endl;
229 
230  printf("fps: %d\n", tFps / 10);
231  sleep(1);
232  return 0;
233 }
virtual void updateScreen()=0
virtual void drawImage(const Image *const image, int dstX, int dstY)=0
static Image * getImageFromTheme(const std::string &path)
Definition: theme.cpp:655
static void loadWallpapers()
Definition: wallpaper.cpp:88
static std::string getWallpaper(const int width, const int height)
Definition: wallpaper.cpp:137
Graphics * mainGraphics
Definition: graphics.cpp:109

References TestLauncher::calcFps(), Graphics::drawImage(), TestLauncher::file, Theme::getImageFromTheme(), Wallpaper::getWallpaper(), Wallpaper::loadWallpapers(), mainGraphics, TestLauncher::mTest, anonymous_namespace{stringutils.cpp}::start, Graphics::updateScreen(), x, and y.

Referenced by LocalPlayer::attributeChanged(), StatsPageBasic::attributeChanged(), ChatWindow::attributeChanged(), KillStats::attributeChanged(), MiniStatusWindow::attributeChanged(), StatusWindow::attributeChanged(), SDLInput::convertKeyCharacter(), WhoIsOnline::downloadThread(), Net::Download::downloadThread(), Client::gameExec(), TextField::handleCtrlKeys(), TextField::handleNormalKeys(), DropDown::keyPressed(), TextBox::keyPressed(), CharCreateDialog::keyPressed(), CharSelectDialog::keyPressed(), QuitDialog::keyPressed(), ServerDialog::keyPressed(), and Setup_Colors::valueChanged().

Variable Documentation

◆ boldFont

Font* boldFont
extern