forked from matusnovak/SM2OBJ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
window.hpp
138 lines (116 loc) · 3.63 KB
/
window.hpp
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/*
* This file is part of SM2OBJ project.
* Copyright (C) 2015 by Matus Novak [email protected]
* Licensed under the MIT License
*/
#ifndef SM2OBJ_WINDOW
#define SM2OBJ_WINDOW
#include <ffw.h>
#include "defaults.h"
//#include "exporter/exportBlueprint.h"
//#include "exporter/textureExport.h"
namespace sm2obj {
class window: public ffw::uiWindow {
public:
window();
~window();
ffw::uiButton* buttonNext;
ffw::uiButton* buttonPrev;
ffw::uiButton* buttonCancel;
ffw::uiTextInput* textInputStarMadeFolder;
ffw::uiButton* buttonSelectStarMadeFolder;
ffw::uiList* listBlueprints;
ffw::uiTextInput* textInputOutputFolder;
ffw::uiButton* buttonSelectOutputFolder;
ffw::uiRadio* radioUvMapsTiles;
ffw::uiRadio* radioUvMapsAtlas;
ffw::uiRadio* radioUvMapsNone;
ffw::uiRadio* radioMatBumps;
ffw::uiRadio* radioMatNormals;
ffw::uiRadio* radioMatNoBumps;
ffw::uiCombo* comboTextureSize;
ffw::uiCombo* comboTextureFormat;
ffw::uiCheckbox* checkboxMatDiffuse;
ffw::uiCheckbox* checkboxMatEmissive;
ffw::uiCheckbox* checkboxMatAlpha;
ffw::uiCheckbox* checkboxExportAttachments;
ffw::uiCombo* comboNumOfThreads;
ffw::uiCombo* comboThreads;
ffw::uiButton* buttonObjectPlusTextures;
ffw::uiButton* buttonTexturesOnly;
ffw::uiButton* buttonObjectOnly;
ffw::uiLabel* labelBlockConfig;
ffw::uiLabel* labelReadingMeta;
ffw::uiLabel* labelLoadingChunks;
ffw::uiLabel* labelGeneratingBlocks;
ffw::uiLabel* labelCreatingPolys;
ffw::uiLabel* labelMergingVertices;
ffw::uiLabel* labelExportingTextures;
ffw::uiProgressbar* progressBlockConfig;
ffw::uiProgressbar* progressReadingMeta;
ffw::uiProgressbar* progressLoadingChunks;
ffw::uiProgressbar* progressGeneratingBlocks;
ffw::uiProgressbar* progressCreatingPolys;
ffw::uiProgressbar* progressMergingVertices;
ffw::uiProgressbar* progressExportingTextures;
private:
void setup() override;
void windowCloseEvent() override;
void widgetEvent(const ffw::uiWidget* Widget) override;
//void windowMovedEvent(int PosX, int PosY) override;
//void windowResizeEvent(int Width, int Height) override;
/*static void callbackLogError(const std::string& Message);
static void callbackLogInfo(const std::string& Message);
static void callbackLogDebug(const std::string& Message);
static void callbackLogWarning(const std::string& Message);
static void callbackProgress(int Progress, int Total);
static void callbackExit(bool Success);*/
void nextFrame();
void prevFrame();
void hideAll();
bool checkoutStarMadeFolder();
bool checkoutBlueprint();
bool checkoutOutputFolder();
bool checkoutUvMapsSettings();
bool checkoutTextureSettings();
bool checkoutSystemSettings();
bool checkoutMaterialSettings();
void saveUserDefaults();
ffw::uiFont font;
std::vector<std::vector<ffw::uiWidget*>> widgetFrames;
std::string starMadeFolder;
std::string blueprintName;
std::string outputFolder;
std::vector<std::string> blueprintsList;
bool exportMaterials;
bool exportTextures;
bool exportObject;
bool exportAtlas;
bool exportUV;
bool useBumps;
bool exportFinished;
ffw::uiBitmap frame00;
ffw::uiBitmap frame04;
ffw::uiBitmap frame06;
enum frame {
intro = 0,
starMadeFolderSelect = 1,
bleprintList = 2,
outputFolderSelect = 3,
uvMapsSettings = 4,
textureSettings = 5,
materialSettings = 6,
systemSettings = 7,
exportType = 8,
exportStatus = 9
};
int currentFrame;
sm2obj::defaults userDefaults;
volatile bool exportThreadStop;
ffw::thread exportThread;
ffw::mutex exportThreadMutex;
void* exportThreadFunc(void* Data);
//void* exportTexturesFunc(void* Data);
};
};
#endif