comparison engine/core/util/base/fife_stdint.h @ 620:853d25234671

* Moved the GLEnable and GLDisable structures from opengl_gui_graphics.cpp to fife_opengl.h as they may prove to be useful elsewhere. * Fixed the color mask definitions in fife_stdint.h * Added the nextPow2() function to calculate the nearest (greater) power of 2 * Removed a bunch of re-definitions of RGB masks * Modified GLImage to only generate one "texture chunk". I hope this makes better use of memory and speeds things up a hair * Made use of the GLEnable structure when clearing the screen
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Thu, 30 Sep 2010 21:24:55 +0000
parents 90005975cdbb
children 356634098bd9
comparison
equal deleted inserted replaced
619:f648bfbae5fe 620:853d25234671
1 /*************************************************************************** 1 /***************************************************************************
2 * Copyright (C) 2005-2008 by the FIFE team * 2 * Copyright (C) 2005-2010 by the FIFE team *
3 * http://www.fifengine.de * 3 * http://www.fifengine.net *
4 * This file is part of FIFE. * 4 * This file is part of FIFE. *
5 * * 5 * *
6 * FIFE is free software; you can redistribute it and/or * 6 * FIFE is free software; you can redistribute it and/or *
7 * modify it under the terms of the GNU Lesser General Public * 7 * modify it under the terms of the GNU Lesser General Public *
8 * License as published by the Free Software Foundation; either * 8 * License as published by the Free Software Foundation; either *
22 #ifndef FIFE_UTIL_FIFE_STDINT_H 22 #ifndef FIFE_UTIL_FIFE_STDINT_H
23 #define FIFE_UTIL_FIFE_STDINT_H 23 #define FIFE_UTIL_FIFE_STDINT_H
24 24
25 // Standard C++ library includes 25 // Standard C++ library includes
26 26
27 // Platform specific includes 27 // Platform specific includes
28 #if defined( WIN32 ) && defined( _MSC_VER ) 28 #if defined( WIN32 ) && defined( _MSC_VER )
29 #ifndef _SDL_H 29 #ifndef _SDL_H
30 typedef signed __int8 int8_t; 30 typedef signed __int8 int8_t;
31 typedef unsigned __int8 uint8_t; 31 typedef unsigned __int8 uint8_t;
32 typedef signed __int16 int16_t; 32 typedef signed __int16 int16_t;
39 #else 39 #else
40 #include <stdint.h> 40 #include <stdint.h>
41 #endif 41 #endif
42 42
43 // 3rd party library includes 43 // 3rd party library includes
44 #include <SDL.h>
44 45
45 // FIFE includes 46 // FIFE includes
46 // These includes are split up in two parts, separated by one empty line 47 // These includes are split up in two parts, separated by one empty line
47 // First block: files included from the FIFE root src directory 48 // First block: files included from the FIFE root src directory
48 // Second block: files included from the same folder 49 // Second block: files included from the same folder
49 50
50 // SDL masks for SDL_CreateRGBSurface 51 // SDL masks for SDL_CreateRGBSurface
51 namespace FIFE { 52 namespace FIFE {
52 #if 1 // tried "SDL_BYTEORDER != SDL_BIG_ENDIAN" with SDL.h inclusion, however this doesn't seem not work 53 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
53 const int RMASK = 0xff000000; 54 const int RMASK = 0xff000000;
54 const int GMASK = 0x00ff0000; 55 const int GMASK = 0x00ff0000;
55 const int BMASK = 0x0000ff00; 56 const int BMASK = 0x0000ff00;
56 const int AMASK = 0x000000ff; 57 const int AMASK = 0x000000ff;
57 #else 58 #else
58 const int RMASK = 0x000000ff; 59 const int RMASK = 0x000000ff;
59 const int GMASK = 0x0000ff00; 60 const int GMASK = 0x0000ff00;
60 const int BMASK = 0x00ff0000; 61 const int BMASK = 0x00ff0000;
61 const int AMASK = 0xff000000; 62 const int AMASK = 0xff000000;
62 #endif 63 #endif
63 const int NULLMASK = 0x00000000; 64 const int NULLMASK = 0x00000000;
64 } 65 } //FIFE
65 66
66 #endif // FIFEINT_H 67 #endif // FIFEINT_H