X Tutup
Skip to content

Commit e364aa0

Browse files
committed
small graphical bug
1 parent b8929ea commit e364aa0

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Play the original game 0PLAYER here: https://plus.cerisetalis.com/0PLAYER/
44

55
(If you're put off by the original game being just a static image, rest assured that you would enjoy the interactive version even less than staring at the static image.)
66

7-
I made this just to learn some gamedev (and because I got briefly obsessed with that game). The learning was a success! The original 2d version (commit beb5275) was made in 2 day, then it took a while to prettify it to the current state.
7+
I made this just to learn some gamedev (and because I got briefly obsessed with that game). The learning was a success! The original 2d version (commit beb5275) was made in 2 days, then it took a while to prettify it to the current state.
88

99
![screenshot](https://github.com/user-attachments/assets/d6032a86-5676-4ee1-8f13-aee8db52e8bf)
1010

@@ -16,7 +16,7 @@ Game controls:
1616
* mouse click
1717
* wasd or arrows
1818
* can also drag tiles with the mouse
19-
* z to undo, z to redo
19+
* z to undo, x to redo
2020

2121
Janky terrible record/replay controls:
2222
* ctrl+digit (ctrl+0 .. ctrl+9) to start recording a macro (while recording, redo is not allowed; also, I wouldn't be surprised if undo during animation breaks recording, I haven't checked)

render.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -558,11 +558,14 @@ void render(World &w) {
558558
Matrix transform = MatrixTranslate((float)pos.x + .5f, 0.f, (float)pos.y + .5f);
559559

560560
if (is_edge) {
561-
MeshState &mesh = w.render.meshes.at(MESH_VOID_QUARTER_7);
562-
IVec neighbor {std::max(1, std::min(w.size.x - 2, x)), std::max(1, std::min(w.size.y - 2, y))};
563-
PowerAnim power = w.get_cell(neighbor).floor_power.anim;
564-
for (int dir = 0; dir < 4; ++dir) {
565-
mesh.instances.push_back({.transform = transform, .power = power, .pre_rotation = (Direction)dir});
561+
if (x > 0 && y > 0) {
562+
// Hack to make the edge of the world look correct, at least for the original 0PLAYER map.
563+
MeshState &mesh = w.render.meshes.at(MESH_VOID_QUARTER_7);
564+
IVec neighbor {std::max(1, std::min(w.size.x - 2, x)), std::max(1, std::min(w.size.y - 2, y))};
565+
PowerAnim power = w.get_cell(neighbor).floor_power.anim;
566+
for (int dir = 0; dir < 4; ++dir) {
567+
mesh.instances.push_back({.transform = transform, .power = power, .pre_rotation = (Direction)dir});
568+
}
566569
}
567570
continue;
568571
}

0 commit comments

Comments
 (0)
X Tutup