CD Audio Support.
This commit is contained in:
parent
b4a55b2618
commit
4508748944
4 changed files with 132 additions and 59 deletions
2
Makefile
2
Makefile
|
@ -20,7 +20,7 @@ LDLIBS = -L/usr/X11R6/lib -lX11 -lXext -lGL `sdl-config --libs` -lopenal
|
|||
|
||||
AFLAGS = -g -w+macro-params -w+orphan-labels -w+number-overflow
|
||||
|
||||
ROOT = main.c mathline.c math.asm render.c opengl.c net.c menus.c openal.c winapi.c stubs.c frustum.c kshape.c map.c maths.c md5.c mem3dc.c mem3dcpp.cpp module.c morph.c object.c shpanim.c sphere.c tables.c vdb.c version.c
|
||||
ROOT = main.c mathline.c math.asm render.c opengl.c net.c menus.c openal.c cdplayer.c winapi.c stubs.c frustum.c kshape.c map.c maths.c md5.c mem3dc.c mem3dcpp.cpp module.c morph.c object.c shpanim.c sphere.c tables.c vdb.c version.c
|
||||
AVP = ai_sight.c avpview.c bh_agun.c bh_ais.c bh_alien.c bh_binsw.c bh_cable.c bh_corpse.c bh_deathvol.c bh_debri.c bh_dummy.c bh_fan.c bh_far.c bh_fhug.c bh_gener.c bh_ldoor.c bh_lift.c bh_light.c bh_lnksw.c bh_ltfx.c bh_marin.c bh_mission.c bh_near.c bh_pargen.c bh_plachier.c bh_plift.c bh_pred.c bh_queen.c bh_rubberduck.c bh_selfdest.c bh_snds.c bh_spcl.c bh_swdor.c bh_track.c bh_types.c bh_videoscreen.c bh_waypt.c bh_weap.c bh_xeno.c bonusabilities.c cconvars.cpp cdtrackselection.cpp cheatmodes.c comp_map.c comp_shp.c consolelog.cpp davehook.cpp deaths.c decal.c detaillevels.c dynamics.c dynblock.c equipmnt.c equiputl.cpp extents.c game.c game_statistics.c gamecmds.cpp gamevars.cpp hmodel.c hud.c inventry.c language.c lighting.c load_shp.c los.c maps.c mempool.c messagehistory.c missions.cpp movement.c paintball.c particle.c pfarlocs.c pheromon.c player.c pmove.c psnd.c psndproj.c pvisible.c savegame.c scream.cpp secstats.c sfx.c stratdef.c targeting.c track.c triggers.c weapons.c
|
||||
SHAPES = cube.c
|
||||
SUPPORT = consbind.cpp consbtch.cpp coordstr.cpp daemon.cpp indexfnt.cpp r2base.cpp r2pos666.cpp reflist.cpp refobj.cpp rentrntq.cpp scstring.cpp strtab.cpp strutil.c trig666.cpp wrapstr.cpp
|
||||
|
|
125
src/cdplayer.c
Normal file
125
src/cdplayer.c
Normal file
|
@ -0,0 +1,125 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <SDL/SDL.h>
|
||||
|
||||
#include "fixer.h"
|
||||
#include "win95/cd_player.h"
|
||||
|
||||
static int HaveCDROM = 0;
|
||||
static SDL_CD *cdrom = NULL;
|
||||
|
||||
void CDDA_Start()
|
||||
{
|
||||
/*
|
||||
fprintf(stderr, "CDDA_Start()\n");
|
||||
*/
|
||||
|
||||
int numdrives;
|
||||
|
||||
if (!HaveCDROM) {
|
||||
HaveCDROM = 1;
|
||||
SDL_Init(SDL_INIT_CDROM);
|
||||
}
|
||||
|
||||
if (cdrom != NULL)
|
||||
CDDA_End();
|
||||
|
||||
numdrives = SDL_CDNumDrives();
|
||||
|
||||
if (numdrives == 0)
|
||||
return;
|
||||
|
||||
cdrom = SDL_CDOpen(0);
|
||||
}
|
||||
|
||||
void CDDA_End()
|
||||
{
|
||||
/*
|
||||
fprintf(stderr, "CDDA_End()\n");
|
||||
*/
|
||||
|
||||
if (cdrom != NULL) {
|
||||
CDDA_Stop();
|
||||
|
||||
SDL_CDClose(cdrom);
|
||||
}
|
||||
|
||||
cdrom = NULL;
|
||||
}
|
||||
|
||||
void CDDA_ChangeVolume(int volume)
|
||||
{
|
||||
fprintf(stderr, "CDDA_ChangeVolume(%d)\n", volume);
|
||||
}
|
||||
|
||||
int CDDA_CheckNumberOfTracks()
|
||||
{
|
||||
/*
|
||||
fprintf(stderr, "CDDA_CheckNumberOfTracks()\n");
|
||||
*/
|
||||
|
||||
if (cdrom == NULL)
|
||||
return 0;
|
||||
|
||||
return cdrom->numtracks;
|
||||
}
|
||||
|
||||
int CDDA_IsOn()
|
||||
{
|
||||
/*
|
||||
fprintf(stderr, "CDDA_IsOn()\n");
|
||||
*/
|
||||
return (cdrom != NULL);
|
||||
}
|
||||
|
||||
int CDDA_IsPlaying()
|
||||
{
|
||||
/*
|
||||
fprintf(stderr, "CDDA_IsPlaying()\n");
|
||||
*/
|
||||
if (cdrom == NULL)
|
||||
return 0;
|
||||
|
||||
return (SDL_CDStatus(cdrom) == CD_PLAYING);
|
||||
}
|
||||
|
||||
void CDDA_Play(int CDDATrack)
|
||||
{
|
||||
/*
|
||||
fprintf(stderr, "CDDA_Play(%d)\n", CDDATrack);
|
||||
*/
|
||||
if (cdrom == NULL)
|
||||
return;
|
||||
|
||||
if (CD_INDRIVE(SDL_CDStatus(cdrom)))
|
||||
SDL_CDPlayTracks(cdrom, CDDATrack-1, 0, 1, 0);
|
||||
}
|
||||
|
||||
void CDDA_PlayLoop(int CDDATrack)
|
||||
{
|
||||
fprintf(stderr, "CDDA_PlayLoop(%d)\n", CDDATrack);
|
||||
|
||||
/* can't loop with SDL without a thread, so just play the track */
|
||||
CDDA_Play(CDDATrack);
|
||||
}
|
||||
|
||||
void CDDA_Stop()
|
||||
{
|
||||
/*
|
||||
fprintf(stderr, "CDDA_Stop()\n");
|
||||
*/
|
||||
if (cdrom == NULL)
|
||||
return;
|
||||
|
||||
if (CD_INDRIVE(SDL_CDStatus(cdrom)))
|
||||
SDL_CDStop(cdrom);
|
||||
}
|
||||
|
||||
void CDDA_SwitchOn()
|
||||
{
|
||||
/*
|
||||
fprintf(stderr, "CDDA_SwitchOn()\n");
|
||||
*/
|
||||
}
|
57
src/stubs.c
57
src/stubs.c
|
@ -308,63 +308,6 @@ void GenerateDirectDrawSurface()
|
|||
int use_mmx_math = 0;
|
||||
|
||||
|
||||
/* cd_player.c */
|
||||
void CDDA_Start()
|
||||
{
|
||||
fprintf(stderr, "CDDA_Start()\n");
|
||||
}
|
||||
|
||||
void CDDA_End()
|
||||
{
|
||||
fprintf(stderr, "CDDA_End()\n");
|
||||
}
|
||||
|
||||
void CDDA_ChangeVolume(int volume)
|
||||
{
|
||||
fprintf(stderr, "CDDA_ChangeVolume(%d)\n", volume);
|
||||
}
|
||||
|
||||
int CDDA_CheckNumberOfTracks()
|
||||
{
|
||||
fprintf(stderr, "CDDA_CheckNumberOfTracks()\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CDDA_IsOn()
|
||||
{
|
||||
fprintf(stderr, "CDDA_IsOn()\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CDDA_IsPlaying()
|
||||
{
|
||||
fprintf(stderr, "CDDA_IsPlaying()\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CDDA_Play(int CDDATrack)
|
||||
{
|
||||
fprintf(stderr, "CDDA_Play(%d)\n", CDDATrack);
|
||||
}
|
||||
|
||||
void CDDA_PlayLoop(int CDDATrack)
|
||||
{
|
||||
fprintf(stderr, "CDDA_PlayLoop(%d)\n", CDDATrack);
|
||||
}
|
||||
|
||||
void CDDA_Stop()
|
||||
{
|
||||
fprintf(stderr, "CDDA_Stop()\n");
|
||||
}
|
||||
|
||||
void CDDA_SwitchOn()
|
||||
{
|
||||
fprintf(stderr, "CDDA_SwitchOn()\n");
|
||||
}
|
||||
|
||||
|
||||
/* dxlog.c */
|
||||
void dx_str_log(char const * str, int line, char const * file)
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
#ifndef __WIN95_CDPLAYER_H__
|
||||
#define __WIN95_CDPLAYER_H__
|
||||
|
||||
/* KJL 12:40:35 07/05/98 - This is code derived from Patrick's original stuff &
|
||||
moved into it's own file. */
|
||||
|
||||
|
@ -107,4 +110,6 @@ extern void PlatCDDAManagementCallBack(WPARAM flags, LONG deviceId);
|
|||
|
||||
|
||||
|
||||
extern int CDPlayerVolume;
|
||||
extern int CDPlayerVolume;
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue