Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
Deamon87 committed Jul 2, 2024
1 parent f6526bd commit 417dd7d
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 17 deletions.
40 changes: 30 additions & 10 deletions src/database/CSqliteDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,13 @@ const std::string getWmoAreaAreaNameSQL = R"===(

const std::string getLightByIdSQL = R"===(
select
l.GameCoords_0, l.GameCoords_1, l.GameCoords_2, l.GameFalloffStart, l.GameFalloffEnd, l.LightParamsID_0,
IFNULL(ls.SkyboxFileDataID, 0) as SkyboxFileDataID, IFNULL(lp.LightSkyboxID, 0) as LightSkyboxID,
lp.Glow, IFNULL(ls.Flags, 0) as SkyboxFlags
l.GameCoords_0, l.GameCoords_1, l.GameCoords_2, l.GameFalloffStart, l.GameFalloffEnd,
l.LightParamsID_0, l.LightParamsID_1, l.LightParamsID_2, l.LightParamsID_3, l.LightParamsID_4,
l.LightParamsID_5, l.LightParamsID_6, l.LightParamsID_7,
IFNULL(ls.SkyboxFileDataID, 0) as SkyboxFileDataID,
IFNULL(ls.Flags, 0) as SkyboxFlags,
IFNULL(lp.LightSkyboxID, 0) as LightSkyboxID,
lp.Glow
from Light l
left join LightParams lp on lp.ID = l.LightParamsID_0
left join LightSkybox ls on ls.ID = lp.LightSkyboxID
Expand All @@ -72,15 +76,17 @@ const std::string getLightByIdSQL = R"===(

