Guest User

libtcod-nosdl

a guest
May 20th, 2015
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 4.76 KB | None | 0 0
  1. diff -u -r libtcod/include/libtcod.h libtcod-nosdl/include/libtcod.h
  2. --- libtcod/include/libtcod.h   2014-10-13 21:44:15.000000000 +0400
  3. +++ libtcod-nosdl/include/libtcod.h 2015-05-20 16:21:58.470001174 +0400
  4. @@ -110,14 +110,6 @@
  5.  #include <wchar.h>
  6.  #endif
  7.  
  8. -/* This is a hack. SDL by default want you to rename your main statement, and insert it's own first
  9. -   It does that to handle some init code. However, libtcod handles that for you. If we did this
  10. -   wrappers like libtcod-net would be hosed, since there is no main statement there. */
  11. -#ifdef TCOD_MACOSX
  12. -#define _SDL_main_h
  13. -#include "SDL/SDL.h"
  14. -#endif
  15. -
  16.  /* base types */
  17.  #ifndef TCOD_NOBASETYPES
  18.  typedef unsigned char uint8;
  19.  
  20.  
  21. diff -u -r libtcod/include/libtcod_int.h libtcod-nosdl/include/libtcod_int.h
  22. --- libtcod/include/libtcod_int.h   2014-04-15 17:05:58.000000000 +0400
  23. +++ libtcod-nosdl/include/libtcod_int.h 2015-05-20 16:28:11.113995765 +0400
  24. @@ -29,14 +29,6 @@
  25.  #define _TCODLIB_INT_H
  26.  #include <stdarg.h>
  27.  #include <assert.h>
  28. -#if defined (__HAIKU__) || defined(__ANDROID__)
  29. -#include <SDL.h>
  30. -#include <android/log.h>
  31. -#elif defined (TCOD_SDL2)
  32. -#include <SDL.h>
  33. -#else
  34. -#include <SDL/SDL.h>
  35. -#endif
  36.  
  37.  /* tcodlib internal stuff */
  38.  #ifdef __cplusplus
  39. @@ -129,8 +121,6 @@
  40.     int actual_fullscreen_height;
  41.     /* renderer to use */
  42.     TCOD_renderer_t renderer;
  43. -   /* user post-processing callback */
  44. -   SDL_renderer_t sdl_cbk;
  45.     /* fading data */
  46.     TCOD_color_t fading_color;
  47.     uint8 fade;
  48. @@ -248,69 +238,6 @@
  49.  /* TCOD_list nonpublic methods */
  50.  void TCOD_list_set_size(TCOD_list_t l, int size);
  51.  
  52. -/*
  53. -   SDL12/SDL2 abstraction layer
  54. -*/
  55. -typedef struct {
  56. -   /* get a fullscreen mode suitable for the console */
  57. -   void (*get_closest_mode)(int *w, int *h);
  58. -   /* render the console on a surface/texture */
  59. -   void (*render)(void *vbitmap, int console_width, int console_height, char_t *console_buffer, char_t *prev_console_buffer);
  60. -   /* create a new surface */
  61. -   SDL_Surface *(*create_surface) (int width, int height, bool with_alpha);
  62. -   /* create the game window */
  63. -   void (*create_window)(int w, int h, bool fullscreen);
  64. -   /* switch fullscreen on/off */
  65. -   void (*set_fullscreen)(bool fullscreen);
  66. -   /* change the game window title */
  67. -   void (*set_window_title)(const char *title);
  68. -   /* save game screenshot */
  69. -   void (*save_screenshot)(const char *filename);
  70. -   /* get desktop resolution */
  71. -   void (*get_current_resolution)(int *w, int *h);
  72. -   /* change the mouse cursor position */
  73. -   void (*set_mouse_position)(int x, int y);
  74. -   /* android compatible file access functions */
  75. -   bool (*file_read)(const char *filename, unsigned char **buf, size_t *size);
  76. -   bool (*file_exists)(const char * filename);
  77. -   bool (*file_write)(const char *filename, unsigned char *buf, uint32 size);
  78. -   /* clean stuff */
  79. -   void (*term)();
  80. -} TCOD_SDL_driver_t;
  81. -
  82. -/* defined in TCOD_sys_sdl12_c.c and TCOD_sys_sdl2_c.c */
  83. -TCOD_SDL_driver_t *SDL_implementation_factory();
  84. -void find_resolution();
  85. -void TCOD_sys_init_screen_offset();
  86. -extern SDL_Surface* screen;
  87. -extern int oldFade;
  88. -extern bool *ascii_updated;
  89. -extern bool any_ascii_updated;
  90. -extern SDL_Surface* charmap;
  91. -typedef struct {
  92. -   float force_recalc;
  93. -   float last_scale_xc, last_scale_yc;
  94. -   float last_scale_factor;
  95. -   float last_fullscreen;
  96. -
  97. -   float min_scale_factor;
  98. -
  99. -   float src_height_width_ratio;
  100. -   float dst_height_width_ratio;
  101. -   int src_x0, src_y0;
  102. -   int src_copy_width, src_copy_height;
  103. -   int src_proportionate_width, src_proportionate_height;
  104. -   int dst_display_width, dst_display_height;
  105. -   int dst_offset_x, dst_offset_y;
  106. -   int surface_width, surface_height;
  107. -} scale_data_t;
  108. -extern scale_data_t scale_data;
  109. -#ifdef TCOD_SDL2
  110. -extern float scale_factor;
  111. -extern SDL_Window* window;
  112. -extern SDL_Renderer* renderer;
  113. -#endif
  114. -
  115.  /* color values */
  116.  #define TCOD_BLACK 0,0,0
  117.  #define TCOD_DARKEST_GREY 31,31,31
  118.  
  119.  
  120. diff -u -r libtcod/makefiles/makefile-linux libtcod-nosdl/makefiles/makefile-linux
  121. --- libtcod/makefiles/makefile-linux    2014-04-15 17:05:58.000000000 +0400
  122. +++ libtcod-nosdl/makefiles/makefile-linux  2015-05-20 16:32:34.325991945 +0400
  123. @@ -5,9 +5,6 @@
  124.  INCDIR=include
  125.  
  126.  #dependencies
  127. -# SDL
  128. -SDL_FLAGS=`sdl-config --cflags`
  129. -SDL_LIBS=`sdl-config --libs`
  130.  
  131.  # ZLIB
  132.  ZLIB_FLAGS=-I src/zlib
  133. @@ -16,7 +13,7 @@
  134.  #OPENGL
  135.  OPENGL_LIB=-lGL
  136.  
  137. -LIBS=$(ZLIB_LIBS) $(SDL_LIBS) $(OPENGL_LIB) -lm -ldl -lX11 -lpthread
  138. +LIBS=$(ZLIB_LIBS) $(SDL_LIBS) $(OPENGL_LIB) -lm -ldl -lpthread
  139.  
  140.  CFLAGS=$(FLAGS) -I$(INCDIR) -I$(INCDIR)/gui -Wall $(SDL_FLAGS) $(ZLIB_FLAGS) -fno-strict-aliasing -ansi -fPIC
  141.  TEMP=/tmp
  142. @@ -83,11 +80,6 @@
  143.     parser_c.o \
  144.     path_c.o \
  145.     sys_c.o \
  146. -   sys_opengl_c.o \
  147. -   sys_sdl_c.o \
  148. -   sys_sdl12_c.o \
  149. -   sys_sdl_img_bmp.o \
  150. -   sys_sdl_img_png.o \
  151.     tree_c.o \
  152.     txtfield_c.o \
  153.     wrappers.o \
Advertisement
Add Comment
Please, Sign In to add comment