JPS_B
JPS_B copied to clipboard
findpath failed
Int32 GridWidth = 112, GridHeight = 112;
spCollision->Create(GridWidth, GridHeight);
Int32 Sx = 52, Sy = 43;
Int32 Ex = 61, Ey = 65;
//Int32 Ex = 52, Ey = 43;
//Int32 Sx = 61, Sy = 65;
std::ifstream file("collition.txt");
if (!file.is_open()) {
std::cerr << "Failed to open file" << std::endl;
return 1;
}
std::string line;
while (std::getline(file, line)) {
std::stringstream ss(line);
std::string token;
while (std::getline(ss, token, ',')) {
int index = std::stoi(token);
int x = index % GridWidth;
int y = index / GridWidth;
spCollision->SetAt(x, y);
}
}