Skip to content

Commit

Permalink
refactor include directory
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexOberhofer committed Dec 26, 2021
1 parent 70d1b6a commit 9f663e8
Show file tree
Hide file tree
Showing 101 changed files with 973 additions and 4 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/config.h → include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#undef HAVE_LIBI386

/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
#define HAVE_LIBM 1

/* Define to 1 if you have the `png' library (-lpng). */
#undef HAVE_LIBPNG
Expand Down Expand Up @@ -70,10 +70,10 @@
#undef PACKAGE_BUGREPORT

/* Define to the full name of this package. */
#define PACKAGE_NAME "SDL2-Doom - Based on Doom Generic"
#define PACKAGE_NAME "SDL2-Doom"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "SDL2-Doom - Based on Doom Generic 0.1"
#define PACKAGE_STRING "SDL2-Doom"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "sdl2-doom.tar"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions src/i_swap.h → include/i_swap.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,17 @@
#define SYS_BIG_ENDIAN
#endif

// cosmito from lsdldoom
#define doom_swap_s(x) \
((short int)((((unsigned short int)(x) & 0x00ff) << 8) | \
(((unsigned short int)(x) & 0xff00) >> 8)))


#if ( SDL_BYTEORDER == SDL_BIG_ENDIAN )
#define doom_wtohs(x) doom_swap_s(x)
#else
#define doom_wtohs(x) (short int)(x)
#endif

#endif

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
80 changes: 80 additions & 0 deletions include/mmus2mid.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// Emacs style mode select -*- C++ -*-
//--------------------------------------------------------------------------
//
// $Id: mmus2mid.h 76 2005-09-06 21:06:45Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright (C) 1999 by
// id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman
// Copyright (C) 1999-2000 by
// Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze
//
// Copyright(C) 2005 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
// $Log$
// Revision 1.2 2005/09/06 21:06:45 fraggle
// Newer versions of mmus2mid.c,h from prboom
//
// Revision 1.1 2005/09/05 22:50:56 fraggle
// Add mmus2mid code from prboom. Use 'void *' for music handles. Pass
// length of data when registering music.
//

#if !defined( MMUS2MID_H )
#define MMUS2MID_H

// error codes

typedef enum
{
MUSDATACOR, // MUS data corrupt
TOOMCHAN, // Too many channels
MEMALLOC, // Memory allocation error
MUSDATAMT, // MUS file empty
BADMUSCTL, // MUS event 5 or 7 found
BADSYSEVT, // MUS system event not in 10-14 range
BADCTLCHG, // MUS control change larger than 9
TRACKOVF, // MIDI track exceeds allocation
BADMIDHDR, // bad midi header detected
} error_code_t;

// some names for integers of various sizes, all unsigned
typedef unsigned char UBYTE; // a one-byte int
typedef unsigned short UWORD; // a two-byte int
// proff: changed from unsigned int to unsigned long to avoid warning
typedef unsigned long ULONG; // a four-byte int (assumes int 4 bytes)

#ifndef MSDOS /* proff: This is from allegro.h */
#define MIDI_TRACKS 32

typedef struct MIDI /* a midi file */
{
int divisions; /* number of ticks per quarter note */
struct {
unsigned char *data; /* MIDI message stream */
int len; /* length of the track data */
} track[MIDI_TRACKS];
} MIDI;
#endif /* !MSDOS */

extern int mmus2mid(const UBYTE *mus,MIDI *mid, UWORD division, int nocomp);
extern void free_mididata(MIDI *mid);
extern int MIDIToMidi(MIDI *mididata,UBYTE **mid,int *midlen);
extern int MidiToMIDI(UBYTE *mid,MIDI *mididata);

#endif
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions src/i_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ void I_WaitVBL(int count)

