File: video_control_disabled.cpp

package info (click to toggle)
btanks 0.9.8083-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 43,616 kB
  • sloc: cpp: 46,425; ansic: 12,005; xml: 4,262; python: 313; sh: 13; makefile: 13
file content (24 lines) | stat: -rw-r--r-- 730 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "video_control_disabled.h"
#include "resource_manager.h"
#include "finder.h"
#include "sdlx/sdl_ex.h"
#include "sdlx/surface.h"

DisabledVideoControl::DisabledVideoControl(const std::string &base, const std::string &name) : 
screenshot(NULL)
{
	std::string fname = "maps/" + name + "_disabled.jpg";
	if (Finder->exists(base, fname)) {
		screenshot = ResourceManager->load_surface("../" + fname);
	} else 
		throw_ex(("no disabled version of the screenshot found"));
}

void DisabledVideoControl::render(sdlx::Surface &surface, const int x, const int y) const {
	surface.blit(*screenshot, x, y);
}

void DisabledVideoControl::get_size(int &w, int &h) const {
	w = screenshot->get_width();
	h = screenshot->get_height();
}