pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] r2594 - in trunk: . src src/editor src/gui


From: jave27
Subject: [Pingus-CVS] r2594 - in trunk: . src src/editor src/gui
Date: Mon, 16 Jan 2006 05:46:48 +0100

Author: jave27
Date: 2006-01-16 05:46:29 +0100 (Mon, 16 Jan 2006)
New Revision: 2594

Modified:
   trunk/INSTALL
   trunk/src/SConscript
   trunk/src/editor/context_menu.cxx
   trunk/src/editor/editor_panel.cxx
   trunk/src/editor/editor_panel.hxx
   trunk/src/editor/editor_screen.cxx
   trunk/src/editor/editor_screen.hxx
   trunk/src/editor/editor_viewport.cxx
   trunk/src/editor/editor_viewport.hxx
   trunk/src/editor/level_objs.cxx
   trunk/src/file_dialog.cxx
   trunk/src/gui/Makefile.am
   trunk/src/gui/combobox.cxx
   trunk/src/pingus_main.cxx
   trunk/src/server_event.cxx
Log:
Fixed all the gcc -Wall issues (mostly my bad).
The Scons script works again.
Added a Checkbox object.



Modified: trunk/INSTALL
===================================================================
--- trunk/INSTALL       2006-01-16 02:52:31 UTC (rev 2593)
+++ trunk/INSTALL       2006-01-16 04:46:29 UTC (rev 2594)
@@ -1,13 +1,16 @@
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
-Foundation, Inc.
+Installation Instructions
+*************************
 
-   This file is free documentation; the Free Software Foundation gives
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
+Software Foundation, Inc.
+
+This file is free documentation; the Free Software Foundation gives
 unlimited permission to copy, distribute and modify it.
 
 Basic Installation
 ==================
 
-   These are generic installation instructions.
+These are generic installation instructions.
 
    The `configure' shell script attempts to guess correct values for
 various system-dependent variables used during compilation.  It uses
@@ -67,9 +70,9 @@
 Compilers and Options
 =====================
 
-   Some systems require unusual options for compilation or linking that
-the `configure' script does not know about.  Run `./configure --help'
-for details on some of the pertinent environment variables.
+Some systems require unusual options for compilation or linking that the
+`configure' script does not know about.  Run `./configure --help' for
+details on some of the pertinent environment variables.
 
    You can give `configure' initial values for configuration parameters
 by setting variables in the command line or in the environment.  Here
@@ -82,7 +85,7 @@
 Compiling For Multiple Architectures
 ====================================
 
-   You can compile the package for more than one kind of computer at the
+You can compile the package for more than one kind of computer at the
 same time, by placing the object files for each architecture in their
 own directory.  To do this, you must use a version of `make' that
 supports the `VPATH' variable, such as GNU `make'.  `cd' to the
@@ -99,19 +102,19 @@
 Installation Names
 ==================
 
-   By default, `make install' will install the package's files in
+By default, `make install' will install the package's files in
 `/usr/local/bin', `/usr/local/man', etc.  You can specify an
 installation prefix other than `/usr/local' by giving `configure' the
-option `--prefix=PATH'.
+option `--prefix=PREFIX'.
 
    You can specify separate installation prefixes for
 architecture-specific files and architecture-independent files.  If you
-give `configure' the option `--exec-prefix=PATH', the package will use
-PATH as the prefix for installing programs and libraries.
+give `configure' the option `--exec-prefix=PREFIX', the package will
+use PREFIX as the prefix for installing programs and libraries.
 Documentation and other data files will still use the regular prefix.
 
    In addition, if you use an unusual directory layout you can give
-options like `--bindir=PATH' to specify different values for particular
+options like `--bindir=DIR' to specify different values for particular
 kinds of files.  Run `configure --help' for a list of the directories
 you can set and what kinds of files go in them.
 
@@ -122,7 +125,7 @@
 Optional Features
 =================
 
-   Some packages pay attention to `--enable-FEATURE' options to
+Some packages pay attention to `--enable-FEATURE' options to
 `configure', where FEATURE indicates an optional part of the package.
 They may also pay attention to `--with-PACKAGE' options, where PACKAGE
 is something like `gnu-as' or `x' (for the X Window System).  The