const std::string getLightSQL = R"===(
select
l.id as LightId, l.GameCoords_0, l.GameCoords_1, l.GameCoords_2, l.GameFalloffStart, l.GameFalloffEnd, l.LightParamsID_0,
IFNULL(ls.SkyboxFileDataID, 0) as SkyboxFileDataID, IFNULL(lp.LightSkyboxID, 0) as LightSkyboxID,
lp.Glow, IFNULL(ls.Flags, 0) as SkyboxFlags, l.ContinentID,
l.id as LightId, l.GameCoords_0, l.GameCoords_1, l.GameCoords_2,
l.GameFalloffStart, l.GameFalloffEnd,
l.ContinentID,
l.LightParamsID_0, l.LightParamsID_1, l.LightParamsID_2, l.LightParamsID_3, l.LightParamsID_4,
l.LightParamsID_5, l.LightParamsID_6, l.LightParamsID_7,
(abs(l.GameCoords_0 - ?1) * abs(l.GameCoords_0 - ?1) +
abs(l.GameCoords_1 - ?2) * abs(l.GameCoords_1 - ?2) +
abs(l.GameCoords_2 - ?3) * abs(l.GameCoords_2 - ?3)) as lightDistSQR
from Light l
left join LightParams lp on lp.ID = l.LightParamsID_0
left join LightSkybox ls on ls.ID = lp.LightSkyboxID
where
((l.ContinentID = ?4) and
(
Expand Down Expand Up @@ -336,7 +342,14 @@ void CSqliteDB::getLightById(int lightId, int time, LightResult &lightResult, fl
ilr.pos[2] = getLightByIdStatement.getField("GameCoords_2").getDouble();
ilr.fallbackStart = getLightByIdStatement.getField("GameFalloffStart").getDouble();
ilr.fallbackEnd = getLightByIdStatement.getField("GameFalloffEnd").getDouble();
ilr.paramId = getLightByIdStatement.getField("LightParamsID_0").getInt();
ilr.paramId[0] = getLightByIdStatement.getField("LightParamsID_0").getInt();
ilr.paramId[1] = getLightByIdStatement.getField("LightParamsID_1").getInt();
ilr.paramId[2] = getLightByIdStatement.getField("LightParamsID_2").getInt();
ilr.paramId[3] = getLightByIdStatement.getField("LightParamsID_3").getInt();
ilr.paramId[4] = getLightByIdStatement.getField("LightParamsID_4").getInt();
ilr.paramId[5] = getLightByIdStatement.getField("LightParamsID_5").getInt();
ilr.paramId[6] = getLightByIdStatement.getField("LightParamsID_6").getInt();
ilr.paramId[7] = getLightByIdStatement.getField("LightParamsID_7").getInt();
ilr.skyBoxFileId = getLightByIdStatement.getField("SkyboxFileDataID").getInt();
ilr.lightSkyboxId = getLightByIdStatement.getField("LightSkyboxID").getInt();
ilr.glow = getLightByIdStatement.getField("Glow").getDouble();
Expand Down Expand Up @@ -366,7 +379,14 @@ void CSqliteDB::getEnvInfo(int mapId, float x, float y, float z, int ptime, std:
ilr.pos[2] = getLightStatement.getField("GameCoords_2").getDouble();
ilr.fallbackStart = getLightStatement.getField("GameFalloffStart").getDouble();
ilr.fallbackEnd = getLightStatement.getField("GameFalloffEnd").getDouble();
ilr.paramId = getLightStatement.getField("LightParamsID_0").getInt();
ilr.paramId[0] = getLightStatement.getField("LightParamsID_0").getInt();
ilr.paramId[1] = getLightStatement.getField("LightParamsID_1").getInt();
ilr.paramId[2] = getLightStatement.getField("LightParamsID_2").getInt();
ilr.paramId[3] = getLightStatement.getField("LightParamsID_3").getInt();
ilr.paramId[4] = getLightStatement.getField("LightParamsID_4").getInt();
ilr.paramId[5] = getLightStatement.getField("LightParamsID_5").getInt();
ilr.paramId[6] = getLightStatement.getField("LightParamsID_6").getInt();
ilr.paramId[7] = getLightStatement.getField("LightParamsID_7").getInt();
ilr.skyBoxFileId = getLightStatement.getField("SkyboxFileDataID").getInt();
ilr.lightSkyboxId = getLightStatement.getField("LightSkyboxID").getInt();
ilr.glow = getLightStatement.getField("Glow").getDouble();
Expand Down
2 changes: 1 addition & 1 deletion src/database/CSqliteDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class CSqliteDB : public IClientDatabase {
float fallbackEnd;
float lightDistSQR = 0;
float blendAlpha = 0;
int paramId;
int paramId[8];
int skyBoxFileId;
int lightSkyboxId;
float glow;
Expand Down
2 changes: 1 addition & 1 deletion wowViewerLib/shaders/src/spirv/dumpShaderFields.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ void dumpShaderUniformOffsets(const std::string &basePath, const std::vector<std
std::vector<uboBindingData> uboBindings;
std::array<bindingAmountData, MAX_SHADER_DESC_SETS> uboBindingAmountsPerSet;
std::vector<ssboBindingData> ssboBindingData;
std::vector<ssboBindingData> m_ssboBindings;
std::vector<imageBindingData> imageBindings;
std::array<bindingAmountData, MAX_SHADER_DESC_SETS> imageBindingAmountsPerSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ void GDescriptorSetLayout::fillUbo(int setIndex, const DescTypeOverride &typeOve
void GDescriptorSetLayout::fillSSBO(int setIndex, const DescTypeOverride &typeOverrides,
std::unordered_map<int, VkDescriptorSetLayoutBinding> &shaderLayoutBindings,
const shaderMetaData *p_metaData, const VkShaderStageFlagBits &vkStageFlag) {
for (int i = 0; i < p_metaData->ssboBindingData.size(); i++) {
auto &ssboBinding = p_metaData->ssboBindingData[i];
for (int i = 0; i < p_metaData->ssboBindings.size(); i++) {
auto &ssboBinding = p_metaData->ssboBindings[i];

if (ssboBinding.set != setIndex) continue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ void GShaderPermutationVLK::createShaderLayout() {
}
}

for (int i = 0; i < shaderMeta->ssboBindingData.size(); i++) {
auto &ssboBinding = shaderMeta->ssboBindingData[i];
for (int i = 0; i < shaderMeta->ssboBindings.size(); i++) {
auto &ssboBinding = shaderMeta->ssboBindings[i];

auto &setLayout = combinedShaderLayout.setLayouts[ssboBinding.set];

Expand Down
2 changes: 1 addition & 1 deletion wowViewerLib/src/include/database/dbStructs.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ struct LightResult {
float closeOceanColor[3];
float farOceanColor[3];

//Sky
std::array<float, 3> SkyTopColor;
float SkyMiddleColor[3];
float SkyBand1Color[3];
Expand Down Expand Up @@ -64,7 +65,6 @@ struct LightResult {
std::array<float, 3> HeightEndFogColor;
float FogStartOffset = 0;


std::string skyBoxName;
int skyBoxFdid;
int skyBoxFlags;
Expand Down

0 comments on commit 417dd7d

Please sign in to comment.