Skip to content

Commit cf3c4bb

Browse files
authored
Merge pull request #36 from Deamon87/development
- First version of projective texturing - Manual fog - Fixes for code responsible for getting light parameters from db2
2 parents 36075d3 + 178b2cf commit cf3c4bb

File tree

78 files changed

+2235
-1164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2235
-1164
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,10 @@ set(SOURCE_FILES
239239
src/ui/childWindow/m2Window/M2Window.h
240240
src/ui/imguiLib/hasFocus/imguiHasFocus.cpp
241241
src/ui/imguiLib/hasFocus/imguiHasFocus.h
242+
src/ui/imguiLib/floatCenterSlider/floatCenterSlider.h
243+
src/ui/imguiLib/floatCenterSlider/floatCenterSlider.cpp
244+
src/ui/imguiLib/compactFloatEditor/compactFloatEditor.cpp
245+
src/ui/imguiLib/compactFloatEditor/compactFloatEditor.h
242246
)
243247

244248
set(PROTOBUF_FILES_ "")

src/database/CSqliteDB.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ void CSqliteDB::getTimedLightParamData(int lightParamId, int time, LightParamDat
502502
timeIndex++;
503503
}
504504
505-
if (timeIndex > 1) return;
505+
if (timeIndex > 1) break;
506506
507507
auto &currLdRes = lightParamData.lightTimedData[timeIndex];
508508
currLdRes.time = thisTime;