@@ -137,11 +140,11 @@
 Specifying the System Type
 ==========================
 
-   There may be some features `configure' cannot figure out
-automatically, but needs to determine by the type of machine the package
-will run on.  Usually, assuming the package is built to be run on the
-_same_ architectures, `configure' can figure that out, but if it prints
-a message saying it cannot guess the machine type, give it the
+There may be some features `configure' cannot figure out automatically,
+but needs to determine by the type of machine the package will run on.
+Usually, assuming the package is built to be run on the _same_
+architectures, `configure' can figure that out, but if it prints a
+message saying it cannot guess the machine type, give it the
 `--build=TYPE' option.  TYPE can either be a short name for the system
 type, such as `sun4', or a canonical name which has the form:
 
@@ -167,9 +170,9 @@
 Sharing Defaults
 ================
 
-   If you want to set default values for `configure' scripts to share,
-you can create a site shell script called `config.site' that gives
-default values for variables like `CC', `cache_file', and `prefix'.
+If you want to set default values for `configure' scripts to share, you
+can create a site shell script called `config.site' that gives default
+values for variables like `CC', `cache_file', and `prefix'.
 `configure' looks for `PREFIX/share/config.site' if it exists, then
 `PREFIX/etc/config.site' if it exists.  Or, you can set the
 `CONFIG_SITE' environment variable to the location of the site script.
@@ -178,7 +181,7 @@
 Defining Variables
 ==================
 
