Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
Loading...
Searching...
No Matches
tilesetprovider.h
Go to the documentation of this file.
1
/*
2
* Copyright 2020 Twilight
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
#pragma once
17
#include <QPixmap>
18
#include <QQuickImageProvider>
19
#include <QString>
20
#include <QSize>
21
31
class
TilesetProvider
:
public
QQuickImageProvider
32
{
33
public
:
34
TilesetProvider
();
35
36
// <tileset>/<type>/<font>/<frame>/<tile>/<width>/<height>
37
// * <tileset> is the tileset, case-insensitive and spaces converted to
38
// underscores
39
// * <type> is the type, specifically "outdoor" or not is used here
40
// * <font> is whether to load fonts and white out certain tiles,
41
// specifically "font" or not is used here
42
// * <frame> can be any positive number, a full frame cycle completes in 8
43
// frames though so it's suggested to use multiple of 8 for smooth
44
// animation
45
// * <tile> can either be a tile number between 0-255 or "whole" which invokes
46
// a debug operation and returns the whole image. "whole" is never suggested
47
// because whole is not cached and can take a long time to build.
49
virtual
QPixmap
requestPixmap
(
const
QString&
id
, QSize* size,
const
QSize& requestedSize)
override
;
50
51
QPixmap
blankImage
(QSize* size,
const
QSize& requestedSize);
52
};
TilesetProvider::blankImage
QPixmap blankImage(QSize *size, const QSize &requestedSize)
Fallback blank tile.
Definition
tilesetprovider.cpp:73
TilesetProvider::TilesetProvider
TilesetProvider()
Definition
tilesetprovider.cpp:28
TilesetProvider::requestPixmap
virtual QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) override
Render the tile for id (format documented above).
Definition
tilesetprovider.cpp:33
projects
app
src
engine
tilesetprovider.h
Generated by
1.17.0