• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisionad2456af14c1e3f2e02864d16076ea751b1aaa64 (tree)
Time2019-05-23 00:40:38
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 GRID, GRID_X, GRID_Y を floor.h へ移動.

Change Summary

Incremental Difference

--- a/src/defines.h
+++ b/src/defines.h
@@ -2284,24 +2284,6 @@
22842284
22852285
22862286 /*
2287- * Convert a "location" (Y,X) into a "grid" (G)
2288- */
2289-#define GRID(Y,X) \
2290- (256 * (Y) + (X))
2291-
2292-/*
2293- * Convert a "grid" (G) into a "location" (Y)
2294- */
2295-#define GRID_Y(G) \
2296- ((int)((G) / 256U))
2297-
2298-/*
2299- * Convert a "grid" (G) into a "location" (X)
2300- */
2301-#define GRID_X(G) \
2302- ((int)((G) % 256U))
2303-
2304-/*
23052287 * Hack -- Prepare to use the "Secure" routines
23062288 */
23072289 #if defined(SET_UID) && defined(SECURE)
--- a/src/floor.h
+++ b/src/floor.h
@@ -308,4 +308,23 @@ typedef struct {
308308 have_flag((F)->flags, FF_PERMANENT))
309309
310310 extern floor_type *current_floor_ptr;
311-extern saved_floor_type saved_floors[MAX_SAVED_FLOORS];
\ No newline at end of file
311+extern saved_floor_type saved_floors[MAX_SAVED_FLOORS];
312+
313+/*
314+ * Convert a "location" (Y,X) into a "grid" (G)
315+ */
316+#define GRID(Y,X) \
317+ (256 * (Y) + (X))
318+
319+/*
320+ * Convert a "grid" (G) into a "location" (Y)
321+ */
322+#define GRID_Y(G) \
323+ ((int)((G) / 256U))
324+
325+/*
326+ * Convert a "grid" (G) into a "location" (X)
327+ */
328+#define GRID_X(G) \
329+ ((int)((G) % 256U))
330+
Show on old repository browser