JPS_B icon indicating copy to clipboard operation
JPS_B copied to clipboard

findpath failed

Open unrealyx opened this issue 1 year ago • 2 comments

unrealyx avatar Jul 12 '24 11:07 unrealyx

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);
	}
}

collition.txt

unrealyx avatar Jul 12 '24 14:07 unrealyx

image

unrealyx avatar Jul 12 '24 14:07 unrealyx