From ce8a95a5b912194ea76ebd5fb6a78c84a22747ad Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 1 Apr 2013 16:38:55 +0000 Subject: Correct incorrect doc comment. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2579 --- textscreen/txt_window.h | 49 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/textscreen/txt_window.h b/textscreen/txt_window.h index e183cf6d..19440941 100644 --- a/textscreen/txt_window.h +++ b/textscreen/txt_window.h @@ -1,4 +1,4 @@ -// Emacs style mode select -*- C++ -*- +// Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // // Copyright(C) 2006 Simon Howard @@ -49,15 +49,16 @@ typedef struct txt_window_s txt_window_t; -#include "txt_widget.h" +#include "txt_widget.h" #include "txt_table.h" #include "txt_window_action.h" // Callback function for window key presses -typedef int (*TxtWindowKeyPress)(txt_window_t *window, int key, void *user_data); -typedef int (*TxtWindowMousePress)(txt_window_t *window, - int x, int y, int b, +typedef int (*TxtWindowKeyPress)(txt_window_t *window, int key, + void *user_data); +typedef int (*TxtWindowMousePress)(txt_window_t *window, + int x, int y, int b, void *user_data); struct txt_window_s @@ -65,7 +66,7 @@ struct txt_window_s // Base class: all windows are tables with one column. txt_table_t table; - + // Window title char *title; @@ -114,17 +115,31 @@ void TXT_CloseWindow(txt_window_t *window); /** * Set the position of a window on the screen. * - * The window is specified as coordinates relative to a predefined - * position on the screen (eg. center of the screen, top left of the - * screen, etc). + * The position is specified as a pair of x, y, coordinates on the + * screen. These specify the position of a particular point on the + * window. The following are some examples: + * + * + * // Centered on the screen: + * + * TXT_SetWindowPosition(window, TXT_HORIZ_CENTER, TXT_VERT_CENTER, + * TXT_SCREEN_W / 2, TXT_SCREEN_H / 2); + * + * // Horizontally centered, with top of the window on line 6: + * + * TXT_SetWindowPosition(window, TXT_HORIZ_CENTER, TXT_VERT_TOP, + * TXT_SCREEN_W / 2, 6); + * + * // Top-left of window at 20, 6: + * + * TXT_SetWindowPosition(window, TXT_HORIZ_LEFT, TXT_VERT_TOP, 20, 6); + * * * @param window The window. - * @param horiz_align Horizontal position on the screen to which the - * coordinates are relative (left side, right side - * or center). - * @param vert_align Vertical position on the screen to which the - * coordinates are relative (top, bottom or center). - * @param x X coordinate (horizonal axis) for window position. + * @param horiz_align Horizontal location on the window for the X + * position. + * @param vert_align Vertical location on the window for the Y position. + * @param x X coordinate (horizontal axis) for window position. * @param y Y coordinate (vertical axis) for window position. */ @@ -145,7 +160,7 @@ void TXT_SetWindowPosition(txt_window_t *window, * current window action in the given slot is removed. */ -void TXT_SetWindowAction(txt_window_t *window, txt_horiz_align_t position, +void TXT_SetWindowAction(txt_window_t *window, txt_horiz_align_t position, txt_window_action_t *action); /** @@ -176,6 +191,6 @@ void TXT_SetMouseListener(txt_window_t *window, TxtWindowMousePress mouse_listener, void *user_data); -#endif /* #ifndef TXT_WINDOW_T */ +#endif /* #ifndef TXT_WINDOW_H */ -- cgit v1.2.3 From ba1c027718cbb862a2f87a417d8bdc94a9897dcf Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 27 May 2013 17:56:06 +0000 Subject: Remove use of WINAPI macro to fix compile under MSVC. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2602 --- textscreen/txt_fileselect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/textscreen/txt_fileselect.c b/textscreen/txt_fileselect.c index 56fa1108..6e492734 100644 --- a/textscreen/txt_fileselect.c +++ b/textscreen/txt_fileselect.c @@ -149,7 +149,7 @@ static char *ExecReadOutput(char **argv) #include #include -static BOOL WINAPI (*MyGetOpenFileName)(LPOPENFILENAME) = NULL; +static BOOL (*MyGetOpenFileName)(LPOPENFILENAME) = NULL; static LPITEMIDLIST (*MySHBrowseForFolder)(LPBROWSEINFO) = NULL; static BOOL (*MySHGetPathFromIDList)(LPITEMIDLIST, LPTSTR) = NULL; -- cgit v1.2.3 From 0fea3b6cd1c5e80aaed4a045d11025db34a83d7f Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 17 Jun 2013 23:02:21 +0000 Subject: Refactor handling of novert to take place at the lower layers rather than in the game code. This makes the behavior closer to Vanilla and stops the mouse affecting the menus when novert is enabled (thanks manny). Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2606 --- src/d_main.c | 18 ------------------ src/g_game.c | 12 +----------- src/i_video.c | 38 +++++++++++++++++++++++++++++++++++--- 3 files changed, 36 insertions(+), 32 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 025c31eb..171a0f6c 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1427,24 +1427,6 @@ void D_DoomMain (void) startloadgame = -1; } - //! - // @category video - // - // Disable vertical mouse movement. - // - - if (M_CheckParm("-novert")) - novert = true; - - //! - // @category video - // - // Enable vertical mouse movement. - // - - if (M_CheckParm("-nonovert")) - novert = false; - if (W_CheckNumForName("SS_START") >= 0 || W_CheckNumForName("FF_END") >= 0) { diff --git a/src/g_game.c b/src/g_game.c index fe168fae..33243b21 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -216,11 +216,6 @@ int joybstraferight = -1; int joybprevweapon = -1; int joybnextweapon = -1; -// fraggle: Disallow mouse and joystick movement to cause forward/backward -// motion. Specified with the '-novert' command line parameter. -// This is an int to allow saving to config file - -int novert = 0; @@ -716,12 +711,7 @@ void G_BuildTiccmd (ticcmd_t* cmd) } } - // fraggle: allow disabling mouse y movement - - if (!novert) - { - forward += mousey; - } + forward += mousey; if (strafe) side += mousex*2; diff --git a/src/i_video.c b/src/i_video.c index fdde7766..8af04956 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -113,6 +113,12 @@ static boolean initialized = false; static boolean nomouse = false; extern int usemouse; +// Disallow mouse and joystick movement to cause forward/backward +// motion. Specified with the '-novert' command line parameter. +// This is an int to allow saving to config file. + +int novert = 0; + // Bit mask of mouse button state. static unsigned int mouse_button_state = 0; @@ -703,8 +709,16 @@ static void I_ReadMouse(void) ev.type = ev_mouse; ev.data1 = mouse_button_state; ev.data2 = AccelerateMouse(x); - ev.data3 = -AccelerateMouse(y); - + + if (!novert) + { + ev.data3 = 0; + } + else + { + ev.data3 = -AccelerateMouse(y); + } + D_PostEvent(&ev); } @@ -1457,13 +1471,31 @@ static void CheckCommandLine(void) } //! - // @category video + // @category video // // Disable the mouse. // nomouse = M_CheckParm("-nomouse") > 0; + //! + // @category video + // + // Disable vertical mouse movement. + // + + if (M_CheckParm("-novert")) + novert = true; + + //! + // @category video + // + // Enable vertical mouse movement. + // + + if (M_CheckParm("-nonovert")) + novert = false; + //! // @category video // @arg -- cgit v1.2.3 From 431b79530bea2f5666e0ca362773160ab7274f5d Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 19 Jun 2013 20:50:09 +0000 Subject: Fix OPL MIDI playback on big endian systems (thanks GhostlyDeath). Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2607 --- src/i_oplmusic.c | 6 +++--- src/midifile.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/i_oplmusic.c b/src/i_oplmusic.c index d2116ddb..f6ca4c6d 100644 --- a/src/i_oplmusic.c +++ b/src/i_oplmusic.c @@ -736,7 +736,7 @@ static unsigned int FrequencyForVoice(opl_voice_t *voice) gm_voice = &voice->current_instr->voices[voice->current_instr_voice]; - if ((voice->current_instr->flags & GENMIDI_FLAG_FIXED) == 0) + if ((SHORT(voice->current_instr->flags) & GENMIDI_FLAG_FIXED) == 0) { note += (signed short) SHORT(gm_voice->base_note_offset); } @@ -853,7 +853,7 @@ static void VoiceKeyOn(opl_channel_data_t *channel, // Work out the note to use. This is normally the same as // the key, unless it is a fixed pitch instrument. - if ((instrument->flags & GENMIDI_FLAG_FIXED) != 0) + if ((SHORT(instrument->flags) & GENMIDI_FLAG_FIXED) != 0) { voice->note = instrument->fixed_note; } @@ -920,7 +920,7 @@ static void KeyOnEvent(opl_track_data_t *track, midi_event_t *event) VoiceKeyOn(channel, instrument, 0, key, volume); - if ((instrument->flags & GENMIDI_FLAG_2VOICE) != 0) + if ((SHORT(instrument->flags) & GENMIDI_FLAG_2VOICE) != 0) { VoiceKeyOn(channel, instrument, 1, key, volume); } diff --git a/src/midifile.c b/src/midifile.c index bd935ca1..fcb50848 100644 --- a/src/midifile.c +++ b/src/midifile.c @@ -697,7 +697,7 @@ int MIDI_GetNextEvent(midi_track_iter_t *iter, midi_event_t **event) unsigned int MIDI_GetFileTimeDivision(midi_file_t *file) { - return file->header.time_division; + return SHORT(file->header.time_division); } void MIDI_RestartIterator(midi_track_iter_t *iter) -- cgit v1.2.3 From 50289818e9d59848c363aa3922133fee9c119c22 Mon Sep 17 00:00:00 2001 From: Russell Rice Date: Wed, 3 Jul 2013 21:41:46 +0000 Subject: - Update codeblocks projects - Remove missing setup-manifest.xml file inclusion from setup-res.rc file Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2610 --- codeblocks/game.cbp | 441 +++++++++++++++++++++++----------------------- codeblocks/setup-res.rc | 2 - codeblocks/textscreen.cbp | 99 ++++++----- 3 files changed, 275 insertions(+), 267 deletions(-) diff --git a/codeblocks/game.cbp b/codeblocks/game.cbp index 47b8c67e..1586d73a 100644 --- a/codeblocks/game.cbp +++ b/codeblocks/game.cbp @@ -7,9 +7,9 @@