Skip to content

Commit

Permalink
Noteshot slight update.
Browse files Browse the repository at this point in the history
  • Loading branch information
JadingTsunami committed Mar 29, 2024
1 parent c25ba71 commit b3fc0e9
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions prboom2/src/c_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static dboolean IsMobjInThinkerList(mobj_t* mo);

typedef struct tick_event_t {
int ticks_left;
void (*callback)(void);
void (*callback)(char*);
struct tick_event_t* next;
} tick_event_t;

Expand All @@ -80,7 +80,7 @@ void C_Ticker()
if (t->ticks_left <= 0) {
tick_event_t* tp = NULL;
if (t->callback)
t->callback();
t->callback(NULL);
if (tprev) {
tprev->next = t->next;
} else {
Expand All @@ -96,7 +96,7 @@ void C_Ticker()
}
}

static void C_schedule(int ticks_from_now, void (*callback)(void))
static void C_schedule(int ticks_from_now, void (*callback)(char*))
{
tick_event_t* t;
tick_event_t* tend = tick_head;
Expand Down Expand Up @@ -543,7 +543,7 @@ static void C_give(char* cmd)
}

extern hu_textline_t w_title;
static void C_note_internal(char* cmd, dboolean printmsg)
static void C_note(char* cmd)
{
time_t t = time(NULL);
struct tm tm = *localtime(&t);
Expand Down Expand Up @@ -592,8 +592,7 @@ static void C_note_internal(char* cmd, dboolean printmsg)
fprintf(f, "%s", cmd);
fprintf(f, "\n\n");
fclose(f);
if (printmsg)
doom_printf("Note written to %s", notefile);
doom_printf("Note written to %s", notefile);
} else {
/* print error even if printmsg not set */
doom_printf("Couldn't open note file %s", notefile);
Expand All @@ -602,11 +601,6 @@ static void C_note_internal(char* cmd, dboolean printmsg)
free(notefile);
}

static void C_note(char* cmd)
{
C_note_internal(cmd, true);
}

static void C_mdk(char* cmd)
{
extern void P_LineAttack(mobj_t* t1, angle_t angle, fixed_t distance, fixed_t slope, int damage);
Expand Down Expand Up @@ -1281,11 +1275,11 @@ static void C_quicksave(char* cmd)

static void C_noteshot(char* cmd)
{
C_note_internal(cmd, false);
C_schedule(1, C_screenshot);
C_schedule(2, C_mapfollow);
C_schedule(4, C_screenshot);
C_schedule(5, C_mapfollow);
C_note(cmd);
}

command command_list[] = {
Expand Down

0 comments on commit b3fc0e9

Please sign in to comment.