ref: e19630c0ef62e3e66cc17a438704df07cb2161ce
parent: dda59f415a96c28133fe0214786055f4260a43d8
author: mkf <mkf@cloud9p.org>
date: Thu Dec 12 05:57:00 EST 2024
engine.c: better names for functions
--- a/engine.c
+++ b/engine.c
@@ -58,7 +58,7 @@
* Returns position
*/
Point
-movedir(int dir, Point p)
+pointdir(int dir, Point p)
{
int x = p.x;
int y = p.y;
@@ -86,7 +86,7 @@
* Reverse of movedir, tells the direction for a dst from src
*/
int
-pointdir(Point src, Point dst)
+finddir(Point src, Point dst)
{
Point p;
@@ -93,7 +93,7 @@
/* hacky */
for(int i = NE ; i <= NW ; i++)
{
- p = movedir(i, src);
+ p = pointdir(i, src);
if(p.x == dst.x && p.y == dst.y)
return i;
}
@@ -109,7 +109,7 @@
Point src, dst;
src = findglenda(game);
- dst = movedir(dir, src);
+ dst = pointdir(dir, src);
if(game->grid[dst.x][dst.y] == PIECE_WALL)
return PIECE_WALL;
@@ -239,7 +239,7 @@
for(int dir = NE; dir <= NW; dir++)
{
- tmp = movedir(dir, p);
+ tmp = pointdir(dir, p);
next = game->grid[tmp.x][tmp.y];
if(next < min)
min = next;
@@ -266,7 +266,7 @@
for(dir = NE; dir <= NW; dir++)
{
- tmp = movedir(dir, p);
+ tmp = pointdir(dir, p);
next = game->grid[tmp.x][tmp.y];
if(next < min)
{