From 6469bdeda8d2e7ccae79f2682ef4efc441601c4b Mon Sep 17 00:00:00 2001 From: Mathnerd314 Date: Thu, 26 Nov 2009 21:33:38 +0000 Subject: [PATCH] * Fix main.cpp again * Use GLEW properly in CMake * Inro WIP * Update tinygettext and ignore std*.txt SVN-Revision: 6120 --- CMakeLists.txt | 7 ++++++- data/levels/world1/intro.nut | 34 +++++++++++++++------------------- data/levels/world1/intro.stl | 9 --------- mk/cmake/FindGLEW.cmake | 23 +++++++++++++++++++++++ src/main.cpp | 2 +- src/supertux/main.cpp | 5 ++--- 6 files changed, 47 insertions(+), 33 deletions(-) create mode 100644 mk/cmake/FindGLEW.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 066ad6aac..aaeb23b28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,6 +72,11 @@ IF(ENABLE_OPENGL) INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) SET(HAVE_OPENGL TRUE) ENDIF(OPENGL_FOUND) + + FIND_PACKAGE(GLEW) + IF(GLEW_FOUND) + INCLUDE_DIRECTORIES(${GLEW_INCLUDE_DIR}) + ENDIF(GLEW_FOUND) ENDIF(ENABLE_OPENGL) FIND_PACKAGE(OpenAL REQUIRED) @@ -326,7 +331,7 @@ TARGET_LINK_LIBRARIES(supertux2 ${OGGVORBIS_LIBRARIES}) TARGET_LINK_LIBRARIES(supertux2 ${PHYSFS_LIBRARY}) IF(HAVE_OPENGL) TARGET_LINK_LIBRARIES(supertux2 ${OPENGL_LIBRARY}) - TARGET_LINK_LIBRARIES(supertux2 GLEW) + TARGET_LINK_LIBRARIES(supertux2 ${GLEW_LIBRARY}) ENDIF(HAVE_OPENGL) IF(HAVE_LIBCURL) TARGET_LINK_LIBRARIES(supertux2 ${CURL_LIBRARY}) diff --git a/data/levels/world1/intro.nut b/data/levels/world1/intro.nut index 60f7e3171..317b63366 100644 --- a/data/levels/world1/intro.nut +++ b/data/levels/world1/intro.nut @@ -1,13 +1,14 @@ function intro() { //initialize - SUPERTUX.set_action("big-walk-right"); + Camera.set_mode("manual"); + Tux.deactivate(); +// Tux.set_position(2291,1280); + Tux.add_bonus("grow"); RADIO.set_action("quiet"); PENNY.set_action("stand-left"); NOLOK.set_visible(false); logo <- FloatingImage("images/objects/logo/logo.sprite"); - Tux.deactivate(); - Tux.set_visible(false); Effect.sixteen_to_nine(0); //begin scrolling sequence @@ -19,7 +20,7 @@ function intro() wait(3); Text.fade_out(2); wait(10); - SUPERTUX.set_velocity(50,0); + Tux.walk(0); Camera.scroll_to(3100, 945, 18); wait(6); logo.set_anchor_point(ANCHOR_TOP); @@ -34,8 +35,7 @@ function intro() wait(5.3); //begin conversation and Tux rap - SUPERTUX.set_velocity(0,0); - SUPERTUX.set_action("big-stand-right"); + Tux.walk(0); play_sound("speech/tux_hello.ogg"); wait(3); play_sound("speech/penny_runt_01.ogg"); @@ -62,7 +62,7 @@ function intro() NOLOK.set_visible(false); PENNY.set_visible(false); RADIO.set_action("quiet"); - SUPERTUX.set_pos(3550, SUPERTUX.get_pos_y()); +// Tux.set_position(3550, 1270); //wake up, Tux... Effect.fade_in(4); @@ -73,8 +73,7 @@ function intro() wait(1); tux_upset(); wait(4); - SUPERTUX.set_action("big-walk-right"); - SUPERTUX.set_velocity(300,0); + Tux.walk(3000); wait(2); //end intro sequence @@ -96,16 +95,13 @@ function shake_bush() function tux_upset() { - SUPERTUX.set_action("big-walk-right"); - SUPERTUX.set_velocity(200,0); - wait(0.3); - SUPERTUX.set_action("big-stand-right"); - SUPERTUX.set_velocity(0,0); - wait(0.4); - SUPERTUX.set_action("big-walk-left"); - SUPERTUX.set_velocity(-200,0); - wait(0.3); - SUPERTUX.set_action("big-stand-left"); + Tux.walk(200); + wait(1); + Tux.walk(0); + wait(1); + Tux.walk(-200); + wait(1); + Tux.walk(0); } function logo_in() diff --git a/data/levels/world1/intro.stl b/data/levels/world1/intro.stl index 1950ea38b..d65e3909f 100644 --- a/data/levels/world1/intro.stl +++ b/data/levels/world1/intro.stl @@ -23,15 +23,6 @@ Level.finish(true); (bottom_color 0 0.6 1) ) (scriptedobject - (name "SUPERTUX") - (visible #t) - (physic-enabled #t) - (solid #t) - (x 2291) - (y 1280) - (sprite "images/creatures/tux/tux.sprite") - ) - (scriptedobject (name "PENNY") (visible #t) (physic-enabled #t) diff --git a/mk/cmake/FindGLEW.cmake b/mk/cmake/FindGLEW.cmake new file mode 100644 index 000000000..9064fd4b3 --- /dev/null +++ b/mk/cmake/FindGLEW.cmake @@ -0,0 +1,23 @@ +# - Try to find GLEW +# Once done this will define +# +# GLEW_FOUND - system has GLEW +# GLEW_INCLUDE_DIR - the GLEW include directory +# GLEW_LIBRARY - Link these to use GLEW +# + + FIND_PATH( GLEW_INCLUDE_DIR glew.h wglew.h + PATHS /usr/local /usr c:/glew "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK" "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK" + PATH_SUFFIXES include include/gl include/GL Include Include/gl Include/GL ) + FIND_LIBRARY( GLEW_LIBRARY + NAMES glew32 glew GLEW + PATHS /usr /usr/local c:/glew "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK" "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK" + PATH_SUFFIXES lib Lib + ) + +IF (GLEW_INCLUDE_DIR AND GLEW_LIBRARY) + SET(GLEW_FOUND TRUE) + SET( GLEW_LIBRARY_DIR ${GLEW_LIBRARY} ) +ELSE (GLEW_INCLUDE_DIR AND GLEW_LIBRARY) + SET( GLEW_FOUND FALSE ) +ENDIF (GLEW_INCLUDE_DIR AND GLEW_LIBRARY) diff --git a/src/main.cpp b/src/main.cpp index 8988652dc..44f7d12ab 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,7 +20,7 @@ int main(int argc, char** argv) { - return Main().main(argc, argv); + return Main().SDL_main(argc, argv); } /* EOF */ diff --git a/src/supertux/main.cpp b/src/supertux/main.cpp index 7ee03c35f..0f6e41493 100644 --- a/src/supertux/main.cpp +++ b/src/supertux/main.cpp @@ -14,18 +14,17 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#include "supertux/main.hpp" - #include #include #include -#undef main #include #include #include #include +#include "supertux/main.hpp" + #ifdef MACOSX namespace supertux_apple { # include -- 2.11.0