Skip to content

Commit

Permalink
lame attempt to speed compile
Browse files Browse the repository at this point in the history
  • Loading branch information
goblinhack committed Apr 21, 2024
1 parent dfd2ae4 commit b0dbe84
Show file tree
Hide file tree
Showing 23 changed files with 62 additions and 267 deletions.
3 changes: 2 additions & 1 deletion src/audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
// Copyright Neil McGill, [email protected]
//

#include "my_main.hpp"
#include <SDL_mixer.h>

#include "my_main.hpp"

uint8_t audio_init_done;

void audio_fini(void)
Expand Down
1 change: 0 additions & 1 deletion src/c_plus_plus_serializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#ifndef C_PLUS_PLUS_SERIALIZER
#define C_PLUS_PLUS_SERIALIZER
#include <fstream>
// REMOVED #include <iostream>
#include <sstream>
#include <vector>

Expand Down
1 change: 0 additions & 1 deletion src/config.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
// REMOVED #include "my_cfg.hpp"
#define HAVE_LIBUNWIND
#define MYVER "0.0.1"
1 change: 0 additions & 1 deletion src/game_load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "my_array_bounds_check.hpp"
#include "my_sdl_proto.hpp"
#include "my_serialize.hpp"
// REMOVED #include "my_ui.hpp"
#include "my_wid_error.hpp"
#include "my_wid_popup.hpp"

Expand Down
1 change: 0 additions & 1 deletion src/game_seed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//

#include "my_game.hpp"
// REMOVED #include "my_level.hpp"
#include "my_random.hpp"
#include "my_random_name.hpp"

Expand Down
1 change: 1 addition & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "my_gfx.hpp"
#include "my_main.hpp"
#include "my_music.hpp"
#include "my_ptrcheck.hpp"
#include "my_ramdisk.hpp"
#include "my_random.hpp"
#include "my_sdl_proto.hpp"
Expand Down
3 changes: 2 additions & 1 deletion src/music.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
// Copyright Neil McGill, [email protected]
//

#include <SDL_mixer.h>

#include "my_file.hpp"
#include "my_game.hpp"
#include "my_music.hpp"
#include "my_ptrcheck.hpp"
#include <SDL_mixer.h>

class music
{
Expand Down
1 change: 0 additions & 1 deletion src/my_callstack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#define _MY_CALLSTACK_HPP_

#include "my_main.hpp"
// REMOVED #include "my_sys.hpp"
#include <string>

#define CAT(A, B) A##B
Expand Down
1 change: 0 additions & 1 deletion src/my_cfg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#ifndef _MY_CONFIG_HPP_
#define _MY_CONFIG_HPP_

// REMOVED #include "cfg.hpp"

#define ENABLE_ASSERT // Abort on errors
#define ENABLE_CRASH_HANDLER // Intercept SEGV and other faults
Expand Down
1 change: 0 additions & 1 deletion src/my_font.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#ifndef _MY_FONT_HPP_
#define _MY_FONT_HPP_

// REMOVED #include "my_fwd.hpp"
#include "my_tile.hpp"
#include <array> // do not remove

Expand Down
1 change: 0 additions & 1 deletion src/my_game.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#define _MY_GAME_HPP_

#include <SDL.h>
#include <vector>

#include "my_fwd.hpp"
#include "my_game_defs.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/my_hiscore.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ class HiScores
const char *place_str(int score);
};

#endif // _MY_THING_HPP_
#endif // _MY_HISCORE_HPP_
1 change: 0 additions & 1 deletion src/my_pixel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <SDL.h>

#include "my_color.hpp"
// REMOVED #include "my_sys.hpp"

#define pixel_ANYw(s, y) ((y) * (s->pitch / s->format->BytesPerPixel))
#define pixel_32bpp(s, x, y) ((uint32_t *) s->pixels + (x) + pixel_ANYw(s, y))
Expand Down
2 changes: 2 additions & 0 deletions src/my_ptrcheck.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#ifndef _MY__PTRCHECK_HPP__
#define _MY__PTRCHECK_HPP__

#include "my_source_loc.hpp"

//
// __FUNCTION__ is not a preprocessor directive so we can't convert it into a
// string
Expand Down
24 changes: 0 additions & 24 deletions src/my_sound.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
#ifndef _MY_SOUND_HPP_
#define _MY_SOUND_HPP_

#include "my_ptrcheck.hpp"

#include <SDL_mixer.h>

class sound;
using soundp = class sound *;

Expand All @@ -25,26 +21,6 @@ bool sound_play(const std::string &alias);
bool sound_play_channel(int chan, const std::string &alias);
void sound_halt(void);

class sound
{
public:
sound(std::string alias) : alias(alias) {}

~sound(void)
{
Mix_FreeChunk(chunk);
myfree(data);
}

std::string alias;
Mix_Chunk *chunk = {};
unsigned char *data = {};
int len = {};
float volume {};
};

extern std::map< std::string, class sound * > all_sound;

enum {
CHANNEL_MISC,
CHANNEL_FOOTSTEPS,
Expand Down
1 change: 0 additions & 1 deletion src/my_sprintf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#define _MY_SPRINTF_HPP_

#include "my_main.hpp"
// REMOVED #include <string>

std::string string_sprintf(const char *format, ...) CHECK_FORMAT_STR(printf, 1, 2);
std::string string_sprintf(const char *format, va_list args);
Expand Down
4 changes: 1 addition & 3 deletions src/precompiled.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include <SDL.h>
#include <SDL_mixer.h>
#include <array>
#include <cstdint>
#include <cstring>
Expand Down Expand Up @@ -33,6 +31,7 @@
#include "my_audio.hpp"
#include "my_callstack.hpp"
#include "my_command.hpp"
#include "my_cpp_template.hpp"
#include "my_dir.hpp"
#include "my_enum.hpp"
#include "my_file.hpp"
Expand All @@ -47,7 +46,6 @@
#include "my_sdl_proto.hpp"
#include "my_sound.hpp"
#include "my_thing.hpp"
#include "my_thing_id.hpp"
#include "my_tp.hpp"
#include "my_tps.hpp"
#include "my_wid_console.hpp"
Expand Down
21 changes: 21 additions & 0 deletions src/sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,31 @@
// Copyright Neil McGill, [email protected]
//

#include <SDL_mixer.h>

#include "my_file.hpp"
#include "my_game.hpp"
#include "my_ptrcheck.hpp"
#include "my_sound.hpp"

class sound
{
public:
sound(std::string alias) : alias(alias) {}

~sound(void)
{
Mix_FreeChunk(chunk);
myfree(data);
}

std::string alias;
Mix_Chunk *chunk = {};
unsigned char *data = {};
int len = {};
float volume {};
};

std::map< std::string, class sound * > all_sound;

bool sound_init_done;
Expand Down
1 change: 0 additions & 1 deletion src/tile_blit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//

#include "my_color_defs.hpp"
// REMOVED #include "my_game.hpp"
#include "my_random.hpp"
#include "my_tile.hpp"

Expand Down
1 change: 0 additions & 1 deletion src/tp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <inttypes.h>

#include "my_ptrcheck.hpp"
// REMOVED #include "my_string.hpp"
#include "my_tp.hpp"
#include "my_tps.hpp"
#include "my_vector_bounds_check.hpp"
Expand Down
Loading

0 comments on commit b0dbe84

Please sign in to comment.