void I_InitTimer(void)
{
printf("I_InitTimer: Setting up timer.\n");
if (SDL_Init(SDL_INIT_TIMER) < 0)
{
printf("SDL_Init failed: %s\n", SDL_GetError());
Expand Down
1 change: 1 addition & 0 deletions src/makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SDL_CFLAGS = -D_THREAD_SAFE -I/usr/include/SDL2
SDL_LIBS =
INCLUDES=-I../include
CC=gcc
CFLAGS+= $(INCLUDES) $(SDL_CFLAGS)
CFLAGS+=-Wall -DNORMALUNIX
Expand Down
4 changes: 3 additions & 1 deletion src/makefile.mingw
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
SDL_CFLAGS = -D_THREAD_SAFE -I/usr/include/SDL2 -I../SDL2-2.0.18/x86_64-w64-mingw32/include
SDL_LIBS =

INCLUDES=-I../include

CC=x86_64-w64-mingw32-gcc
CFLAGS+= $(INCLUDES) $(SDL_CFLAGS)
CFLAGS+=-Wall -DNORMALUNIX
Expand All @@ -10,7 +12,7 @@ LIBS+=-lm -lSDL2 -L../SDL2-2.0.18/x86_64-w64-mingw32/lib
OBJDIR=build
OUTPUT=sdl2-doom.exe

SRC_DOOM = i_main.o dummy.o am_map.o doomdef.o doomstat.o dstrings.o d_event.o d_items.o d_iwad.o d_loop.o d_main.o d_mode.o d_net.o f_finale.o f_wipe.o g_game.o hu_lib.o hu_stuff.o info.o i_cdmus.o i_endoom.o i_joystick.o i_scale.o i_sound.o i_system.o i_timer.o memio.o m_argv.o m_bbox.o m_cheat.o m_config.o m_controls.o m_fixed.o m_menu.o m_misc.o m_random.o p_ceilng.o p_doors.o p_enemy.o p_floor.o p_inter.o p_lights.o p_map.o p_maputl.o p_mobj.o p_plats.o p_pspr.o p_saveg.o p_setup.o p_sight.o p_spec.o p_switch.o p_telept.o p_tick.o p_user.o r_bsp.o r_data.o r_draw.o r_main.o r_plane.o r_segs.o r_sky.o r_things.o sha1.o sounds.o statdump.o st_lib.o st_stuff.o s_sound.o tables.o v_video.o wi_stuff.o w_checksum.o w_file.o w_main.o w_wad.o z_zone.o w_file_stdc.o i_input.o i_video.o i_sdl.o
SRC_DOOM = i_main.o dummy.o am_map.o doomdef.o doomstat.o dstrings.o d_event.o d_items.o d_iwad.o d_loop.o d_main.o d_mode.o mmus2mid.o d_net.o f_finale.o f_wipe.o g_game.o hu_lib.o hu_stuff.o info.o i_cdmus.o i_endoom.o i_joystick.o i_scale.o i_sound.o i_system.o i_timer.o memio.o m_argv.o m_bbox.o m_cheat.o m_config.o m_controls.o m_fixed.o m_menu.o m_misc.o m_random.o p_ceilng.o p_doors.o p_enemy.o p_floor.o p_inter.o p_lights.o p_map.o p_maputl.o p_mobj.o p_plats.o p_pspr.o p_saveg.o p_setup.o p_sight.o p_spec.o p_switch.o p_telept.o p_tick.o p_user.o r_bsp.o r_data.o r_draw.o r_main.o r_plane.o r_segs.o r_sky.o r_things.o sha1.o sounds.o statdump.o st_lib.o st_stuff.o s_sound.o tables.o v_video.o wi_stuff.o w_checksum.o w_file.o w_main.o w_wad.o z_zone.o w_file_stdc.o i_input.o i_video.o i_sdl.o
OBJS += $(addprefix $(OBJDIR)/, $(SRC_DOOM))

all: $(OUTPUT)
Expand Down
Loading

0 comments on commit 9f663e8

Please # to comment.