Commit 3541e128 authored by Larry Koubiak's avatar Larry Koubiak
Browse files

whitespace cleanup, free track author

parent 7177c574
Pipeline #95494 failed with stages
in 59 seconds
......@@ -7,13 +7,13 @@ CORE_DIR := .
ifeq ($(platform),)
platform = unix
ifeq ($(shell uname -a),)
platform = win
platform = win
else ifneq ($(findstring MINGW,$(shell uname -a)),)
platform = win
platform = win
else ifneq ($(findstring Darwin,$(shell uname -a)),)
platform = osx
platform = osx
else ifneq ($(findstring win,$(shell uname -a)),)
platform = win
platform = win
endif
endif
......@@ -47,17 +47,17 @@ else ifeq ($(platform), osx)
SHARED := -dynamiclib
OSXVER = `sw_vers -productVersion | cut -d. -f 2`
OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9)) && echo "YES"`
ifeq ($(OSX_LT_MAVERICKS),YES)
fpic += -mmacosx-version-min=10.1
endif
ifeq ($(OSX_LT_MAVERICKS),YES)
fpic += -mmacosx-version-min=10.1
endif
ifeq ($(CROSS_COMPILE),1)
ifeq ($(CROSS_COMPILE),1)
TARGET_RULE = -target $(LIBRETRO_APPLE_PLATFORM) -isysroot $(LIBRETRO_APPLE_ISYSROOT)
CFLAGS += $(TARGET_RULE)
CPPFLAGS += $(TARGET_RULE)
CXXFLAGS += $(TARGET_RULE)
LDFLAGS += $(TARGET_RULE)
endif
endif
# iOS
else ifneq (,$(findstring ios,$(platform)))
......@@ -124,15 +124,15 @@ else ifeq ($(platform), qnx)
CXXFLAGS += -D__BLACKBERRY_QNX__
CXXFLAGS += -DARM
else ifeq ($(platform), psp1)
TARGET := $(TARGET_NAME)_libretro_psp1.a
CC = psp-gcc
CXX = psp-g++
AR = psp-ar
CFLAGS += -DPSP -G0 -DIOAPI_NO_64
CFLAGS += -I$(shell psp-config --pspsdk-path)/include
CXXFLAGS += -DPSP -G0 -DIOAPI_NO_64
CXXFLAGS += -I$(shell psp-config --pspsdk-path)/include
STATIC_LINKING = 1
TARGET := $(TARGET_NAME)_libretro_psp1.a
CC = psp-gcc
CXX = psp-g++
AR = psp-ar
CFLAGS += -DPSP -G0 -DIOAPI_NO_64
CFLAGS += -I$(shell psp-config --pspsdk-path)/include
CXXFLAGS += -DPSP -G0 -DIOAPI_NO_64
CXXFLAGS += -I$(shell psp-config --pspsdk-path)/include
STATIC_LINKING = 1
# Vita
else ifeq ($(platform), vita)
TARGET := $(TARGET_NAME)_libretro_$(platform).a
......@@ -169,29 +169,29 @@ else ifeq ($(platform), xenon)
# CTR(3DS)
else ifeq ($(platform), ctr)
TARGET := $(TARGET_NAME)_libretro_$(platform).a
CC = $(DEVKITARM)/bin/arm-none-eabi-gcc$(EXE_EXT)
CXX = $(DEVKITARM)/bin/arm-none-eabi-g++$(EXE_EXT)
AR = $(DEVKITARM)/bin/arm-none-eabi-ar$(EXE_EXT)
CXXFLAGS += -DARM11 -D_3DS -DIOAPI_NO_64
CXXFLAGS += -march=armv6k -mtune=mpcore -mfloat-abi=hard
CFLAGS += -DARM11 -D_3DS -DIOAPI_NO_64
CFLAGS += -march=armv6k -mtune=mpcore -mfloat-abi=hard
STATIC_LINKING = 1
TARGET := $(TARGET_NAME)_libretro_$(platform).a
CC = $(DEVKITARM)/bin/arm-none-eabi-gcc$(EXE_EXT)
CXX = $(DEVKITARM)/bin/arm-none-eabi-g++$(EXE_EXT)
AR = $(DEVKITARM)/bin/arm-none-eabi-ar$(EXE_EXT)
CXXFLAGS += -DARM11 -D_3DS -DIOAPI_NO_64
CXXFLAGS += -march=armv6k -mtune=mpcore -mfloat-abi=hard
CFLAGS += -DARM11 -D_3DS -DIOAPI_NO_64
CFLAGS += -march=armv6k -mtune=mpcore -mfloat-abi=hard
STATIC_LINKING = 1
# Nintendo Switch (libnx)
else ifeq ($(platform), libnx)
include $(DEVKITPRO)/libnx/switch_rules
EXT=a
TARGET := $(TARGET_NAME)_libretro_$(platform).$(EXT)
DEFINES := -DSWITCH=1 -U__linux__ -U__linux -DRARCH_INTERNAL -DIOAPI_NO_64
CFLAGS := $(DEFINES) -g -O3 \
-fPIE -I$(LIBNX)/include/ -ffunction-sections -fdata-sections -ftls-model=local-exec -Wl,--allow-multiple-definition -specs=$(LIBNX)/switch.specs
CFLAGS += $(INCDIRS)
CFLAGS += -D__SWITCH__ -DHAVE_LIBNX -march=armv8-a -mtune=cortex-a57 -mtp=soft
CXXFLAGS := $(ASFLAGS) $(CFLAGS) -fno-rtti -std=gnu++11
CFLAGS += -std=gnu11
STATIC_LINKING = 1
include $(DEVKITPRO)/libnx/switch_rules
EXT=a
TARGET := $(TARGET_NAME)_libretro_$(platform).$(EXT)
DEFINES := -DSWITCH=1 -U__linux__ -U__linux -DRARCH_INTERNAL -DIOAPI_NO_64
CFLAGS := $(DEFINES) -g -O3 \
-fPIE -I$(LIBNX)/include/ -ffunction-sections -fdata-sections -ftls-model=local-exec -Wl,--allow-multiple-definition -specs=$(LIBNX)/switch.specs
CFLAGS += $(INCDIRS)
CFLAGS += -D__SWITCH__ -DHAVE_LIBNX -march=armv8-a -mtune=cortex-a57 -mtp=soft
CXXFLAGS := $(ASFLAGS) $(CFLAGS) -fno-rtti -std=gnu++11
CFLAGS += -std=gnu11
STATIC_LINKING = 1
# Nintendo Game Cube / Wii / WiiU
else ifneq (,$(filter $(platform), ngc wii wiiu))
......@@ -214,9 +214,9 @@ else ifneq (,$(filter $(platform), ngc wii wiiu))
# Nintendo Switch (libtransistor)
else ifeq ($(platform), switch)
EXT=a
TARGET := $(TARGET_NAME)_libretro_$(platform).$(EXT)
include $(LIBTRANSISTOR_HOME)/libtransistor.mk
STATIC_LINKING=1
TARGET := $(TARGET_NAME)_libretro_$(platform).$(EXT)
include $(LIBTRANSISTOR_HOME)/libtransistor.mk
STATIC_LINKING=1
# ARM
else ifneq (,$(findstring armv,$(platform)))
......@@ -370,10 +370,10 @@ STATIC_LINKING=1
# Windows MSVC 2017 all architectures
else ifneq (,$(findstring windows_msvc2017,$(platform)))
NO_GCC := 1
CFLAGS += -DNOMINMAX
CXXFLAGS += -DNOMINMAX
WINDOWS_VERSION = 1
NO_GCC := 1
CFLAGS += -DNOMINMAX
CXXFLAGS += -DNOMINMAX
WINDOWS_VERSION = 1
PlatformSuffix = $(subst windows_msvc2017_,,$(platform))
ifneq (,$(findstring desktop,$(PlatformSuffix)))
......@@ -455,7 +455,7 @@ else ifneq (,$(findstring windows_msvc2017,$(platform)))
ifneq (,$(findstring uwp,$(PlatformSuffix)))
LIB := $(LIB);$(shell IFS=$$'\n'; cygpath -w "$(LIB)/store")
endif
export INCLUDE := $(INCLUDE);$(WindowsSDKSharedIncludeDir);$(WindowsSDKUCRTIncludeDir);$(WindowsSDKUMIncludeDir)
export LIB := $(LIB);$(WindowsSDKUCRTLibDir);$(WindowsSDKUMLibDir)
TARGET := $(TARGET_NAME)_libretro.dll
......@@ -504,8 +504,8 @@ INFO = $(TARGET_NAME)_libretro.info
OBJECTS := $(SOURCES_CXX:.cpp=.o) $(SOURCES_C:.c=.o)
OBJOUT = -o
LINKOUT = -o
OBJOUT = -o
LINKOUT = -o
ifneq (,$(findstring msvc,$(platform)))
OBJOUT = -Fo
......
DEPS_DIR = $(CORE_DIR)/deps
GME_DIR = $(DEPS_DIR)/game-music-emu
GME_DIR = $(DEPS_DIR)/game-music-emu
LIBRETRO_COMM_DIR = $(DEPS_DIR)/libretro-common
INCFLAGS = -I$(CORE_DIR) \
-I$(LIBRETRO_COMM_DIR)/include \
-I$(DEPS_DIR)/game-music-emu/gme \
-I$(DEPS_DIR)/zlib-1.2.8 \
-I$(DEPS_DIR)/zlib-1.2.8/contrib/minizip \
-I$(DEPS_DIR)/font8x8
INCFLAGS = -I$(CORE_DIR) \
-I$(LIBRETRO_COMM_DIR)/include \
-I$(DEPS_DIR)/game-music-emu/gme \
-I$(DEPS_DIR)/zlib-1.2.8 \
-I$(DEPS_DIR)/zlib-1.2.8/contrib/minizip \
-I$(DEPS_DIR)/font8x8
ifneq (,$(findstring msvc200,$(platform)))
INCFLAGS += -I$(LIBRETRO_COMM_DIR)/include/compat/msvc
endif
SOURCES_CXX := \
$(GME_DIR)/gme/Ay_Apu.cpp \
$(GME_DIR)/gme/Ay_Cpu.cpp \
$(GME_DIR)/gme/Ay_Emu.cpp \
$(GME_DIR)/gme/Blip_Buffer.cpp \
$(GME_DIR)/gme/Classic_Emu.cpp \
$(GME_DIR)/gme/Data_Reader.cpp \
$(GME_DIR)/gme/Dual_Resampler.cpp \
$(GME_DIR)/gme/Effects_Buffer.cpp \
$(GME_DIR)/gme/Fir_Resampler.cpp \
$(GME_DIR)/gme/Gbs_Emu.cpp \
$(GME_DIR)/gme/Gb_Apu.cpp \
$(GME_DIR)/gme/Gb_Cpu.cpp \
$(GME_DIR)/gme/Gb_Oscs.cpp \
$(GME_DIR)/gme/gme.cpp \
$(GME_DIR)/gme/Gme_File.cpp \
$(GME_DIR)/gme/Gym_Emu.cpp \
$(GME_DIR)/gme/Hes_Apu.cpp \
$(GME_DIR)/gme/Hes_Cpu.cpp \
$(GME_DIR)/gme/Hes_Emu.cpp \
$(GME_DIR)/gme/Kss_Cpu.cpp \
$(GME_DIR)/gme/Kss_Emu.cpp \
$(GME_DIR)/gme/Kss_Scc_Apu.cpp \
$(GME_DIR)/gme/M3u_Playlist.cpp \
$(GME_DIR)/gme/Multi_Buffer.cpp \
$(GME_DIR)/gme/Music_Emu.cpp \
$(GME_DIR)/gme/Nes_Apu.cpp \
$(GME_DIR)/gme/Nes_Cpu.cpp \
$(GME_DIR)/gme/Nes_Fme7_Apu.cpp \
$(GME_DIR)/gme/Nes_Namco_Apu.cpp \
$(GME_DIR)/gme/Nes_Oscs.cpp \
$(GME_DIR)/gme/Nes_Vrc6_Apu.cpp \
$(GME_DIR)/gme/Nsfe_Emu.cpp \
$(GME_DIR)/gme/Nsf_Emu.cpp \
$(GME_DIR)/gme/Sap_Apu.cpp \
$(GME_DIR)/gme/Sap_Cpu.cpp \
$(GME_DIR)/gme/Sap_Emu.cpp \
$(GME_DIR)/gme/Sms_Apu.cpp \
$(GME_DIR)/gme/Snes_Spc.cpp \
$(GME_DIR)/gme/Spc_Cpu.cpp \
$(GME_DIR)/gme/Spc_Dsp.cpp \
$(GME_DIR)/gme/Spc_Emu.cpp \
$(GME_DIR)/gme/Spc_Filter.cpp \
$(GME_DIR)/gme/Vgm_Emu.cpp \
$(GME_DIR)/gme/Vgm_Emu_Impl.cpp \
$(GME_DIR)/gme/Ym2413_Emu.cpp \
$(GME_DIR)/gme/Ym2612_Emu.cpp
$(GME_DIR)/gme/Ay_Apu.cpp \
$(GME_DIR)/gme/Ay_Cpu.cpp \
$(GME_DIR)/gme/Ay_Emu.cpp \
$(GME_DIR)/gme/Blip_Buffer.cpp \
$(GME_DIR)/gme/Classic_Emu.cpp \
$(GME_DIR)/gme/Data_Reader.cpp \
$(GME_DIR)/gme/Dual_Resampler.cpp \
$(GME_DIR)/gme/Effects_Buffer.cpp \
$(GME_DIR)/gme/Fir_Resampler.cpp \
$(GME_DIR)/gme/Gbs_Emu.cpp \
$(GME_DIR)/gme/Gb_Apu.cpp \
$(GME_DIR)/gme/Gb_Cpu.cpp \
$(GME_DIR)/gme/Gb_Oscs.cpp \
$(GME_DIR)/gme/gme.cpp \
$(GME_DIR)/gme/Gme_File.cpp \
$(GME_DIR)/gme/Gym_Emu.cpp \
$(GME_DIR)/gme/Hes_Apu.cpp \
$(GME_DIR)/gme/Hes_Cpu.cpp \
$(GME_DIR)/gme/Hes_Emu.cpp \
$(GME_DIR)/gme/Kss_Cpu.cpp \
$(GME_DIR)/gme/Kss_Emu.cpp \
$(GME_DIR)/gme/Kss_Scc_Apu.cpp \
$(GME_DIR)/gme/M3u_Playlist.cpp \
$(GME_DIR)/gme/Multi_Buffer.cpp \
$(GME_DIR)/gme/Music_Emu.cpp \
$(GME_DIR)/gme/Nes_Apu.cpp \
$(GME_DIR)/gme/Nes_Cpu.cpp \
$(GME_DIR)/gme/Nes_Fme7_Apu.cpp \
$(GME_DIR)/gme/Nes_Namco_Apu.cpp \
$(GME_DIR)/gme/Nes_Oscs.cpp \
$(GME_DIR)/gme/Nes_Vrc6_Apu.cpp \
$(GME_DIR)/gme/Nsfe_Emu.cpp \
$(GME_DIR)/gme/Nsf_Emu.cpp \
$(GME_DIR)/gme/Sap_Apu.cpp \
$(GME_DIR)/gme/Sap_Cpu.cpp \
$(GME_DIR)/gme/Sap_Emu.cpp \
$(GME_DIR)/gme/Sms_Apu.cpp \
$(GME_DIR)/gme/Snes_Spc.cpp \
$(GME_DIR)/gme/Spc_Cpu.cpp \
$(GME_DIR)/gme/Spc_Dsp.cpp \
$(GME_DIR)/gme/Spc_Emu.cpp \
$(GME_DIR)/gme/Spc_Filter.cpp \
$(GME_DIR)/gme/Vgm_Emu.cpp \
$(GME_DIR)/gme/Vgm_Emu_Impl.cpp \
$(GME_DIR)/gme/Ym2413_Emu.cpp \
$(GME_DIR)/gme/Ym2612_Emu.cpp
SOURCES_C := $(CORE_DIR)/src/libretro.c \
$(CORE_DIR)/src/graphics.c \
$(CORE_DIR)/src/player.c \
$(CORE_DIR)/src/playlist.c \
$(CORE_DIR)/src/fileformat.c \
$(DEPS_DIR)/zlib-1.2.8/adler32.c \
$(DEPS_DIR)/zlib-1.2.8/crc32.c \
$(DEPS_DIR)/zlib-1.2.8/inflate.c \
$(DEPS_DIR)/zlib-1.2.8/inftrees.c \
$(DEPS_DIR)/zlib-1.2.8/inffast.c \
$(DEPS_DIR)/zlib-1.2.8/zutil.c \
$(DEPS_DIR)/zlib-1.2.8/contrib/minizip/ioapi.c \
$(DEPS_DIR)/zlib-1.2.8/contrib/minizip/unzip.c \
$(DEPS_DIR)/zlib-1.2.8/deflate.c \
$(DEPS_DIR)/zlib-1.2.8/gzclose.c \
$(DEPS_DIR)/zlib-1.2.8/gzlib.c \
$(DEPS_DIR)/zlib-1.2.8/gzread.c \
$(DEPS_DIR)/zlib-1.2.8/gzwrite.c \
$(DEPS_DIR)/zlib-1.2.8/trees.c
SOURCES_C := \
$(CORE_DIR)/src/libretro.c \
$(CORE_DIR)/src/graphics.c \
$(CORE_DIR)/src/player.c \
$(CORE_DIR)/src/playlist.c \
$(CORE_DIR)/src/fileformat.c \
$(DEPS_DIR)/zlib-1.2.8/adler32.c \
$(DEPS_DIR)/zlib-1.2.8/crc32.c \
$(DEPS_DIR)/zlib-1.2.8/inflate.c \
$(DEPS_DIR)/zlib-1.2.8/inftrees.c \
$(DEPS_DIR)/zlib-1.2.8/inffast.c \
$(DEPS_DIR)/zlib-1.2.8/zutil.c \
$(DEPS_DIR)/zlib-1.2.8/contrib/minizip/ioapi.c \
$(DEPS_DIR)/zlib-1.2.8/contrib/minizip/unzip.c \
$(DEPS_DIR)/zlib-1.2.8/deflate.c \
$(DEPS_DIR)/zlib-1.2.8/gzclose.c \
$(DEPS_DIR)/zlib-1.2.8/gzlib.c \
$(DEPS_DIR)/zlib-1.2.8/gzread.c \
$(DEPS_DIR)/zlib-1.2.8/gzwrite.c \
$(DEPS_DIR)/zlib-1.2.8/trees.c
ifneq ($(STATIC_LINKING), 1)
SOURCES_C += \
$(LIBRETRO_COMM_DIR)/compat/compat_strcasestr.c \
$(LIBRETRO_COMM_DIR)/encodings/encoding_utf.c \
$(LIBRETRO_COMM_DIR)/compat/compat_snprintf.c \
$(LIBRETRO_COMM_DIR)/compat/compat_strl.c \
$(LIBRETRO_COMM_DIR)/compat/compat_posix_string.c \
$(LIBRETRO_COMM_DIR)/compat/fopen_utf8.c \
$(LIBRETRO_COMM_DIR)/streams/file_stream.c \
$(LIBRETRO_COMM_DIR)/streams/file_stream_transforms.c \
$(LIBRETRO_COMM_DIR)/string/stdstring.c \
$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation.c \
$(LIBRETRO_COMM_DIR)/file/file_path.c \
$(LIBRETRO_COMM_DIR)/file/file_path_io.c \
$(LIBRETRO_COMM_DIR)/time/rtime.c
$(LIBRETRO_COMM_DIR)/compat/compat_strcasestr.c \
$(LIBRETRO_COMM_DIR)/encodings/encoding_utf.c \
$(LIBRETRO_COMM_DIR)/compat/compat_snprintf.c \
$(LIBRETRO_COMM_DIR)/compat/compat_strl.c \
$(LIBRETRO_COMM_DIR)/compat/compat_posix_string.c \
$(LIBRETRO_COMM_DIR)/compat/fopen_utf8.c \
$(LIBRETRO_COMM_DIR)/streams/file_stream.c \
$(LIBRETRO_COMM_DIR)/streams/file_stream_transforms.c \
$(LIBRETRO_COMM_DIR)/string/stdstring.c \
$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation.c \
$(LIBRETRO_COMM_DIR)/file/file_path.c \
$(LIBRETRO_COMM_DIR)/file/file_path_io.c \
$(LIBRETRO_COMM_DIR)/time/rtime.c
endif
......@@ -19,17 +19,17 @@ int64_t rfseek(RFILE* stream, int64_t offset, int origin);
int rfeof(RFILE* stream);
static const char *gme_allowed_exts[] = {
"ay","AY",
"gbs","GBS",
"gym","GYM",
"hes","HES",
"kss","KSS",
"nsf","NSF",
"nsfe","NSFE",
"sap","SAP",
"spc","SPC",
"vgm","VGM",
"vgz","VGZ"
"ay","AY",
"gbs","GBS",
"gym","GYM",
"hes","HES",
"kss","KSS",
"nsf","NSF",
"nsfe","NSFE",
"sap","SAP",
"spc","SPC",
"vgm","VGM",
"vgz","VGZ"
};
static bool is_gme_allowed_ext(char *ext)
......
......@@ -50,7 +50,7 @@ void free_surface(surface *surf)
if (surf)
{
free(surf->pixel_data);
free(surf);
free(surf);
}
}
......@@ -141,7 +141,7 @@ void draw_shape(surface *surf, unsigned short color, int pos_x, int pos_y, int w
{
for(x=pos_x;x<(pos_x+w);x++)
set_pixel(surf,x,y,color);
}
}
}
void draw_letter(surface *surf, unsigned short color, char letter, int pos_x, int pos_y)
......
......@@ -9,31 +9,29 @@
typedef struct
{
unsigned int width;
unsigned int height;
unsigned int bytes_per_pixel; /* 2:RGB16, 3:RGB, 4:RGBA */
char *pixel_data;
unsigned int width;
unsigned int height;
unsigned int bytes_per_pixel; /* 2:RGB16, 3:RGB, 4:RGBA */
char *pixel_data;
} surface;
typedef struct {
int x0;
int y0;
int x1;
int y1;
int x0;
int y0;
int x1;
int y1;
} box;
#define gme_black 0x0000
#define gme_white 0xFFFF
#define gme_gray 0x7BEF
#define gme_red 0xF800
#define gme_orange 0xFBE0
#define gme_yellow 0xFFE0
#define gme_green 0x07E0
#define gme_blue 0x001F
#define gme_indigo 0x4810
#define gme_violet 0x901A
extern const short gme_rainbow7[7];
#define gme_black 0x0000
#define gme_white 0xFFFF
#define gme_gray 0x7BEF
#define gme_red 0xF800
#define gme_orange 0xFBE0
#define gme_yellow 0xFFE0
#define gme_green 0x07E0
#define gme_blue 0x001F
#define gme_indigo 0x4810
#define gme_violet 0x901A
bool is_font_pixel(unsigned char letter, int x, int y);
unsigned short get_color(char r, char g, char b);
......
......@@ -260,7 +260,7 @@ void retro_run(void)
if(input & (1<<RETRO_DEVICE_ID_JOYPAD_B))
mute_voice(selected_voice);
if(input & (1<<RETRO_DEVICE_ID_JOYPAD_LEFT))
selected_voice = (selected_voice-1) % get_num_voices();
......
......@@ -26,9 +26,9 @@ bool is_emu_loaded(void)
bool open_file(const char *path, long sample_rate)
{
sample_rate_ = sample_rate;
current_track = 0;
prev_fileid = -1;
sample_rate_ = sample_rate;
current_track = 0;
prev_fileid = -1;
if(get_playlist(path,&plist))
{
......@@ -40,10 +40,10 @@ bool open_file(const char *path, long sample_rate)
void close_file(void)
{
gme_delete(emu);
emu = NULL;
if(plist!=NULL)
cleanup_playlist(plist);
gme_delete(emu);
emu = NULL;
if(plist!=NULL)
cleanup_playlist(plist);
}
void start_track(int tracknr)
......@@ -70,7 +70,7 @@ void start_track(int tracknr)
else
{
log_cb(RETRO_LOG_ERROR, "[GME] Error: Unknown track type.\n" );
is_playing_ = false;
is_playing_ = false;
}
if (is_playing_)
gme_start_track(emu, track->track_id);
......@@ -97,8 +97,8 @@ short *play(void)
void next_track(void)
{
if(current_track< (plist->num_tracks-1))
start_track(++current_track);
if(current_track< (plist->num_tracks-1))
start_track(++current_track);
}
void prev_track(void)
......@@ -127,20 +127,20 @@ void mute_voice(int index)
char *get_game_name(char *buf)
{
sprintf(buf, "%s",track->game_name);
return buf;
sprintf(buf, "%s",track->game_name);
return buf;
}
char *get_track_count(char *buf)
{
sprintf(buf, "%d/%d",current_track+1,plist->num_tracks);
return buf;
sprintf(buf, "%d/%d",current_track+1,plist->num_tracks);
return buf;
}
char *get_song_name(char *buf)
{
sprintf(buf, "%s",track->track_name);
return buf;
sprintf(buf, "%s",track->track_name);
return buf;
}
char *get_author(char *buf)
......
......@@ -37,7 +37,7 @@ bool get_playlist(const char *path, playlist **dest_pl)
if(get_track_data(temp_emu,i,j,gfd->name,
&(pl->tracks[position])))
position++;
}
}
gme_delete(temp_emu);
temp_emu = NULL;
......@@ -200,7 +200,7 @@ bool get_track_data(Music_Emu* emu, int fileid, int trackid, char *filename,gme_
return true;
}
bool cleanup_playlist(playlist *playlist)
bool cleanup_playlist(playlist *playlist)
{
int i;
if(playlist->tracks!=NULL)
......@@ -213,6 +213,8 @@ bool cleanup_playlist(playlist *playlist)
free(playlist->tracks[i]->game_name);
if(playlist->tracks[i]->track_name != NULL)
free(playlist->tracks[i]->track_name);
if(playlist->tracks[i]->author != NULL)
free(playlist->tracks[i]->author);
free(playlist->tracks[i]);
}
}
......
......@@ -5,27 +5,27 @@
#include "fileformat.h"
typedef struct {
char* name;
char* data;
int length;
gme_type_t file_type;
int num_tracks;
char* name;
char* data;
int length;
gme_type_t file_type;
int num_tracks;
} gme_file_data;
typedef struct {
int file_id;
int track_id;
int track_length;
char* game_name;
char* track_name;
char *author;
int file_id;
int track_id;
int track_length;
char* game_name;
char* track_name;
char *author;
} gme_track_data;
typedef struct {
int num_files;
gme_file_data** files;
int num_tracks;
gme_track_data** tracks;
int num_files;
gme_file_data** files;
int num_tracks;
gme_track_data** tracks;
} playlist;
bool get_playlist(const char *path,playlist **dest_pl);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment