Skip to content

Commit

Permalink
v0.2 release
Browse files Browse the repository at this point in the history
* updated README with minimal subset files of v1.13 download
* update data file
  • Loading branch information
soarqin committed Oct 26, 2021
1 parent 9e1ecbc commit efe40a1
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 21 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@
Diablo II Resurrected map revealing tool.

# What's New
## v0.2
* add display for Unique Chest, Well, neighbour map path
* fix display of correct taltomb entrance
* shorter line pointed to target, similar to legacy d2hackmap
* peformance tweaks to d2mapapi

## v0.1
* first release, with complete map revealing and quest/npc guides

# Prerequisite
* Diablo II v1.13c is required.
* Diablo II v1.13c is required. You can get a minimal subset of v1.13c files [HERE](https://archive.org/details/diablo-ii-1.13c-minimal.-7z)

# Usage
1. Edit D2RMH.ini, set `d2_path` to your Diablo II v1.13c folder path.
1. Edit D2RMH.ini, set `d2_path` to path of your Diablo II v1.13c folder,
or just put extracted D2RMH.exe/D2RMH.ini/D2RMH_data.ini to D2 v1.13c folder.
2. Run D2RMH.exe, enjoy!

# How to build
Expand Down
2 changes: 1 addition & 1 deletion bin/D2RMH_data.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2289,7 +2289,7 @@ well[12]=井
33=34
106=107
58=61
3=18
3=17
113=114
5=+30
42=56
Expand Down
2 changes: 1 addition & 1 deletion bin/gendata.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
; "-number" = Npc(Monster) with certain ID
;Act1:
guide[Blood Moor][Den of Evil] =1
guide[Cold Plains][Crypt] =1
guide[Cold Plains][Burial Grounds] =1
guide[Stony Field][+61] =1
guide[Underground Passage Level 1][Dark Wood] =1
guide[Dark Wood][+30] =1
Expand Down
48 changes: 31 additions & 17 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ static void updatePlayerPos(uint16_t posX, uint16_t posY) {
mapstate.currPosX = posX;
mapstate.currPosY = posY;

int idx = drawstate[1].count - 2 - int(skstate.lineEnds.size() * 3);
int idx = drawstate[1].count - 2 - int(skstate.lineEnds.size() * 2);
if (idx >= 0) {
int x0 = mapstate.currMap->cropX, y0 = mapstate.currMap->cropY, x1 = mapstate.currMap->cropX2,
y1 = mapstate.currMap->cropY2;
Expand All @@ -439,18 +439,19 @@ static void updatePlayerPos(uint16_t posX, uint16_t posY) {
auto oyf = float(posY) - float(y1 - y0) * .5f;

for (auto &le: skstate.lineEnds) {
const float mlen = 80.f;
const float mlen = 78.f;
const float gap = 12.f;
float sx, sy, ex, ey;
auto line = HMM_Vec2(le.x, le.y) - HMM_Vec2(oxf, oyf);
auto len = HMM_Length(line);
sx = oxf + line.X / len * 6.f;
sy = oyf + line.Y / len * 6.f;
sx = oxf + line.X / len * 8.f;
sy = oyf + line.Y / len * 8.f;
if (len > mlen) {
ex = sx + line.X / len * mlen;
ey = sy + line.Y / len * mlen;
} else if (len > 6.f) {
ex = le.x;
ey = le.y;
ex = oxf + line.X / len * (mlen - gap);
ey = oyf + line.Y / len * (mlen - gap);
} else if (len > gap) {
ex = le.x - line.X / len * gap;
ey = le.y - line.Y / len * gap;
} else {
ex = sx; ey = sy;
}
Expand All @@ -460,13 +461,26 @@ static void updatePlayerPos(uint16_t posX, uint16_t posY) {
drawLineBuild(skstate.vertices + 6 * 4 * idx, sx, sy, ex, ey, 1.5f, .8f, .8f, .8f);
++idx;

/* Draw the arrow */
len = len > 20.f ? 10.f : len * .5f;
auto rot = HMM_Normalize(HMM_Rotate(angle, HMM_Vec3(0, 0, 1)) * HMM_Vec4(-line.X, -line.Y, 0, 0)) * len;
drawLineBuild(skstate.vertices + 6 * 4 * idx, ex, ey, ex + rot.X, ey + rot.Y, 1.5f, .8f, .8f, .8f);
++idx;
rot = HMM_Normalize(HMM_Rotate(-angle, HMM_Vec3(0, 0, 1)) * HMM_Vec4(-line.X, -line.Y, 0, 0)) * len;
drawLineBuild(skstate.vertices + 6 * 4 * idx, ex, ey, ex + rot.X, ey + rot.Y, 1.5f, .8f, .8f, .8f);
/* Draw the dot */
if (ex == sx) {
float vertices[] = {
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
};
memcpy(skstate.vertices + 6 * 4 * idx, &vertices, sizeof(vertices));
} else {
ex += line.X / len * gap;
ey += line.Y / len * gap;
float vertices[] = {
ex - 3, ey - 3, .0f, .8f, .8f, .8f,
ex + 1.5f, ey - 1.5f, .0f, .8f, .8f, .8f,
ex + 3, ey + 3, .0f, .8f, .8f, .8f,
ex - 1.5f, ey + 1.5f, .0f, .8f, .8f, .8f,
};
memcpy(skstate.vertices + 6 * 4 * idx, &vertices, sizeof(vertices));
}
++idx;
}
float vertices[] = {
Expand Down Expand Up @@ -645,7 +659,7 @@ static void checkForUpdate() {
}
}
}
auto drawCount = 2 + skstate.mapObjs.size() + skstate.lineEnds.size() * 3;
auto drawCount = 2 + skstate.mapObjs.size() + skstate.lineEnds.size() * 2;
drawstate[1].count = drawCount;
if (drawCount > skstate.drawArrayCapacity) {
skstate.drawArrayCapacity = drawCount;
Expand Down

0 comments on commit efe40a1

Please sign in to comment.