* Fix main.cpp again
authorMathnerd314 <man.is.allan@gmail.com>
Thu, 26 Nov 2009 21:33:38 +0000 (21:33 +0000)
committerMathnerd314 <man.is.allan@gmail.com>
Thu, 26 Nov 2009 21:33:38 +0000 (21:33 +0000)
* Use GLEW properly in CMake
* Inro WIP
* Update tinygettext and ignore std*.txt

SVN-Revision: 6120

CMakeLists.txt
data/levels/world1/intro.nut
data/levels/world1/intro.stl
mk/cmake/FindGLEW.cmake [new file with mode: 0644]
src/main.cpp
src/supertux/main.cpp

index 066ad6a..aaeb23b 100644 (file)
@@ -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})
index 60f7e31..317b633 100644 (file)
@@ -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()
index 1950ea3..d65e390 100644 (file)
@@ -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 (file)
index 0000000..9064fd4
--- /dev/null
@@ -0,0 +1,23 @@
+# - Try to find GLEW\r
+# Once done this will define\r
+#  \r
+#  GLEW_FOUND        - system has GLEW\r
+#  GLEW_INCLUDE_DIR  - the GLEW include directory\r
+#  GLEW_LIBRARY      - Link these to use GLEW\r
+#   \r
+\r
+   FIND_PATH( GLEW_INCLUDE_DIR glew.h wglew.h\r
+              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"\r
+              PATH_SUFFIXES include include/gl include/GL Include Include/gl Include/GL )\r
+   FIND_LIBRARY( GLEW_LIBRARY\r
+                 NAMES glew32 glew GLEW\r
+                 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"\r
+                 PATH_SUFFIXES lib Lib\r
+               )\r
+\r
+IF (GLEW_INCLUDE_DIR AND GLEW_LIBRARY)\r
+   SET(GLEW_FOUND TRUE)\r
+   SET( GLEW_LIBRARY_DIR ${GLEW_LIBRARY} )\r
+ELSE (GLEW_INCLUDE_DIR AND GLEW_LIBRARY)\r
+   SET( GLEW_FOUND FALSE )\r
+ENDIF (GLEW_INCLUDE_DIR AND GLEW_LIBRARY)\r
index 8988652..44f7d12 100644 (file)
@@ -20,7 +20,7 @@
 
 int main(int argc, char** argv)
 {
-  return Main().main(argc, argv);
+  return Main().SDL_main(argc, argv);
 }
 
 /* EOF */
index 7ee03c3..0f6e414 100644 (file)
 //  You should have received a copy of the GNU General Public License
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-#include "supertux/main.hpp"
-
 #include <config.h>
 #include <version.h>
 
 #include <SDL_image.h>
-#undef main
 #include <physfs.h>
 #include <iostream>
 #include <binreloc.h>
 #include <tinygettext/log.hpp>
 
+#include "supertux/main.hpp"
+
 #ifdef MACOSX
 namespace supertux_apple {
 #  include <CoreFoundation/CoreFoundation.h>