-   Variables not defined in a site shell script can be set in the
+Variables not defined in a site shell script can be set in the
 environment passed to `configure'.  However, some packages may run
 configure again during the build, and the customized values of these
 variables may be lost.  In order to avoid this problem, you should set
@@ -186,14 +189,18 @@
 
      ./configure CC=/usr/local2/bin/gcc
 
-will cause the specified gcc to be used as the C compiler (unless it is
-overridden in the site shell script).
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).  Here is a another example:
 
+     /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
+configuration-related scripts to be executed by `/bin/bash'.
+
 `configure' Invocation
 ======================
 
-   `configure' recognizes the following options to control how it
-operates.
+`configure' recognizes the following options to control how it operates.
 
 `--help'
 `-h'

Modified: trunk/src/SConscript
===================================================================
--- trunk/src/SConscript        2006-01-16 02:52:31 UTC (rev 2593)
+++ trunk/src/SConscript        2006-01-16 04:46:29 UTC (rev 2594)
@@ -125,6 +125,7 @@
 'goal_manager.cxx', 
 'graphic_context_state.cxx', 
 'groundtype.cxx', 
+'gui/checkbox.cxx',
 'gui/combobox.cxx', 
 'gui/cursor.cxx', 
 'gui/display.cxx', 
@@ -135,7 +136,7 @@
 'gui/screen.cxx', 
 'gui/screen_manager.cxx', 
 'gui/screen_ptr.cxx', 
-'gui/surface_button.cxx', 
+'gui/surface_button.cxx',
 'input/axes/button_axis.cxx', 
 'input/axes/inverted_axis.cxx', 
 'input/axes/joystick_axis.cxx', 
@@ -209,7 +210,6 @@
 'start_screen.cxx', 
 'stat_manager.cxx', 
 'state_sprite.cxx', 
-'story.cxx', 
 'story_screen.cxx', 
 'string_format.cxx', 
 'system.cxx', 
@@ -232,6 +232,7 @@
 'worldmap/sprite_drawable.cxx', 
 'worldmap/surface_drawable.cxx', 
 'worldmap/worldmap.cxx', 
+'worldmap/worldmap_story.cxx', 
 'worldobj.cxx', 
 'worldobj_factory.cxx', 
 'worldobjs/conveyor_belt.cxx', 

Modified: trunk/src/editor/context_menu.cxx
===================================================================
--- trunk/src/editor/context_menu.cxx   2006-01-16 02:52:31 UTC (rev 2593)
+++ trunk/src/editor/context_menu.cxx   2006-01-16 04:46:29 UTC (rev 2594)
@@ -35,9 +35,9 @@
                : objs(o), 
                        viewport(vp),
                        pos(p),
-                       item_height(Fonts::pingus_small.get_height()),
                        selected_action_offset(0),
-                       displayed_child(0)
+                       displayed_child(0),
+                       item_height(Fonts::pingus_small.get_height())
        {
                if (base_menu)
                {
@@ -247,4 +247,3 @@
 } // Pingus namespace
 
 /* EOF */
-

Modified: trunk/src/editor/editor_panel.cxx
===================================================================
--- trunk/src/editor/editor_panel.cxx   2006-01-16 02:52:31 UTC (rev 2593)
+++ trunk/src/editor/editor_panel.cxx   2006-01-16 04:46:29 UTC (rev 2594)
@@ -23,10 +23,12 @@
 #include "../vector.hxx"
 #include "../display/drawing_context.hxx"
 #include "../gui/gui_manager.hxx"
+#include "../gui/checkbox.hxx"
 #include "../gui/combobox.hxx"
 #include "../fonts.hxx"
 #include "editor_panel.hxx"
 #include "editor_screen.hxx"
+#include "editor_viewport.hxx"
 #include "panel_buttons.hxx"
 
 namespace Pingus {
@@ -40,7 +42,8 @@
 : editor(es), 
        pressed_button(0), 
        combobox_1(0),
-       combobox_2(0)
+       combobox_2(0),
+       snap_to_checkbox(0)
 {
 
 }
@@ -127,5 +130,12 @@
        }
 }
 
+void
+EditorPanel::checkbox_changed(bool new_value, GUI::Checkbox* box)
+{
+       if (box == snap_to_checkbox)
+               editor->get_viewport()->set_snap_to(new_value);
+}
+
 } // Editor namespace
 } // Pingus namespace

Modified: trunk/src/editor/editor_panel.hxx
===================================================================
--- trunk/src/editor/editor_panel.hxx   2006-01-16 02:52:31 UTC (rev 2593)
+++ trunk/src/editor/editor_panel.hxx   2006-01-16 04:46:29 UTC (rev 2594)
@@ -23,19 +23,22 @@
 #include <vector>
 #include <iostream>
 #include "../gui/component.hxx"
+#include "../gui/checkbox_listener.hxx"
 #include "../gui/combobox.hxx"
 
 namespace Pingus {
 
-class DrawingContext;
+       class DrawingContext;
+       class GUI::Checkbox;
 
 namespace Editor {
 
-class PanelButton;
-class EditorScreen;
+       class PanelButton;
+       class EditorScreen;
 
 /** This class contains all of the buttons, comboboxes, and other components */
-class EditorPanel : public GUI::Component
+class EditorPanel : public GUI::Component, 
+       public GUI::CheckboxListener 
 {
 private:
        /** The EditorScreen to which this panel belongs */
@@ -44,12 +47,15 @@
        /** Collection of buttons on this panel */
        std::vector<PanelButton*> panel_buttons;
 
+       /** Currently selected object on this panel */
+       PanelButton* pressed_button;
+
        /** Combobox which can change it's item list based on the button 
pressed */
        GUI::Combobox* combobox_1;
        GUI::Combobox* combobox_2;
 
-       /** Currently selected object on this panel */
-       PanelButton* pressed_button;
+       /** Checkbox which controls the snap-to-grid functionality */
+       GUI::Checkbox* snap_to_checkbox;
 
 public:
        /** Constructor
@@ -78,7 +84,11 @@
        
        /** Changes which button is currently pressed */
        void set_selected_button(PanelButton* pb);
+       
+       /** Event that fires when a checkbox gets changed */
+       void checkbox_changed(bool new_value, GUI::Checkbox* box);
 
+
 private:
        EditorPanel();
   EditorPanel (const EditorPanel&);

Modified: trunk/src/editor/editor_screen.cxx
===================================================================
--- trunk/src/editor/editor_screen.cxx  2006-01-16 02:52:31 UTC (rev 2593)
+++ trunk/src/editor/editor_screen.cxx  2006-01-16 04:46:29 UTC (rev 2594)
@@ -42,8 +42,10 @@
 // Default constructor
 EditorScreen::EditorScreen(XMLLevel* level)
 : plf(level), 
-       close_dialog(false),
-       filedialog(0)
+       panel(0),
+       viewport(0),
+       filedialog(0),
+       close_dialog(false)
 {
        if (!plf) plf = new XMLLevel();
 }

Modified: trunk/src/editor/editor_screen.hxx
===================================================================
--- trunk/src/editor/editor_screen.hxx  2006-01-16 02:52:31 UTC (rev 2593)
+++ trunk/src/editor/editor_screen.hxx  2006-01-16 04:46:29 UTC (rev 2594)
@@ -78,6 +78,9 @@
 
        /** Return the gui_manager */
        GUI::GUIManager* get_gui_manager() const { return gui_manager; }
+       
+       /** Return the viewport */
+       EditorViewport* get_viewport() const { return viewport; }
 
        /** Return a pointer to the current level */
        XMLLevel* get_level() const { return plf; }

Modified: trunk/src/editor/editor_viewport.cxx
===================================================================
--- trunk/src/editor/editor_viewport.cxx        2006-01-16 02:52:31 UTC (rev 
2593)
+++ trunk/src/editor/editor_viewport.cxx        2006-01-16 04:46:29 UTC (rev 
2594)
@@ -39,10 +39,10 @@
        state(CL_Display::get_width(), CL_Display::get_height()),
        scene_context(new SceneContext()),
        editor(e),
+       autoscroll(true),
        highlighted_area(0,0,0,0),
        context_menu(0),
        snap_to(true),
-       autoscroll(true),
        current_action(NOTHING)
 {
        // FIXME: Hardcoded values should be determined by level size

Modified: trunk/src/editor/editor_viewport.hxx
===================================================================
--- trunk/src/editor/editor_viewport.hxx        2006-01-16 02:52:31 UTC (rev 
2593)
+++ trunk/src/editor/editor_viewport.hxx        2006-01-16 04:46:29 UTC (rev 
2594)
@@ -68,6 +68,9 @@
 
        /** Refresh the list of objects (do when loading or creating a new 
level) */
        void refresh();
+       
+       /** Turns the "snap-to-grid" option on or off */
+       void set_snap_to(bool s) { snap_to = s; }
 
        EditorScreen* get_screen() { return editor; }
 

Modified: trunk/src/editor/level_objs.cxx
===================================================================
--- trunk/src/editor/level_objs.cxx     2006-01-16 02:52:31 UTC (rev 2593)
+++ trunk/src/editor/level_objs.cxx     2006-01-16 04:46:29 UTC (rev 2594)
@@ -39,6 +39,7 @@
        parallax(0.0),
        width(0),
        owner_id(-1),
+       release_rate(0),
        scroll_x(0),
        scroll_y(0),
        stretch_x(false),
@@ -47,9 +48,9 @@
        para_x(0),
        para_y(0),
        color(0,0,0,0),
+       attribs(get_attributes(obj_name)),
        removed(false),
-       selected(false),
-       attribs(get_attributes(obj_name))
+       selected(false)
 {
        if (attribs & HAS_SURFACE_FAKE)
                load_generic_surface();

Modified: trunk/src/file_dialog.cxx
===================================================================
--- trunk/src/file_dialog.cxx   2006-01-16 02:52:31 UTC (rev 2593)
+++ trunk/src/file_dialog.cxx   2006-01-16 04:46:29 UTC (rev 2594)
@@ -49,7 +49,7 @@
                        ResDescriptor("core/menu/exit_button_pressed"),
                        ResDescriptor("core/menu/exit_button_hover")),
                        file_dialog(f),
-                       label (l), 
+                       label (l),
                        is_hidden(true)
                {
                }
@@ -144,11 +144,11 @@
        public:
                FileDialogScrollButton (FileDialog* f, int d, int height_offset)
                        : file_dialog(f),
-                               hover(false),
-                          pos(Vector((float)CL_Display::get_width()/2 + 210,
-                                     (float)CL_Display::get_height()/2 + 
height_offset)),
-                          direction(d),
-                                                                               
                        is_hidden(false)
+                               pos(Vector((float)CL_Display::get_width()/2 + 
210,
+                                       (float)CL_Display::get_height()/2 + 
height_offset)),
+                               direction(d),
+                               is_hidden(false),
+                               hover(false)
                {
                        std::string str_direction = d==0 ? "up" : "down";
                        sprite = Resource::load_sprite("core/menu/" + 
str_direction + "_arrow");
@@ -201,10 +201,10 @@
        public:
                FileDialogParentFolderButton (FileDialog* f)
                        : file_dialog(f),
-                               hover(false),
         pos(Vector((float)CL_Display::get_width()/2 + 230,
                    (float)CL_Display::get_height()/2 - 210)),
-                         
sprite(Resource::load_sprite("core/menu/parent_folder"))
+                         
sprite(Resource::load_sprite("core/menu/parent_folder")),
+                               hover(false)
                {
                }
 

Modified: trunk/src/gui/Makefile.am
===================================================================
--- trunk/src/gui/Makefile.am   2006-01-16 02:52:31 UTC (rev 2593)
+++ trunk/src/gui/Makefile.am   2006-01-16 04:46:29 UTC (rev 2594)
@@ -42,6 +42,9 @@
         surface_button.cxx \
         surface_button.hxx \
         combobox.cxx \
-        combobox.hxx
+        combobox.hxx \
+                               checkbox.cxx \
+                               checkbox.hxx \
+                               checkbox_listener.hxx
 
-# EOF #
\ No newline at end of file
+# EOF #

Modified: trunk/src/gui/combobox.cxx
===================================================================
--- trunk/src/gui/combobox.cxx  2006-01-16 02:52:31 UTC (rev 2593)
+++ trunk/src/gui/combobox.cxx  2006-01-16 04:46:29 UTC (rev 2594)
@@ -30,10 +30,10 @@
 Combobox::Combobox (Vector p, std::string l) :
        current_item(0),
        drop_down(false),
+       hover(false),
        pos(p),
        enabled(false),
-       label(l),
-       hover(false)
+       label(l)
 {
        // Default to 20 characters wide.
        width = Fonts::smallfont.get_width('O') * 20.0f;

Modified: trunk/src/pingus_main.cxx
===================================================================
--- trunk/src/pingus_main.cxx   2006-01-16 02:52:31 UTC (rev 2593)
+++ trunk/src/pingus_main.cxx   2006-01-16 04:46:29 UTC (rev 2594)
@@ -122,8 +122,8 @@
 }
 
 PingusMain::PingusMain() :
+  blitter_test(false),
   show_credits(false),
-  blitter_test(false),
        editor(false),
   refresh_rate(60)
 {

Modified: trunk/src/server_event.cxx
===================================================================
--- trunk/src/server_event.cxx  2006-01-16 02:52:31 UTC (rev 2593)
+++ trunk/src/server_event.cxx  2006-01-16 04:46:29 UTC (rev 2594)
@@ -27,7 +27,11 @@
 
 namespace Pingus {
 
-ServerEvent::ServerEvent()
+ServerEvent::ServerEvent() :
+       type(PINGU_ACTION_EVENT),
+       time_stamp(0),
+       pingu_id(0),
+       pingu_action(Actions::Walker)
 {
 }
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]