Forums WoW Modding Support Archives WoWModding Support Archives [DiscordArchive] Hole algorithm?

[DiscordArchive] Hole algorithm?

[DiscordArchive] Hole algorithm?

rektbyfaith
Administrator
0
11-17-2022, 12:20 AM
#1
Archived author: Nix • Posted: 2022-11-17T00:20:58.617000+00:00
Original source

Hole algorithm?
rektbyfaith
11-17-2022, 12:20 AM #1

Archived author: Nix • Posted: 2022-11-17T00:20:58.617000+00:00
Original source

Hole algorithm?

rektbyfaith
Administrator
0
11-17-2022, 12:26 AM
#2
Archived author: Titi • Posted: 2022-11-17T00:26:37.819000+00:00
Original source

well maybe algorithm isn't really the word for it, more like pattern ?

this is my code for finding WDL holes
```c++
for (int i = 0; i < 16; ++i)
{
std::bitset<16>wdlHoleMask(0);

for (int j = 0; j < 16; ++j)
{
auto chunk = mTile->getChunk(j, i);
// the ordering seems to be : short array = Y axis, flags values = X axis and the values are for a whole chunk.

std::bitset<16> holeBits(chunk->getHoleMask());

if (holeBits.count() == 16) // if all holes are set in a chunk
wdlHoleMask.set(j, true);
}
auto convertedholemask = (short)wdlHoleMask.to_ulong();
wdlFile.Insert(mareoffset, 2, (char*)&convertedholemask);
mareoffset += 2;
}
```
rektbyfaith
11-17-2022, 12:26 AM #2

Archived author: Titi • Posted: 2022-11-17T00:26:37.819000+00:00
Original source

well maybe algorithm isn't really the word for it, more like pattern ?

this is my code for finding WDL holes
```c++
for (int i = 0; i < 16; ++i)
{
std::bitset<16>wdlHoleMask(0);

for (int j = 0; j < 16; ++j)
{
auto chunk = mTile->getChunk(j, i);
// the ordering seems to be : short array = Y axis, flags values = X axis and the values are for a whole chunk.

std::bitset<16> holeBits(chunk->getHoleMask());

if (holeBits.count() == 16) // if all holes are set in a chunk
wdlHoleMask.set(j, true);
}
auto convertedholemask = (short)wdlHoleMask.to_ulong();
wdlFile.Insert(mareoffset, 2, (char*)&convertedholemask);
mareoffset += 2;
}
```

rektbyfaith
Administrator
0
11-17-2022, 12:31 AM
#3
Archived author: ReynoldsCahoon • Posted: 2022-11-17T00:31:58.028000+00:00
Original source

Not sure if you're aware you can use 3 back ticks followed by a language abbreviation and three more back ticks at the end of your code to create a proper code block with syntax highlighting.
[Image: image.png?ex=690c953d&is=690b43bd&hm=3bb...4911ca48c&]
rektbyfaith
11-17-2022, 12:31 AM #3

Archived author: ReynoldsCahoon • Posted: 2022-11-17T00:31:58.028000+00:00
Original source

Not sure if you're aware you can use 3 back ticks followed by a language abbreviation and three more back ticks at the end of your code to create a proper code block with syntax highlighting.
[Image: image.png?ex=690c953d&is=690b43bd&hm=3bb...4911ca48c&]

rektbyfaith
Administrator
0
11-17-2022, 01:24 AM
#4
Archived author: Nix • Posted: 2022-11-17T01:24:04.229000+00:00
Original source

Seems pretty standard, gj though. It's really nice to see progress
rektbyfaith
11-17-2022, 01:24 AM #4

Archived author: Nix • Posted: 2022-11-17T01:24:04.229000+00:00
Original source

Seems pretty standard, gj though. It's really nice to see progress

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)