src/exporters/dataExporter/DataExporterClass.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ namespace DataExporter {
124124
make_column("texture_weights_count", &DBM2::texture_weights_count),
125125
make_column("texture_transforms_count", &DBM2::texture_transforms_count),
126126
make_column("replacable_texture_lookup_count", &DBM2::replacable_texture_lookup_count),
127-
#ifdef _MSC_VER
127+
#if 1
128128
make_column("materials_count", &DBM2::materials_count),
129129
make_column("bone_lookup_table_count", &DBM2::bone_lookup_table_count),
130130
make_column("texture_lookup_table_count", &DBM2::texture_lookup_table_count),
@@ -167,7 +167,7 @@ namespace DataExporter {
167167
make_table("M2SkinSection",
168168
make_column("m2Id", &DBSkinSection::m2Id),
169169
make_column("skinSectionIndex", &DBSkinSection::skinSectionIndex),
170-
#ifdef _MSC_VER
170+
#if 1
171171
make_column("skinSectionId", &DBSkinSection::skinSectionId),
172172
make_column("Level", &DBSkinSection::Level),
173173
make_column("vertexStart", &DBSkinSection::vertexStart),

src/minimapGenerator/minimapGenerator.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ MinimapGenerator::MinimapGenerator(HWoWFilesCacheStorage cacheStorage, const HGD
3636
// config->adtTTLWithoutUpdate = 500; //0.5 sec
3737
config->adtFreeStrategy = EFreeStrategy::eFrameBase; //
3838

39-
config->exteriorColors.exteriorAmbientColor = mathfu::vec4(0.5f,0.5f,0.5f,1.0);;
40-
config->exteriorColors.exteriorHorizontAmbientColor = mathfu::vec4(0.5f,0.5f,0.5f,1.0);
41-
config->exteriorColors.exteriorGroundAmbientColor = mathfu::vec4(0.5f,0.5f,0.5f,1.0);
42-
config->exteriorColors.exteriorDirectColor = mathfu::vec4(0.5f,0.5f,0.5f,1.0);
39+
config->exteriorColors.exteriorAmbientColor = mathfu::vec3(0.5f,0.5f,0.5f);
40+
config->exteriorColors.exteriorHorizontAmbientColor = mathfu::vec3(0.5f,0.5f,0.5f);
41+
config->exteriorColors.exteriorGroundAmbientColor = mathfu::vec3(0.5f,0.5f,0.5f);
42+
config->exteriorColors.exteriorDirectColor = mathfu::vec3(0.5f,0.5f,0.5f);
4343

4444
config->adtSpecMult = 0.0;
4545

@@ -249,8 +249,7 @@ void MinimapGenerator::setupScenarioData() {
249249

250250

251251
auto config = m_apiContainer->getConfig();
252-
config->closeOceanColor = currentScenario.closeOceanColor;//{0.0671968088, 0.294095874, 0.348881632, 0};
253-
config->closeRiverColor = {0.345206976, 0.329288304, 0.270450264, 0};
252+
254253
config->currentTime = currentScenario.time;
255254

256255
m_width = currentScenario.imageWidth;

src/ui/FrontendUI.cpp

Lines changed: 197 additions & 647 deletions
Large diffs are not rendered by default.

src/ui/FrontendUI.h

Lines changed: 3 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "childWindow/fileListWindow/FileListWindow.h"
3232
#include "childWindow/sceneWindow/SceneWindow.h"
3333
#include "childWindow/m2Window/M2Window.h"
34+
#include "childWindow/mapSelectionWindow/MapSelectDialog.h"
3435

3536

3637
class FrontendUI : public IScene, public std::enable_shared_from_this<FrontendUI> {
@@ -85,39 +86,12 @@ class FrontendUI : public IScene, public std::enable_shared_from_this<FrontendUI
8586
void getDebugCameraPos(float &cameraX,float &cameraY,float &cameraZ);
8687
void makeScreenshotCallback(std::string fileName, int width, int height);
8788

88-
void getAdtSelectionMinimap(int wdtFileDataId);
89-
void getAdtSelectionMinimap(std::string wdtFilePath);
90-
void getMapList(std::vector<MapRecord> &mapList);
91-
92-
bool fillAdtSelectionminimap(bool &isWMOMap, bool &wdtFileExists);
93-
9489
std::shared_ptr<SceneWindow> getOrCreateWindow();
9590
void unloadScene();
9691
void resetAnimationCallback();
9792

98-
std::array<std::array<HGSamplableTexture, 64>, 64> adtSelectionMinimapTextures;
99-
std::array<std::array<std::shared_ptr<IUIMaterial>, 64>, 64> adtSelectionMinimapMaterials;
100-
std::vector<mapInnerZoneLightRecord> m_zoneLights = {};
101-
std::vector<LightResult> m_mapLights = {};
102-
int limitZoneLight = -1;
103-
104-
void emptyMinimap() {
105-
for (int i = 0; i < 64; i++) {
106-
for (int j = 0; j < 64; j++) {
107-
adtSelectionMinimapTextures[i][j] = nullptr;
108-
adtSelectionMinimapMaterials[i][j] = nullptr;
109-
}
110-
}
111-
}
112-
11393
auto createMinimapGenerator();
11494

115-
std::array<char, 128> filterText = {0};
116-
bool refilterIsNeeded = false;
117-
bool resortIsNeeded = false;
118-
void filterMapList(const std::string &text);
119-
void fillMapListStrings();
120-
12195
ImGui::FileBrowser fileDialog = ImGui::FileBrowser(ImGuiFileBrowserFlags_SelectDirectory, true);
12296
ImGui::FileBrowser createFileDialog = ImGui::FileBrowser(ImGuiFileBrowserFlags_EnterNewFilename);
12397

@@ -133,25 +107,14 @@ class FrontendUI : public IScene, public std::enable_shared_from_this<FrontendUI
133107
bool showMapConstruction = false;
134108

135109
bool cascOpened = false;
136-
bool mapCanBeOpened = true;
137-
bool adtMinimapFilled = false;
138110

139111
int windowWidth = 640;
140112
int windowHeight = 480;
141113

142-
143-
float minimapZoom = 1;
144-
bool drawZoneLights = false;
145-
bool drawAreaLights = false;
146-
147114
int currentTime = 0;
148115

149116
int threadCount = 4;
150117
int quickSortCutoff = 100;
151-
float prevMinimapZoom = 1;
152-
float prevZoomedSize = 0;
153-
int prevMapId = -1;
154-
bool isWmoMap = false;
155118

156119
bool pauseAnimation = true;
157120

@@ -161,22 +124,8 @@ class FrontendUI : public IScene, public std::enable_shared_from_this<FrontendUI
161124
int glowSource = 0;
162125
float customGlow = 0.0;
163126

164-
165-
166-
MapRecord prevMapRec;
167-
168-
float worldPosX = 0;
169-
float worldPosY = 0;
170-
float worldPosZ = 0;
171-
172127
HApiContainer m_api;
173128

174-
HWdtFile m_wdtFile = nullptr;
175-
176-
std::vector<MapRecord> mapList = {};
177-
std::vector<MapRecord> filteredMapList = {};
178-
std::vector<std::vector<std::string>> mapListStringMap = {};
179-
180129
int lastWidth = 100;
181130
int lastHeight = 100;
182131

@@ -194,6 +143,7 @@ class FrontendUI : public IScene, public std::enable_shared_from_this<FrontendUI
194143
std::shared_ptr<IExporter> exporter;
195144
int exporterFramesReady = 0;
196145

146+
std::shared_ptr<MapSelectDialog> m_mapSelectDialog = nullptr;
197147
std::shared_ptr<MinimapGenerationWindow> m_minimapGenerationWindow = nullptr;
198148
std::shared_ptr<BLPViewer> m_blpViewerWindow = nullptr;
199149
std::shared_ptr<BLPViewer> m_blpFileViewerWindow = nullptr;
@@ -240,10 +190,10 @@ class FrontendUI : public IScene, public std::enable_shared_from_this<FrontendUI
240190
void showMapConstructionDialog();
241191
void showMakeScreenshotDialog();
242192

243-
void showAdtSelectionMinimap();
244193
void showSettingsDialog();
245194
void showQuickLinksDialog();
246195

196+
void showModeControls(const std::string &groupName, EParameterSource &source, bool allowM2AsSource = false);
247197
void showCurrentStatsDialog();
248198
void showBlpViewer();
249199
void showM2Viewer();

0 commit comments

Comments
 (0)