mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-25 13:55:36 -04:00
some clean-up, mostly whitespace, some comments
This commit is contained in:
parent
b704f5f7a0
commit
8e2c5d8297
@ -640,7 +640,7 @@ void AM_Start()
|
|||||||
if (!stopped)
|
if (!stopped)
|
||||||
AM_Stop();
|
AM_Stop();
|
||||||
stopped = false;
|
stopped = false;
|
||||||
if (lastlevel != gamemap || lastepisode != gameepisode || hires!=last_hires
|
if (lastlevel != gamemap || lastepisode != gameepisode || hires!=last_hires
|
||||||
|| widescreen != last_widescreen)
|
|| widescreen != last_widescreen)
|
||||||
{
|
{
|
||||||
last_hires = hires; // killough 11/98
|
last_hires = hires; // killough 11/98
|
||||||
|
@ -169,9 +169,6 @@ typedef struct player_s
|
|||||||
// True if secret level has been done.
|
// True if secret level has been done.
|
||||||
boolean didsecret;
|
boolean didsecret;
|
||||||
|
|
||||||
// [crispy] show centered "Secret Revealed!" message
|
|
||||||
//char* centermessage;
|
|
||||||
|
|
||||||
// [AM] Previous position of viewz before think.
|
// [AM] Previous position of viewz before think.
|
||||||
// Used to interpolate between camera positions.
|
// Used to interpolate between camera positions.
|
||||||
angle_t oldviewz;
|
angle_t oldviewz;
|
||||||
|
@ -723,7 +723,7 @@ void F_BunnyScroll (void)
|
|||||||
if (x2 < p2offset)
|
if (x2 < p2offset)
|
||||||
F_DrawPatchCol (x, p1, x2 - p1offset);
|
F_DrawPatchCol (x, p1, x2 - p1offset);
|
||||||
else
|
else
|
||||||
F_DrawPatchCol (x, p2, x2 - p2offset);
|
F_DrawPatchCol (x, p2, x2 - p2offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (finalecount < 1130)
|
if (finalecount < 1130)
|
||||||
@ -731,7 +731,7 @@ void F_BunnyScroll (void)
|
|||||||
if (finalecount < 1180)
|
if (finalecount < 1180)
|
||||||
{
|
{
|
||||||
V_DrawPatch ((ORIGWIDTH-13*8)/2,
|
V_DrawPatch ((ORIGWIDTH-13*8)/2,
|
||||||
(ORIGHEIGHT-8*8)/2,0,
|
(ORIGHEIGHT-8*8)/2,0,
|
||||||
W_CacheLumpName ("END0",PU_CACHE));
|
W_CacheLumpName ("END0",PU_CACHE));
|
||||||
laststage = 0;
|
laststage = 0;
|
||||||
return;
|
return;
|
||||||
@ -747,8 +747,8 @@ void F_BunnyScroll (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
sprintf (name,"END%i",stage);
|
sprintf (name,"END%i",stage);
|
||||||
V_DrawPatch ((ORIGWIDTH-13*8)/2,
|
V_DrawPatch ((ORIGWIDTH-13*8)/2,
|
||||||
(ORIGHEIGHT-8*8)/2,0,
|
(ORIGHEIGHT-8*8)/2,0,
|
||||||
W_CacheLumpName (name,PU_CACHE));
|
W_CacheLumpName (name,PU_CACHE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
int hud_active; //jff 2/17/98 controls heads-up display mode
|
int hud_active; //jff 2/17/98 controls heads-up display mode
|
||||||
int hud_displayed; //jff 2/23/98 turns heads-up display on/off
|
int hud_displayed; //jff 2/23/98 turns heads-up display on/off
|
||||||
int hud_nosecrets; //jff 2/18/98 allows secrets line to be disabled in HUD
|
int hud_nosecrets; //jff 2/18/98 allows secrets line to be disabled in HUD
|
||||||
int hud_secret_message; // "A secret is revealed" message
|
int hud_secret_message; // "A secret is revealed!" message
|
||||||
int hud_distributed; //jff 3/4/98 display HUD in different places on screen
|
int hud_distributed; //jff 3/4/98 display HUD in different places on screen
|
||||||
int hud_graph_keys=1; //jff 3/7/98 display HUD keys as graphics
|
int hud_graph_keys=1; //jff 3/7/98 display HUD keys as graphics
|
||||||
|
|
||||||
@ -453,7 +453,7 @@ void HU_Start(void)
|
|||||||
|
|
||||||
// [crispy] re-calculate WIDESCREENDELTA
|
// [crispy] re-calculate WIDESCREENDELTA
|
||||||
I_GetScreenDimensions();
|
I_GetScreenDimensions();
|
||||||
|
|
||||||
// create the message widget
|
// create the message widget
|
||||||
// messages to player in upper-left of screen
|
// messages to player in upper-left of screen
|
||||||
HUlib_initSText(&w_message, HU_MSGX, HU_MSGY, HU_MSGHEIGHT, hu_font,
|
HUlib_initSText(&w_message, HU_MSGX, HU_MSGY, HU_MSGHEIGHT, hu_font,
|
||||||
@ -1325,6 +1325,7 @@ void HU_Ticker(void)
|
|||||||
|
|
||||||
if (showMessages || message_dontfuckwithme)
|
if (showMessages || message_dontfuckwithme)
|
||||||
{
|
{
|
||||||
|
// [Woof!] "A secret is revealed!" message
|
||||||
if (plr->message == s_HUSTR_SECRETFOUND)
|
if (plr->message == s_HUSTR_SECRETFOUND)
|
||||||
{
|
{
|
||||||
extern int M_StringWidth(const char *string);
|
extern int M_StringWidth(const char *string);
|
||||||
|
@ -84,7 +84,7 @@ extern int hud_displayed; // hud is displayed
|
|||||||
//jff 2/18/98 hud/status control
|
//jff 2/18/98 hud/status control
|
||||||
extern int hud_active; // hud mode 0=off, 1=small, 2=full
|
extern int hud_active; // hud mode 0=off, 1=small, 2=full
|
||||||
extern int hud_nosecrets; // status does not list secrets/items/kills
|
extern int hud_nosecrets; // status does not list secrets/items/kills
|
||||||
extern int hud_secret_message; // "A secret is revealed" message
|
extern int hud_secret_message; // "A secret is revealed!" message
|
||||||
extern int map_player_coords, map_level_stats, map_level_time; // [FG] level stats and level time widgets
|
extern int map_player_coords, map_level_stats, map_level_time; // [FG] level stats and level time widgets
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -859,9 +859,9 @@ static void MidiProc_RegisterSong(void *data, int size)
|
|||||||
{
|
{
|
||||||
char* filename;
|
char* filename;
|
||||||
filename = M_TempFile("doom"); // [crispy] generic filename
|
filename = M_TempFile("doom"); // [crispy] generic filename
|
||||||
|
|
||||||
M_WriteFile(filename, data, size);
|
M_WriteFile(filename, data, size);
|
||||||
|
|
||||||
if (!I_MidiPipe_RegisterSong(filename))
|
if (!I_MidiPipe_RegisterSong(filename))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Error loading midi: %s\n",
|
fprintf(stderr, "Error loading midi: %s\n",
|
||||||
@ -885,7 +885,7 @@ int I_RegisterSong(void *data, int size)
|
|||||||
{
|
{
|
||||||
music = NULL;
|
music = NULL;
|
||||||
MidiProc_RegisterSong(data, size);
|
MidiProc_RegisterSong(data, size);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
@ -902,9 +902,9 @@ int I_RegisterSong(void *data, int size)
|
|||||||
int midlen;
|
int midlen;
|
||||||
|
|
||||||
memset(&mididata, 0, sizeof(MIDI));
|
memset(&mididata, 0, sizeof(MIDI));
|
||||||
|
|
||||||
if((err = mmus2mid((byte *)data, &mididata, 89, 0)))
|
if((err = mmus2mid((byte *)data, &mididata, 89, 0)))
|
||||||
{
|
{
|
||||||
// Nope, not a mus.
|
// Nope, not a mus.
|
||||||
dprintf("Error loading music: %d", err);
|
dprintf("Error loading music: %d", err);
|
||||||
return 0;
|
return 0;
|
||||||
@ -912,7 +912,7 @@ int I_RegisterSong(void *data, int size)
|
|||||||
|
|
||||||
// Hurrah! Let's make it a mid and give it to SDL_mixer
|
// Hurrah! Let's make it a mid and give it to SDL_mixer
|
||||||
MIDIToMidi(&mididata, &mid, &midlen);
|
MIDIToMidi(&mididata, &mid, &midlen);
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
if (midi_server_initialized)
|
if (midi_server_initialized)
|
||||||
{
|
{
|
||||||
@ -927,15 +927,15 @@ int I_RegisterSong(void *data, int size)
|
|||||||
rw = SDL_RWFromMem(mid, midlen);
|
rw = SDL_RWFromMem(mid, midlen);
|
||||||
music = Mix_LoadMUS_RW(rw, false);
|
music = Mix_LoadMUS_RW(rw, false);
|
||||||
|
|
||||||
if(music == NULL)
|
if(music == NULL)
|
||||||
{
|
{
|
||||||
// Conversion failed, free everything
|
// Conversion failed, free everything
|
||||||
SDL_FreeRW(rw);
|
SDL_FreeRW(rw);
|
||||||
rw = NULL;
|
rw = NULL;
|
||||||
free(mid);
|
free(mid);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Conversion succeeded
|
// Conversion succeeded
|
||||||
// -> save memory block to free when unregistering
|
// -> save memory block to free when unregistering
|
||||||
music_block = mid;
|
music_block = mid;
|
||||||
|
@ -909,8 +909,8 @@ void I_ShutdownGraphics(void)
|
|||||||
char buf[16];
|
char buf[16];
|
||||||
int buflen;
|
int buflen;
|
||||||
|
|
||||||
// Store the (x, y) coordinates of the window
|
// Store the (x, y) coordinates of the window
|
||||||
// in the "window_position" config parameter
|
// in the "window_position" config parameter
|
||||||
SDL_GetWindowPosition(screen, &x, &y);
|
SDL_GetWindowPosition(screen, &x, &y);
|
||||||
M_snprintf(buf, sizeof(buf), "%i,%i", x, y);
|
M_snprintf(buf, sizeof(buf), "%i,%i", x, y);
|
||||||
buflen = strlen(buf);
|
buflen = strlen(buf);
|
||||||
@ -1077,7 +1077,7 @@ static void I_GetWindowPosition(int *x, int *y, int w, int h)
|
|||||||
void I_GetScreenDimensions(void)
|
void I_GetScreenDimensions(void)
|
||||||
{
|
{
|
||||||
SDL_DisplayMode mode;
|
SDL_DisplayMode mode;
|
||||||
int w = 16, h = 10;
|
int w = 16, h = 9;
|
||||||
int ah;
|
int ah;
|
||||||
static boolean firsttime = true;
|
static boolean firsttime = true;
|
||||||
|
|
||||||
@ -1109,24 +1109,6 @@ void I_GetScreenDimensions(void)
|
|||||||
// [crispy] widescreen rendering makes no sense without aspect ratio correction
|
// [crispy] widescreen rendering makes no sense without aspect ratio correction
|
||||||
if (widescreen && useaspect)
|
if (widescreen && useaspect)
|
||||||
{
|
{
|
||||||
// switch(crispy->widescreen)
|
|
||||||
// {
|
|
||||||
// case RATIO_16_10:
|
|
||||||
// w = 16;
|
|
||||||
// h = 10;
|
|
||||||
// break;
|
|
||||||
// case RATIO_16_9:
|
|
||||||
// w = 16;
|
|
||||||
// h = 9;
|
|
||||||
// break;
|
|
||||||
// case RATIO_21_9:
|
|
||||||
// w = 21;
|
|
||||||
// h = 9;
|
|
||||||
// break;
|
|
||||||
// default:
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
|
|
||||||
SCREENWIDTH = w * ah / h;
|
SCREENWIDTH = w * ah / h;
|
||||||
// [crispy] make sure SCREENWIDTH is an integer multiple of 4 ...
|
// [crispy] make sure SCREENWIDTH is an integer multiple of 4 ...
|
||||||
SCREENWIDTH = (SCREENWIDTH + (hires ? 0 : 3)) & (int)~3;
|
SCREENWIDTH = (SCREENWIDTH + (hires ? 0 : 3)) & (int)~3;
|
||||||
|
@ -1786,16 +1786,16 @@ void M_DrawBackground(char* patchname, byte *back_dest)
|
|||||||
#else // while this pixel-doubles it
|
#else // while this pixel-doubles it
|
||||||
/*
|
/*
|
||||||
for (y = 0 ; y < SCREENHEIGHT ; src = ((++y & 63)<<6) + back_src,
|
for (y = 0 ; y < SCREENHEIGHT ; src = ((++y & 63)<<6) + back_src,
|
||||||
back_dest += SCREENWIDTH*2)
|
back_dest += SCREENWIDTH*2)
|
||||||
for (x = 0 ; x < SCREENWIDTH/64 ; x++)
|
for (x = 0 ; x < SCREENWIDTH/64 ; x++)
|
||||||
{
|
{
|
||||||
int i = 63;
|
int i = 63;
|
||||||
do
|
do
|
||||||
back_dest[i*2] = back_dest[i*2+SCREENWIDTH*2] =
|
back_dest[i*2] = back_dest[i*2+SCREENWIDTH*2] =
|
||||||
back_dest[i*2+1] = back_dest[i*2+SCREENWIDTH*2+1] = src[i];
|
back_dest[i*2+1] = back_dest[i*2+SCREENWIDTH*2+1] = src[i];
|
||||||
while (--i>=0);
|
while (--i>=0);
|
||||||
back_dest += 128;
|
back_dest += 128;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
for (int y = 0; y < SCREENHEIGHT<<1; y++)
|
for (int y = 0; y < SCREENHEIGHT<<1; y++)
|
||||||
for (int x = 0; x < SCREENWIDTH<<1; x += 2)
|
for (int x = 0; x < SCREENWIDTH<<1; x += 2)
|
||||||
@ -1810,10 +1810,10 @@ void M_DrawBackground(char* patchname, byte *back_dest)
|
|||||||
/*
|
/*
|
||||||
for (y = 0 ; y < SCREENHEIGHT ; src = ((++y & 63)<<6) + back_src)
|
for (y = 0 ; y < SCREENHEIGHT ; src = ((++y & 63)<<6) + back_src)
|
||||||
for (x = 0 ; x < SCREENWIDTH/64 ; x++)
|
for (x = 0 ; x < SCREENWIDTH/64 ; x++)
|
||||||
{
|
{
|
||||||
memcpy (back_dest,back_src+((y & 63)<<6),64);
|
memcpy (back_dest,back_src+((y & 63)<<6),64);
|
||||||
back_dest += 64;
|
back_dest += 64;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
for (y = 0; y < SCREENHEIGHT; y++)
|
for (y = 0; y < SCREENHEIGHT; y++)
|
||||||
for (x = 0; x < SCREENWIDTH; x++)
|
for (x = 0; x < SCREENWIDTH; x++)
|
||||||
@ -2809,7 +2809,7 @@ setup_menu_t stat_settings1[] = // Status Bar and HUD Settings screen
|
|||||||
{"ARMOR GOOD/EXTRA" ,S_NUM ,m_null,ST_X,ST_Y+13*8, {"armor_green"}},
|
{"ARMOR GOOD/EXTRA" ,S_NUM ,m_null,ST_X,ST_Y+13*8, {"armor_green"}},
|
||||||
{"AMMO LOW/OK" ,S_NUM ,m_null,ST_X,ST_Y+14*8, {"ammo_red"}},
|
{"AMMO LOW/OK" ,S_NUM ,m_null,ST_X,ST_Y+14*8, {"ammo_red"}},
|
||||||
{"AMMO OK/GOOD" ,S_NUM ,m_null,ST_X,ST_Y+15*8, {"ammo_yellow"}},
|
{"AMMO OK/GOOD" ,S_NUM ,m_null,ST_X,ST_Y+15*8, {"ammo_yellow"}},
|
||||||
{"\"A SECRET IS REVEALED\" MESSAGE",S_YESNO,m_null,ST_X,ST_Y+16*8, {"hud_secret_message"}},
|
{"\"A SECRET IS REVEALED!\" MESSAGE",S_YESNO,m_null,ST_X,ST_Y+16*8, {"hud_secret_message"}},
|
||||||
|
|
||||||
// Button for resetting to defaults
|
// Button for resetting to defaults
|
||||||
{0,S_RESET,m_null,X_BUTTON,Y_BUTTON},
|
{0,S_RESET,m_null,X_BUTTON,Y_BUTTON},
|
||||||
|
@ -1698,11 +1698,12 @@ default_t defaults[] = {
|
|||||||
"1 to disable display of kills/items/secrets on HUD"
|
"1 to disable display of kills/items/secrets on HUD"
|
||||||
},
|
},
|
||||||
|
|
||||||
{ // "A secret is revealed" message
|
// "A secret is revealed!" message
|
||||||
|
{
|
||||||
"hud_secret_message",
|
"hud_secret_message",
|
||||||
(config_t *) &hud_secret_message, NULL,
|
(config_t *) &hud_secret_message, NULL,
|
||||||
{0}, {0,1}, number, ss_none, wad_no,
|
{0}, {0,1}, number, ss_none, wad_no,
|
||||||
"\"A secret is revealed\" message"
|
"\"A secret is revealed!\" message"
|
||||||
},
|
},
|
||||||
|
|
||||||
{ // killough 2/8/98: weapon preferences set by user:
|
{ // killough 2/8/98: weapon preferences set by user:
|
||||||
|
@ -303,6 +303,8 @@ int mmus2mid(UBYTE *mus, MIDI *mididata, UWORD division, int nocomp)
|
|||||||
signed char MUS2MIDchannel[MIDI_TRACKS];
|
signed char MUS2MIDchannel[MIDI_TRACKS];
|
||||||
|
|
||||||
// copy the MUS header from the MUS buffer to the MUSh header structure
|
// copy the MUS header from the MUS buffer to the MUSh header structure
|
||||||
|
|
||||||
|
// [Woof!] fix MIDI endianess
|
||||||
memcpy(MUSh.ID, mus, 4);
|
memcpy(MUSh.ID, mus, 4);
|
||||||
MUSh.ScoreLength = READ_INT16(&mus[4]);
|
MUSh.ScoreLength = READ_INT16(&mus[4]);
|
||||||
MUSh.ScoreStart = READ_INT16(&mus[6]);
|
MUSh.ScoreStart = READ_INT16(&mus[6]);
|
||||||
|
@ -234,7 +234,7 @@ sfxinfo_t S_sfx[] = {
|
|||||||
{ "dgpain", sg_none, 96, 0, -1, -1, 0 },
|
{ "dgpain", sg_none, 96, 0, -1, -1, 0 },
|
||||||
|
|
||||||
// [crispy] play DSSECRET if available
|
// [crispy] play DSSECRET if available
|
||||||
{ "secret", sg_none, 100, 0, -1, -1, 0 },
|
{ "secret", sg_none, 100, 0, -1, -1, 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@ -386,11 +386,11 @@ void ST_refreshBackground(boolean force)
|
|||||||
// killough 3/7/98: make face background change with displayplayer
|
// killough 3/7/98: make face background change with displayplayer
|
||||||
if (netgame)
|
if (netgame)
|
||||||
V_DrawPatch(ST_FX, 0, BG, faceback[displayplayer]);
|
V_DrawPatch(ST_FX, 0, BG, faceback[displayplayer]);
|
||||||
|
|
||||||
// [crispy] copy entire SCREENWIDTH, to preserve the pattern
|
// [crispy] copy entire SCREENWIDTH, to preserve the pattern
|
||||||
// to the left and right of the status bar in widescren mode
|
// to the left and right of the status bar in widescren mode
|
||||||
if (!force)
|
if (!force)
|
||||||
{
|
{
|
||||||
V_CopyRect(ST_X, 0, BG, SCREENWIDTH, ST_HEIGHT, ST_X, ST_Y, FG);
|
V_CopyRect(ST_X, 0, BG, SCREENWIDTH, ST_HEIGHT, ST_X, ST_Y, FG);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -429,7 +429,7 @@ void W_InitMultipleFiles(char *const *filenames)
|
|||||||
// killough 4/4/98: add colormap markers
|
// killough 4/4/98: add colormap markers
|
||||||
W_CoalesceMarkedResource("C_START", "C_END", ns_colormaps);
|
W_CoalesceMarkedResource("C_START", "C_END", ns_colormaps);
|
||||||
|
|
||||||
// To ignore lumps between HI_START / HI_END markers
|
// [Woof!] namespace to avoid conflicts with high-resolution textures
|
||||||
W_CoalesceMarkedResource("HI_START", "HI_END", ns_hires);
|
W_CoalesceMarkedResource("HI_START", "HI_END", ns_hires);
|
||||||
|
|
||||||
// set up caching
|
// set up caching
|
||||||
|
@ -70,7 +70,7 @@ typedef struct
|
|||||||
ns_sprites,
|
ns_sprites,
|
||||||
ns_flats,
|
ns_flats,
|
||||||
ns_colormaps,
|
ns_colormaps,
|
||||||
ns_hires // namespace to avoid conflicts with high-resolution textures
|
ns_hires // [Woof!] namespace to avoid conflicts with high-resolution textures
|
||||||
} namespace;
|
} namespace;
|
||||||
|
|
||||||
int handle;
|
int handle;
|
||||||
|
@ -3,7 +3,7 @@ if(WIN32)
|
|||||||
|
|
||||||
add_executable(woof-midiproc WIN32 buffer.c buffer.h main.c proto.h)
|
add_executable(woof-midiproc WIN32 buffer.c buffer.h main.c proto.h)
|
||||||
|
|
||||||
target_woof_settings(woof-midiproc)
|
target_woof_settings(woof-midiproc)
|
||||||
target_include_directories(woof-midiproc
|
target_include_directories(woof-midiproc
|
||||||
PRIVATE "../Source/" "${CMAKE_CURRENT_BINARY_DIR}/../")
|
PRIVATE "../Source/" "${CMAKE_CURRENT_BINARY_DIR}/../")
|
||||||
target_link_libraries(woof-midiproc SDL2::SDL2main SDL2::mixer)
|
target_link_libraries(woof-midiproc SDL2::SDL2main SDL2::mixer)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user