Skip to content

Commit

Permalink
Finally get rid of the mass includes in global.h
Browse files Browse the repository at this point in the history
  • Loading branch information
grum committed Aug 1, 2007
1 parent 781b7ce commit 2d3f347
Show file tree
Hide file tree
Showing 85 changed files with 768 additions and 329 deletions.
11 changes: 9 additions & 2 deletions actors.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,23 @@
#include <math.h>
#include <string.h>
#include "actors.h"
#include "actor_scripts.h"
#include "asc.h"
#include "bbox_tree.h"
#include "cal.h"
#include "cursors.h"
#include "errors.h"
#include "font.h"
#include "global.h" // XXX For font_scale and cur_time
#include "gl_init.h"
#include "global.h"
#include "interface.h"
#include "load_gl_extensions.h"
#include "map.h"
#include "new_actors.h"
#include "pathfinder.h"
#include "platform.h"
#include "shadows.h"
#include "textures.h"
#include "tiles.h"
#include "translate.h"
#ifdef CLUSTER_INSIDES
#include "cluster.h"
Expand Down
2 changes: 2 additions & 0 deletions asc.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#include <SDL_types.h>
#include <libxml/tree.h>
#include "client_serv.h"
#include "font.h"

#ifdef __cplusplus
extern "C" {
Expand Down
1 change: 0 additions & 1 deletion bags.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "cursors.h"
#include "elwindows.h"
#include "errors.h"
#include "font.h"
#include "gamewin.h"
#include "init.h"
#include "interface.h"
Expand Down
1 change: 0 additions & 1 deletion books.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "draw_scene.h"
#include "errors.h"
#include "elwindows.h"
#include "font.h"
#include "init.h"
#include "knowledge.h"
#include "multiplayer.h"
Expand Down
2 changes: 0 additions & 2 deletions buddy.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
#include "buddy.h"
#include "asc.h"
#include "chat.h"
#include "client_serv.h"
#include "console.h"
#include "elwindows.h"
#include "font.h"
#include "gamewin.h"
#include "init.h"
#include "interface.h"
Expand Down
7 changes: 6 additions & 1 deletion cal.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#include <stdlib.h>
#include "global.h"
#include "cal.h"
#include "draw_scene.h"
#include "errors.h"
#include "global.h"
#include "load_gl_extensions.h"
#include "shadows.h"
#include "translate.h"

void cal_actor_set_anim_delay(int id, struct cal_anim anim, float delay)
{
Expand Down
15 changes: 14 additions & 1 deletion chat.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,22 @@
#include <stdio.h>
#include <ctype.h>
#include <libxml/parser.h>
#include "chat.h"
#include "asc.h"
#include "console.h"
#include "consolewin.h"
#include "elconfig.h"
#include "errors.h"
#include "gamewin.h"
#include "global.h"
#include "text.h"
#include "hud.h"
#include "init.h"
#include "interface.h"
#include "mapwin.h"
#include "multiplayer.h"
#include "queue.h"
#include "text.h"
#include "translate.h"

int chat_win = -1;

Expand Down
1 change: 0 additions & 1 deletion console.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "buddy.h"
#include "cache.h"
#include "chat.h"
#include "client_serv.h"
#include "consolewin.h"
#include "elconfig.h"
#include "filter.h"
Expand Down
1 change: 0 additions & 1 deletion consolewin.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "console.h"
#include "draw_scene.h"
#include "elwindows.h"
#include "font.h"
#include "gamewin.h"
#include "hud.h"
#include "init.h"
Expand Down
1 change: 0 additions & 1 deletion counters.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "counters.h"
#include "asc.h"
#include "elwindows.h"
#include "font.h"
#include "init.h"
#include "interface.h"
#include "multiplayer.h"
Expand Down
1 change: 0 additions & 1 deletion dialogues.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "dialogues.h"
#include "asc.h"
#include "elwindows.h"
#include "font.h"
#include "gamewin.h"
#include "interface.h"
#include "multiplayer.h"
Expand Down
19 changes: 17 additions & 2 deletions draw_scene.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "global.h"
#include "draw_scene.h"
#include "weather.h"
#include "bbox_tree.h"
#include "cursors.h"
#include "elwindows.h"
#include "gamewin.h"
#include "gl_init.h"
#include "hud.h"
#include "interface.h"
#include "items.h"
#include "map.h"
#include "multiplayer.h"
#include "new_actors.h"
#include "new_character.h"
#include "pathfinder.h"
#include "shadows.h"
#include "sound.h"
#include "storage.h"
#include "tiles.h"
#include "weather.h"

GLuint paper1_text;

Expand Down
49 changes: 40 additions & 9 deletions elconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,47 @@
#endif //_MSC_VER

#ifdef MAP_EDITOR
#include "../map_editor/global.h"
#include "../map_editor/browser.h"
#include "../map_editor/interface.h"
#include "../elc/load_gl_extensions.h"

#elif defined(MAP_EDITOR2)
#include "../map_editor2/global.h"
#include "../map_editor/global.h"
#include "../map_editor/browser.h"
#include "../map_editor/interface.h"
#include "load_gl_extensions.h"
#else
#include "global.h"
#include "chat.h"
#include "alphamap.h"
#include "asc.h"
#include "bags.h"
#include "buddy.h"
#include "chat.h"
#include "console.h"
#include "draw_scene.h"
#include "errors.h"
#include "filter.h"
#include "gamewin.h"
#include "gl_init.h"
#include "hud.h"
#include "init.h"
#include "interface.h"
#include "items.h"
#include "manufacture.h"
#include "mapwin.h"
#include "multiplayer.h"
#include "new_character.h"
#include "openingwin.h"
#include "particles.h"
#include "pm_log.h"
#include "reflection.h"
#include "serverpopup.h"
#include "shadows.h"
#include "sound.h"
#include "spells.h"
#include "storage.h"
#include "tabs.h"
#include "weather.h"
#ifdef NEW_FILE_IO
#include "io/elpathwrapper.h"
#endif
#ifdef SKY_FPV_CURSOR
#include "sky.h"
#endif
#endif

#include "elconfig.h"
Expand Down
11 changes: 5 additions & 6 deletions elmemory.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
#include <string.h>
#include <SDL.h>
#include <SDL_thread.h>
#ifdef MAP_EDITOR2
#include "../map_editor2/init.h"
#else
#include "asc.h"
#include "init.h"
#include "asc.h"
#include "init.h"
#ifdef NEW_FILE_IO
#include "io/elpathwrapper.h"
#endif

/* The size of the array */
Expand Down Expand Up @@ -46,7 +45,7 @@ void elm_cleanup()
safe_snprintf(path, sizeof(path), "%s/elmemory.log", configdir);
fp = fopen(path, "w");
#else /* NEW_FILE_IO */
fp = open_config_file("elmemory.log", "w");
fp = open_file_config ("elmemory.log", "w");
#endif /* NEW_FILE_IO */
if(fp ==NULL){
return;
Expand Down
1 change: 0 additions & 1 deletion elwindows.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "alphamap.h"
#include "asc.h"
#include "cursors.h"
#include "font.h"
#include "gl_init.h"
#include "interface.h"
#include "keys.h"
Expand Down
1 change: 0 additions & 1 deletion encyclopedia.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "asc.h"
#include "elwindows.h"
#include "errors.h"
#include "font.h"
#include "init.h"
#include "interface.h"
#include "misc.h"
Expand Down
10 changes: 9 additions & 1 deletion events.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
#include <stdlib.h>
#include <string.h>
#include "events.h"
#include "actor_scripts.h"
#include "client_serv.h"
#include "draw_scene.h"
#include "elconfig.h"
#include "elwindows.h"
#include "global.h" // XXX For cur_time
#include "gamewin.h"
#include "gl_init.h"
#include "global.h"
#include "interface.h"
#include "items.h"
#include "keys.h"
#include "mapwin.h"
#include "multiplayer.h"
#include "particles.h"
#include "pathfinder.h"
#include "paste.h"
#include "pm_log.h"
#include "update.h"
Expand Down
11 changes: 10 additions & 1 deletion filter.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
#include <stdlib.h>
#include <string.h>
#include "global.h"
#include <ctype.h>
#include "filter.h"
#include "asc.h"
#include "init.h"
#include "translate.h"
#ifdef NEW_FILE_IO
#include "errors.h"
#include "io/elpathwrapper.h"
#else
#include "misc.h"
#endif

#define MAX_FILTERS 1000

Expand Down
16 changes: 12 additions & 4 deletions font.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@
#include <unistd.h>
#endif //_MSC_VER
#endif //FONTS_FIX
#ifdef MAP_EDITOR2
#include "../map_editor2/global.h"
#else
#include "font.h"
#include "asc.h"
#include "chat.h"
#include "client_serv.h"
#include "colors.h"
#include "elconfig.h"
#include "errors.h"
#include "init.h"
#include "gl_init.h"
#include "global.h"
#endif
#include "interface.h"
#include "misc.h"
#include "textures.h"

/* NOTE: This file contains implementations of the following, currently unused, and commented functions:
* Look at the end of the file.
Expand Down
10 changes: 5 additions & 5 deletions framebuffer.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifdef MAP_EDITOR2
#include "../map_editor2/global.h"
#else
#include "global.h"
#endif
#include "framebuffer.h"
#include "errors.h"
#include "gl_init.h"
#include "load_gl_extensions.h"
#include "translate.h"

static const GLenum stencil_formats[] =
{
Expand Down
2 changes: 2 additions & 0 deletions framebuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#ifndef FRAMEBUFFER_H
#define FRAMEBUFFER_H

#include "platform.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
7 changes: 1 addition & 6 deletions frustum.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,9 @@
//***********************************************************************//
#include <stdlib.h>
#include <math.h>
//#include "SDL_opengl.h"
#ifdef MAP_EDITOR2
#include "../map_editor2/global.h"
#else
#include "global.h"
#endif
#include <string.h>
#include "bbox_tree.h"
#include "shadows.h"

// We create an enum of the sides so we don't have to call each side 0 or 1.
// This way it makes it more understandable and readable when dealing with frustum sides.
Expand Down
Loading

0 comments on commit 2d3f347

Please sign in to comment.