-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathLandscapeLoader.h
61 lines (41 loc) · 1.27 KB
/
LandscapeLoader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* LandscapeLoader.h
Copyright (c) 2015 by Michael Zahniser
Endless Sky is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later version.
Endless Sky is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
*/
#ifndef LANDSCAPELOADER_H
#define LANDSCAPELOADER_H
#include <QThread>
#include <QImage>
#include <QMutex>
#include <QString>
#include <list>
#include <map>
#include <vector>
class LandscapeLoader : public QThread
{
Q_OBJECT
public:
explicit LandscapeLoader(QObject *parent = 0);
void Init();
void Update();
void Quit();
const std::vector<QString> &Available() const;
signals:
public slots:
protected:
virtual void run() override;
private:
// This mutex controls access to the following:
QMutex mutex;
std::list<QString> toLoad;
std::map<QString, QImage> loaded;
int initCount = 0;
// This object does not require mutex access:
std::vector<QString> available;
};
#endif // LANDSCAPELOADER_H