Skip to content

Commit

Permalink
Ditch sound and net server code
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyPtn committed Sep 26, 2024
1 parent 1120b70 commit e54775b
Show file tree
Hide file tree
Showing 25 changed files with 10 additions and 3,601 deletions.
49 changes: 0 additions & 49 deletions linuxdoom-1.10/i_sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import wad;
import argv;
import doomdef;

#if SNDINTR

// Update all 30 millisecs, approx. 30fps synchronized.
// Linux resolution is allegedly 10 millisecs,
Expand All @@ -55,9 +54,6 @@ import doomdef;
// Get the interrupt. Set duration in millisecs.
int I_SoundSetTimer(int duration_of_tick);
void I_SoundDelTimer(void);
#else
// None?
#endif

// A quick hack to establish a protocol between
// synchronous mix buffer updates and asynchronous
Expand Down Expand Up @@ -378,15 +374,6 @@ int I_StartSound(int id, int vol, int sep, int pitch, int priority) {

// UNUSED
priority = 0;

#ifdef SNDSERV
if (sndserver) {
fprintf(sndserver, "p%2.2x%2.2x%2.2x%2.2x\n", id, pitch, vol, sep);
fflush(sndserver);
}
// warning: control reaches end of non-void function.
return id;
#else
// Debug.
// fprintf( stderr, "starting sound %d", id );

Expand All @@ -396,7 +383,6 @@ int I_StartSound(int id, int vol, int sep, int pitch, int priority) {
// fprintf( stderr, "/handle is %d\n", id );

return id;
#endif
}

void I_StopSound(int handle) {
Expand Down Expand Up @@ -428,10 +414,8 @@ int I_SoundIsPlaying(int handle) {
// This function currently supports only 16bit.
//
void I_UpdateSound(void) {
#ifdef SNDINTR
// Debug. Count buffer misses with interrupt.
static int misses = 0;
#endif

// Mix current sound data.
// Data, from raw sound, for right and left.
Expand Down Expand Up @@ -520,7 +504,6 @@ void I_UpdateSound(void) {
rightout += step;
}

#ifdef SNDINTR
// Debug check.
if (flag) {
misses += flag;
Expand All @@ -534,7 +517,6 @@ void I_UpdateSound(void) {

// Increment flag for update.
flag++;
#endif
}

//
Expand All @@ -561,13 +543,6 @@ void I_UpdateSoundParams(int handle, int vol, int sep, int pitch) {
}

void I_ShutdownSound(void) {
#ifdef SNDSERV
if (sndserver) {
// Send a "quit" command.
fprintf(sndserver, "q\n");
fflush(sndserver);
}
#else
// Wait till all pending sounds are finished.
int done = 0;
int i;
Expand All @@ -584,43 +559,21 @@ void I_ShutdownSound(void) {
// if (i==8)
done = 1;
}
#ifdef SNDINTR
I_SoundDelTimer();
#endif

// Cleaning up -releasing the DSP device.
//close(audio_fd);
#endif

// Done.
return;
}

void I_InitSound() {
#ifdef SNDSERV
char buffer[256];

if (getenv("DOOMWADDIR"))
snprintf(buffer, 256, "%s/%s", getenv("DOOMWADDIR"), sndserver_filename);
else
snprintf(buffer, 256, "%s", sndserver_filename);

// start sound process
// if ( !access(buffer, X_OK) )
{
strcat(buffer, " -quiet");
// sndserver = popen(buffer, "w");
}
// else
fprintf(stderr, "Could not start sound server [%s]\n", buffer);
#else

int i;

#ifdef SNDINTR
fprintf(stderr, "I_SoundSetTimer: %d microsecs\n", SOUND_INTERVAL);
I_SoundSetTimer(SOUND_INTERVAL);
#endif

// Secure and configure sound device first.
fprintf(stderr, "I_InitSound: ");
Expand Down Expand Up @@ -672,8 +625,6 @@ void I_InitSound() {

// Finished initialization.
fprintf(stderr, "I_InitSound: sound module ready\n");

#endif
}

//
Expand Down
9 changes: 0 additions & 9 deletions linuxdoom-1.10/i_sound.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@

#pragma once

// UNIX hack, to be removed.
#ifdef SNDSERV

#include <stdio.h>

extern FILE *sndserver;
extern const char *sndserver_filename;
#endif

#include "doomstat.h"
#include "sounds.h"

Expand Down
5 changes: 1 addition & 4 deletions linuxdoom-1.10/s_sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,7 @@ void S_StartSoundAtVolume(void *origin_p, int sfx_id, int volume) {

mobj_t *origin = (mobj_t *)origin_p;

// Debug.
/*fprintf( stderr,
"S_StartSoundAtVolume: playing sound %d (%s)\n",
sfx_id, S_sfx[sfx_id].name );*/
I_Debug("S_StartSoundAtVolume: playing sound {} ({})",sfx_id, S_sfx[sfx_id].name );

// check for bogus sound #
if (sfx_id < 1 || sfx_id > NUMSFX)
Expand Down
126 changes: 0 additions & 126 deletions sersrc/DOOMNET.C

This file was deleted.

60 changes: 0 additions & 60 deletions sersrc/DOOMNET.H

This file was deleted.

Loading

0 comments on commit e54775b

Please sign in to comment.