]> git.jsancho.org Git - lugaru.git/commitdiff
Merge.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 13 May 2010 04:49:03 +0000 (00:49 -0400)
committerRyan C. Gordon <icculus@icculus.org>
Thu, 13 May 2010 04:49:03 +0000 (00:49 -0400)
CMakeLists.txt
Source/Constants.h
Source/OpenGL_Windows.cpp
Source/TGALoader.cpp
Source/WinInput.cpp
Source/gamegl.h

index abcb734330e7168c305ed6f518734de440094856..9be2c9e9235cfa8a1ef983a1e91f06d1d207bd6c 100644 (file)
@@ -30,7 +30,6 @@ endif(WIN32)
 
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
 find_package(OpenAL REQUIRED)
-find_package(BZip2 REQUIRED)
 find_package(PNG REQUIRED)
 find_package(JPEG REQUIRED)
 find_package(ZLIB REQUIRED)
@@ -41,7 +40,6 @@ find_package(OggVorbis REQUIRED)
 
 include_directories(
        ${OPENAL_INCLUDES}
-       ${BZIP2_INCLUDE_DIR}
        ${JPEG_INCLUDE_DIR}
        ${PNG_INCLUDE_DIR}
        ${ZLIB_INCLUDE_DIR}
@@ -52,7 +50,7 @@ include_directories(
        ${OGG_INCLUDE_DIR}
        ${CMAKE_SOURCE_DIR}/Source)
 
-set(LUGARU_LIBS ${OPENAL_LIBRARY} ${PNG_LIBRARY} ${JPEG_LIBRARY} ${BZIP2_LIBRARIES} ${ZLIB_LIBRARIES} ${SDL_LIBRARY} ${GLU_LIBRARY} ${OPENGL_LIBRARY} ${VORBISFILE_LIBRARY} ${OGG_LIBRARY})
+set(LUGARU_LIBS ${OPENAL_LIBRARY} ${PNG_LIBRARY} ${JPEG_LIBRARY} ${ZLIB_LIBRARIES} ${SDL_LIBRARY} ${GLU_LIBRARY} ${OPENGL_LIBRARY} ${VORBISFILE_LIBRARY} ${OGG_LIBRARY})
 
 add_subdirectory(Source)
 
index 98c74b3492783fe38750707a02b312c0481bf618..580febca35b98fdcd6765c794109de093df64089 100644 (file)
@@ -92,7 +92,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #define constraint 1
 #define muscle 2
 
-#define head 0
+const int head = 0; // Do not conflict with 'head' var in zlib 
+
 #define neck 1
 #define leftshoulder 2
 #define leftelbow 3
index 550552e3c361016f4d5df3da0b6038f338dfac83..7b68b8f4849445fabf0121c08fe09418e52d8574 100644 (file)
@@ -19,10 +19,13 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 
-
+/* No need for Visual Leak Detector
 #ifdef WIN32
 #include <vld.h>
 #endif
+*/
+
+#define USE_DEVIL 0
 
 #ifndef USE_DEVIL
 #  ifdef WIN32
@@ -37,12 +40,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
        #include "Game.h"
 #else
 
-    extern "C" {
-       #include "zlib.h"
-           #include "png.h"
-       #include "jpeglib.h"
-    }
        #include "Game.h"
+       extern "C" {
+               #include "zlib.h"
+               #include "png.h"
+               #include "jpeglib.h"
+       }
+
     static bool load_image(const char * fname, TGAImageRec & tex);
     static bool load_png(const char * fname, TGAImageRec & tex);
     static bool load_jpg(const char * fname, TGAImageRec & tex);
@@ -257,9 +261,10 @@ Boolean gDone = false, gfFrontProcess = true;
 
 Game * pgame = 0;
 
-
+#ifndef WIN32
 static int _argc = 0;
 static char **_argv = NULL;
+#endif
 
 bool cmdline(const char *cmd)
 {
index 2927fa67b478ee6b7ae2ba6e28fda8e55b0fd830..89d28be7c7d4d1fd0d194bb6c8288dd30885844e 100644 (file)
@@ -20,8 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 
 /**> HEADER FILES <**/
-#include "TGALoader.h"
 #include "Game.h"
+#include "TGALoader.h"
 
 extern float texdetail;
 extern TGAImageRec texture;
index 59b1277eb2f90e50c6de09f759417a7504b5a9c9..c13bb917b9f79c95939eee2550b218e5e176c171 100644 (file)
@@ -61,6 +61,306 @@ Boolean     IsKeyDown( unsigned char *keyMap, unsigned short theKey )
        return 0;
 }
 
+#if defined(_WIN32)
+unsigned short         CharToKey(const char* which)
+{
+       // alphabetic keys
+       if(!stricmp(which,"a")){
+               return MAC_A_KEY;
+       }
+       if(!stricmp(which,"b")){
+               return MAC_B_KEY;
+       }
+       if(!stricmp(which,"c")){
+               return MAC_C_KEY;
+       }
+       if(!stricmp(which,"d")){
+               return MAC_D_KEY;
+       }
+       if(!stricmp(which,"e")){
+               return MAC_E_KEY;
+       }
+       if(!stricmp(which,"f")){
+               return MAC_F_KEY;
+       }
+       if(!stricmp(which,"g")){
+               return MAC_G_KEY;
+       }
+       if(!stricmp(which,"h")){
+               return MAC_H_KEY;
+       }
+       if(!stricmp(which,"i")){
+               return MAC_I_KEY;
+       }
+       if(!stricmp(which,"j")){
+               return MAC_J_KEY;
+       }
+       if(!stricmp(which,"k")){
+               return MAC_K_KEY;
+       }
+       if(!stricmp(which,"l")){
+               return MAC_L_KEY;
+       }
+       if(!stricmp(which,"m")){
+               return MAC_M_KEY;
+       }
+       if(!stricmp(which,"n")){
+               return MAC_N_KEY;
+       }
+       if(!stricmp(which,"o")){
+               return MAC_O_KEY;
+       }
+       if(!stricmp(which,"p")){
+               return MAC_P_KEY;
+       }
+       if(!stricmp(which,"q")){
+               return MAC_Q_KEY;
+       }
+       if(!stricmp(which,"r")){
+               return MAC_R_KEY;
+       }
+       if(!stricmp(which,"s")){
+               return MAC_S_KEY;
+       }
+       if(!stricmp(which,"t")){
+               return MAC_T_KEY;
+       }
+       if(!stricmp(which,"u")){
+               return MAC_U_KEY;
+       }
+       if(!stricmp(which,"v")){
+               return MAC_V_KEY;
+       }
+       if(!stricmp(which,"w")){
+               return MAC_W_KEY;
+       }
+       if(!stricmp(which,"x")){
+               return MAC_X_KEY;
+       }
+       if(!stricmp(which,"y")){
+               return MAC_Y_KEY;
+       }
+       if(!stricmp(which,"z")){
+               return MAC_Z_KEY;
+       }
+
+       // keypad keys
+       if(!stricmp(which,"KP0")){
+               return MAC_NUMPAD_0_KEY;
+       }
+       if(!stricmp(which,"KP1")){
+               return MAC_NUMPAD_1_KEY;
+       }
+       if(!stricmp(which,"KP2")){
+               return MAC_NUMPAD_2_KEY;
+       }
+       if(!stricmp(which,"KP3")){
+               return MAC_NUMPAD_3_KEY;
+       }
+       if(!stricmp(which,"KP4")){
+               return MAC_NUMPAD_4_KEY;
+       }
+       if(!stricmp(which,"KP5")){
+               return MAC_NUMPAD_5_KEY;
+       }
+       if(!stricmp(which,"KP6")){
+               return MAC_NUMPAD_6_KEY;
+       }
+       if(!stricmp(which,"KP7")){
+               return MAC_NUMPAD_7_KEY;
+       }
+       if(!stricmp(which,"KP8")){
+               return MAC_NUMPAD_8_KEY;
+       }
+       if(!stricmp(which,"KP9")){
+               return MAC_NUMPAD_9_KEY;
+       }
+
+       // enter
+       if(!stricmp(which,"enter")){
+               return MAC_ENTER_KEY;
+       }
+
+       // number keys
+       if(!stricmp(which,"0")){
+               return MAC_0_KEY;
+       }
+       if(!stricmp(which,"1")){
+               return MAC_1_KEY;
+       }
+       if(!stricmp(which,"2")){
+               return MAC_2_KEY;
+       }
+       if(!stricmp(which,"3")){
+               return MAC_3_KEY;
+       }
+       if(!stricmp(which,"4")){
+               return MAC_4_KEY;
+       }
+       if(!stricmp(which,"5")){
+               return MAC_5_KEY;
+       }
+       if(!stricmp(which,"6")){
+               return MAC_6_KEY;
+       }
+       if(!stricmp(which,"7")){
+               return MAC_7_KEY;
+       }
+       if(!stricmp(which,"8")){
+               return MAC_8_KEY;
+       }
+       if(!stricmp(which,"9")){
+               return MAC_9_KEY;
+       }
+
+       // function keys
+       if(!stricmp(which,"F1")){
+               return MAC_F1_KEY;
+       }
+       if(!stricmp(which,"F2")){
+               return MAC_F2_KEY;
+       }
+       if(!stricmp(which,"F3")){
+               return MAC_F3_KEY;
+       }
+       if(!stricmp(which,"F4")){
+               return MAC_F4_KEY;
+       }
+       if(!stricmp(which,"F5")){
+               return MAC_F5_KEY;
+       }
+       if(!stricmp(which,"F6")){
+               return MAC_F6_KEY;
+       }
+       if(!stricmp(which,"F7")){
+               return MAC_F7_KEY;
+       }
+       if(!stricmp(which,"F8")){
+               return MAC_F8_KEY;
+       }
+       if(!stricmp(which,"F9")){
+               return MAC_F9_KEY;
+       }
+       if(!stricmp(which,"F10")){
+               return MAC_F10_KEY;
+       }
+       if(!stricmp(which,"F11")){
+               return MAC_F11_KEY;
+       }
+       if(!stricmp(which,"F12")){
+               return MAC_F12_KEY;
+       }
+
+       // escape
+       if(!stricmp(which,"escape")){
+               return MAC_ESCAPE_KEY;
+       }
+       if(!stricmp(which,"backspace")){
+               return MAC_DELETE_KEY;
+       }
+       if(!stricmp(which,"tab")){
+               return MAC_TAB_KEY;
+       }
+       if(!stricmp(which,"`")){
+               return MAC_TILDE_KEY;
+       }
+       if(!stricmp(which,"caps_lock")){
+               return MAC_CAPS_LOCK_KEY;
+       }
+//     if(which==){
+//             return "";
+//     }
+       if(!stricmp(which,"command")){
+               return MAC_COMMAND_KEY;
+       }
+       if(!stricmp(which,"option")){
+               return MAC_OPTION_KEY;
+       }
+       if(!stricmp(which,"delete")){
+               return MAC_DEL_KEY;
+       }
+       if(!stricmp(which,"insert")){
+               return MAC_INSERT_KEY;
+       }
+       if(!stricmp(which,"home")){
+               return MAC_HOME_KEY;
+       }
+       if(!stricmp(which,"end")){
+               return MAC_END_KEY;
+       }
+       if(!stricmp(which,"page_up")){
+               return MAC_PAGE_UP_KEY;
+       }
+       if(!stricmp(which,"page_down")){
+               return MAC_PAGE_DOWN_KEY;
+       }
+       if(!stricmp(which,"clear")){
+               return MAC_NUMPAD_CLEAR_KEY;
+       }
+
+       if(!stricmp(which,"control")){
+               return MAC_CONTROL_KEY;
+       }
+       if(!stricmp(which,"return")){
+               return MAC_RETURN_KEY;
+       }
+       if(!stricmp(which,"space")){
+               return MAC_SPACE_KEY;
+       }
+       if(!stricmp(which,"shift")){
+               return MAC_SHIFT_KEY;
+       }
+       if(!stricmp(which,"uparrow")){
+               return MAC_ARROW_UP_KEY;
+       }
+       if(!stricmp(which,"downarrow")){
+               return MAC_ARROW_DOWN_KEY;
+       }
+       if(!stricmp(which,"leftarrow")){
+               return MAC_ARROW_LEFT_KEY;
+       }
+       if(!stricmp(which,"rightarrow")){
+               return MAC_ARROW_RIGHT_KEY;
+       }
+       if(!stricmp(which,"mouse1")){
+               return MAC_MOUSEBUTTON1;
+       }
+       if(!stricmp(which,"mouse2")){
+               return MAC_MOUSEBUTTON2;
+       }
+       if(!stricmp(which,"+")){
+               return MAC_NUMPAD_PLUS_KEY;
+       }
+       if(!stricmp(which,"*")){
+               return MAC_NUMPAD_ASTERISK_KEY;
+       }
+       if(!stricmp(which,"/")){
+               return MAC_SLASH_KEY;
+       }
+       if(!stricmp(which,"\\")){
+               return MAC_BACKSLASH_KEY;
+       }
+       if(!stricmp(which,"[")){
+               return MAC_LEFTBRACKET_KEY;
+       }
+       if(!stricmp(which,"]")){
+               return MAC_RIGHTBRACKET_KEY;
+       }
+       if(!stricmp(which,".")){
+               return MAC_PERIOD_KEY;
+       }
+       if(!stricmp(which,",")){
+               return MAC_COMMA_KEY;
+       }
+       if(!stricmp(which,"\"")){
+               return MAC_APOSTROPHE_KEY;
+       }
+       if(!stricmp(which,";")){
+               return MAC_SEMICOLON_KEY;
+       }
+       return UNKNOWN_KEY;
+}
+#else
 unsigned short         CharToKey(const char* which)
 {
        // alphabetic keys
@@ -359,6 +659,7 @@ unsigned short      CharToKey(const char* which)
        }
        return UNKNOWN_KEY;
 }
+#endif
 
 const char*    KeyToChar(unsigned short which)
 {
index 482a21d31de33adbe136fc75690fd6772adf2928..20d94ce125d9799cc2c84c6a1ecb9afe411f1991 100644 (file)
@@ -54,7 +54,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
   #include "MacCompatibility.h"
   //#include "il/ilut.h"
 
-  #define glDeleteTextures( a, b) glDeleteTextures( (a), (const unsigned int *)(b) );
 #endif
 
 #if !PLATFORM_MACOSX