• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

JNetHackのソースをいじくったものを置いておくための場所


Commit MetaInfo

修訂5ad510a9317ff0b027842d3f7910e8b8db4febe0 (tree)
時間2017-10-11 14:15:36
作者SHIRAKATA Kentaro <argrath@ub32...>
CommiterSHIRAKATA Kentaro

Log Message

ifdef-ed official patches

Change Summary

差異

--- a/include/you.h
+++ b/include/you.h
@@ -68,11 +68,18 @@ struct u_achieve {
6868 };
6969
7070 struct u_realtime {
71+#if 0 /*C360-19*/
72+ long
73+ realtime; /* actual playing time up until the last restore, seconds */
74+ time_t restored; /* time the game was started or restored */
75+ time_t endtime;
76+#else
7177 long realtime; /* accumulated playing time in seconds */
7278 time_t start_timing; /* time game was started or restored or 'realtime'
7379 was last updated (savegamestate for checkpoint) */
7480 time_t finish_time; /* end of 'realtime' interval: time of save or
7581 end of game; used for topten/logfile/xlogfile */
82+#endif
7683 };
7784
7885 /* KMH, conduct --
--- a/src/allmain.c
+++ b/src/allmain.c
@@ -607,13 +607,24 @@ newgame()
607607 com_pager(1);
608608 }
609609
610+#if 1 /*C360-19*/
610611 urealtime.realtime = 0L;
611612 urealtime.start_timing = getnow();
613+#endif
612614 #ifdef INSURANCE
613615 save_currentstate();
614616 #endif
615617 program_state.something_worth_saving++; /* useful data now exists */
616618
619+#if 0 /*C360-19*/
620+ urealtime.realtime = 0L;
621+#if defined(BSD) && !defined(POSIX_TYPES)
622+ (void) time((long *) &urealtime.restored);
623+#else
624+ (void) time(&urealtime.restored);
625+#endif
626+
627+#endif
617628 /* Success! */
618629 welcome(TRUE);
619630 return;
--- a/src/end.c
+++ b/src/end.c
@@ -1115,8 +1115,13 @@ int how;
11151115 /* remember time of death here instead of having bones, rip, and
11161116 topten figure it out separately and possibly getting different
11171117 time or even day if player is slow responding to --More-- */
1118+#if 0 /*C360-19*/
1119+ endtime = getnow();
1120+ urealtime.realtime += (long) (endtime - urealtime.restored);
1121+#else
11181122 urealtime.finish_time = endtime = getnow();
11191123 urealtime.realtime += (long) (endtime - urealtime.start_timing);
1124+#endif
11201125
11211126 /* Sometimes you die on the first move. Life's not fair.
11221127 * On those rare occasions you get hosed immediately, go out
--- a/src/restore.c
+++ b/src/restore.c
@@ -579,10 +579,20 @@ unsigned int *stuckid, *steedid;
579579 foo = time_from_yyyymmddhhmmss(timebuf);
580580
581581 ReadTimebuf(ubirthday);
582+#if 0 /*C360-19*/
583+ mread(fd, &urealtime.realtime, sizeof(urealtime.realtime));
584+ ReadTimebuf(urealtime.restored);
585+#if defined(BSD) && !defined(POSIX_TYPES)
586+ (void) time((long *) &urealtime.restored);
587+#else
588+ (void) time(&urealtime.restored);
589+#endif
590+#else
582591 mread(fd, &urealtime.realtime, sizeof urealtime.realtime);
583592 ReadTimebuf(urealtime.start_timing); /** [not used] **/
584593 /* current time is the time to use for next urealtime.realtime update */
585594 urealtime.start_timing = getnow();
595+#endif
586596
587597 set_uasmon();
588598 #ifdef CLIPPING
--- a/src/save.c
+++ b/src/save.c
@@ -309,6 +309,14 @@ register int fd, mode;
309309 #ifdef SYSFLAGS
310310 bwrite(fd, (genericptr_t) &sysflags, sizeof(struct sysflag));
311311 #endif
312+#if 0 /*C360-19*/
313+ urealtime.realtime += (long) (getnow() - urealtime.restored);
314+ bwrite(fd, (genericptr_t) &u, sizeof(struct you));
315+ bwrite(fd, yyyymmddhhmmss(ubirthday), 14);
316+ bwrite(fd, (genericptr_t) &urealtime.realtime,
317+ sizeof(urealtime.realtime));
318+ bwrite(fd, yyyymmddhhmmss(urealtime.restored), 14);
319+#else
312320 urealtime.finish_time = getnow();
313321 urealtime.realtime += (long) (urealtime.finish_time
314322 - urealtime.start_timing);
@@ -318,6 +326,7 @@ register int fd, mode;
318326 bwrite(fd, yyyymmddhhmmss(urealtime.start_timing), 14); /** Why? **/
319327 /* this is the value to use for the next update of urealtime.realtime */
320328 urealtime.start_timing = urealtime.finish_time;
329+#endif
321330 save_killers(fd, mode);
322331
323332 /* must come before migrating_objs and migrating_mons are freed */
--- a/src/topten.c
+++ b/src/topten.c
@@ -372,8 +372,13 @@ struct toptenentry *tt;
372372 Fprintf(rfile, "%cconduct=0x%lx%cturns=%ld%cachieve=0x%lx", XLOG_SEP,
373373 encodeconduct(), XLOG_SEP, moves, XLOG_SEP, encodeachieve());
374374 Fprintf(rfile, "%crealtime=%ld%cstarttime=%ld%cendtime=%ld", XLOG_SEP,
375+#if 0 /*C360-19*/
376+ (long) urealtime.realtime, XLOG_SEP, (long) ubirthday, XLOG_SEP,
377+ (long) urealtime.endtime);
378+#else
375379 (long) urealtime.realtime, XLOG_SEP,
376380 (long) ubirthday, XLOG_SEP, (long) urealtime.finish_time);
381+#endif
377382 Fprintf(rfile, "%cgender0=%s%calign0=%s", XLOG_SEP,
378383 genders[flags.initgend].filecode, XLOG_SEP,
379384 aligns[1 - u.ualignbase[A_ORIGINAL]].filecode);
@@ -558,6 +563,9 @@ time_t when;
558563 t0->birthdate = yyyymmdd(ubirthday);
559564 t0->deathdate = yyyymmdd(when);
560565 t0->tt_next = 0;
566+#if 0 /*C360-19*/
567+ urealtime.endtime = when;
568+#endif
561569 #ifdef UPDATE_RECORD_IN_PLACE
562570 t0->fpos = -1L;
563571 #endif
--- a/win/win32/mhsplash.c
+++ b/win/win32/mhsplash.c
@@ -94,9 +94,14 @@ mswin_display_splash_window(BOOL show_ver)
9494 if (show_ver) {
9595 /* Show complete version information */
9696 dlb *f;
97+
98+#if 0 /*W360-1*/
99+ getversionstring(buf + strsize);
100+ strcat(buf, "\r\n\r\n");
101+#else
97102 char verbuf[BUFSZ];
98103 int verstrsize = 0;
99-
104+
100105 getversionstring(verbuf);
101106 verstrsize = strlen(verbuf);
102107 if (verstrsize + strlen("\r\n\r\n") + 1 < BUFSZ - 1)
@@ -110,8 +115,9 @@ mswin_display_splash_window(BOOL show_ver)
110115 panic("out of memory");
111116 }
112117 strcat(buf, verbuf);
118+#endif
113119 strsize = strlen(buf);
114-
120+
115121 /* Add compile options */
116122 f = dlb_fopen(OPTIONS_USED, RDTMODE);
117123 if (f) {
--- a/win/win32/mswproc.c
+++ b/win/win32/mswproc.c
@@ -16,7 +16,9 @@
1616 #include "func_tab.h" /* for extended commands */
1717 #include "winMS.h"
1818 #include <assert.h>
19+#if 1 /*W360-1*/
1920 #include <mmsystem.h>
21+#endif
2022 #include "mhmap.h"
2123 #include "mhstatus.h"
2224 #include "mhtext.h"
@@ -1653,8 +1655,10 @@ mswin_getlin(const char *question, char *input)
16531655 len--;
16541656 #endif
16551657 input[len] = '\0';
1658+#if 1 /*W360-1*/
16561659 } else if (len>=(BUFSZ-1)) {
16571660 PlaySound((LPCSTR)SND_ALIAS_SYSTEMEXCLAMATION, NULL, SND_ALIAS_ID|SND_ASYNC);
1661+#endif
16581662 } else {
16591663 input[len++] = c;
16601664 #if 1 /*JP*//*2バイト文字ならその場でもう1バイト読み込む*/