Ancurio

dump_atlas

Jul 24th, 2015
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 0.82 KB | None | 0 0
  1. diff --git a/src/tileatlasvx.cpp b/src/tileatlasvx.cpp
  2. index d8ac718..e0bae38 100644
  3. --- a/src/tileatlasvx.cpp
  4. +++ b/src/tileatlasvx.cpp
  5. @@ -31,6 +31,7 @@
  6.  #include "glstate.h"
  7.  #include "texpool.h"
  8.  #include "util.h"
  9. +#include <SDL_image.h>
  10.  
  11.  #include <assert.h>
  12.  #include <vector>
  13. @@ -314,6 +315,14 @@ void build(TEXFBO &tf, Bitmap *bitmaps[BM_COUNT])
  14.  #undef EXEC_BLITS
  15.  
  16.     GLMeta::blitEnd();
  17. +
  18. +   int bpp; Uint32 rs, gs, bs, as;
  19. +   SDL_PixelFormatEnumToMasks(SDL_PIXELFORMAT_ABGR8888, &bpp, &rs, &gs, &bs, &as);
  20. +   SDL_Surface *surf = SDL_CreateRGBSurface(0, tf.width, tf.height, bpp, rs, gs, bs, as);
  21. +   FBO::bind(tf.fbo);
  22. +   gl.ReadPixels(0, 0, tf.width, tf.height, GL_RGBA, GL_UNSIGNED_BYTE, surf->pixels);
  23. +   IMG_SavePNG(surf, "__atlas.png");
  24. +   SDL_FreeSurface(surf);
  25.  }
  26.  
  27.  #define OVER_PLAYER_FLAG (1 << 4)
Add Comment
Please, Sign In to add comment