pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] r3160 - in trunk/pingus: . src/editor


From: grumbel at BerliOS
Subject: [Pingus-CVS] r3160 - in trunk/pingus: . src/editor
Date: Sat, 15 Sep 2007 17:22:32 +0200

Author: grumbel
Date: 2007-09-15 17:22:32 +0200 (Sat, 15 Sep 2007)
New Revision: 3160

Modified:
   trunk/pingus/README
   trunk/pingus/TODO
   trunk/pingus/src/editor/level_objs.cpp
   trunk/pingus/src/editor/object_selector_list.cpp
Log:
- some TODO cleanup
- added scroll limit to ObjectSelector
- some more alpha fillrect stuff

Modified: trunk/pingus/README
===================================================================
--- trunk/pingus/README 2007-09-15 13:27:04 UTC (rev 3159)
+++ trunk/pingus/README 2007-09-15 15:22:32 UTC (rev 3160)
@@ -5,14 +5,12 @@
 Introduction
 
    Pingus is a free Lemmings(tm) clone for GNU/Linux, Win32 and other
-   operating systems supported by ClanLib. It is covered under the GPLv2,
+   operating systems supported by SDL. It is covered under the GPLv2,
    check the file COPYING, for more information.
    
    See INSTALL for generic install instructions, INSTALL.unix for
    instructions on how to compile and run Pingus from source on
-   GNU/Linux and INSTALL.Win32 for Windows. See README.binary on
-   informations how to use the binary versions of the game,
-   precompiled binaries are available at the Pingus webpage.
+   GNU/Linux and INSTALL.Win32 for Windows.
 
    Information about the game, new versions and additional
    documentation can be found at the Pingus webpage:
@@ -57,5 +55,4 @@
 
     * http://savannah.nongnu.org/bugs/?group=pingus
 
----
-Last update  ... ir 2003-04-15
+# EOF #

Modified: trunk/pingus/TODO
===================================================================
--- trunk/pingus/TODO   2007-09-15 13:27:04 UTC (rev 3159)
+++ trunk/pingus/TODO   2007-09-15 15:22:32 UTC (rev 3160)
@@ -1,6 +1,12 @@
-Roadmap for Pingus 0.8.0
-~~~~~~~~~~~~~~~~~~~~~~~~
+Stuff to do at all times:
+~~~~~~~~~~~~~~~~~~~~~~~~~
 
+- grep for all the FIXME's and '#if 0' and find those that might be
+  important, add what you find to this TODO
+
+Roadmap for Pingus 0.8.0:
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
 - add VCR like effect for fast forward
 
 - add slow motion button (dead, turtle, pingu, rabbit)
@@ -35,7 +41,7 @@
 
 - rework the UI, either go glas-like or use the blackbord style 
 
-- Font::draw() origin only works properly for left, right and center break 
with multiline text
+- Font::draw() origin only works properly for left, right and center, breaks 
with multiline text
 
 - file parsing easily crashes or asserts on incorrect files
 
@@ -61,6 +67,10 @@
 
  * b) The big sign on the 'Tutorial Island' image
 
+- do we need z-pos for anything or does implicit object position serve
+  the same purpose? Problem: Groundpieces all have the same z-level,
+  the editor doesn't handle that and allows insertions inbetween
+
 Roadmap for Pingus 0.7.1
 ~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -71,14 +81,8 @@
 
 - miner remove graphics looks wrong (cmap instead of gfx?)
 
-- What happened with StartPos?!
+- separate gfx/colmap surfaces aren't used
 
-- do we need z-pos for anything or does implicit object position serve
-  the same purpose? Problem: Groundpieces all have the same z-level,
-  the editor doesn't handle that and allows insertions inbetween
-
-- object raising doesn't work for group
-
 - update ChangeLog
 
 - enable default fullscreen for release
@@ -87,75 +91,40 @@
 
 - document the mouse-trap, fullscreen, etc. shortcuts somewhere
 
-- some people like auto-scrolling in window mode, in 0.6.0 it worked
-  even when completly out of the window, in SDL the mouse coords don't
-  get updated when the mouse isn't in the window (need to switch from
-  event to polling?!)
+- level converter has a bug that causes some object types to be
+  ignored (startpos and likely the other more excotic worldobj things)
 
-- action-axis doesn't handle analog (do we even need this or could we do with 
axis-button?)
-
-- fix memory leaks in input/ (Controller doesn't clean up)
-
 - menu crashes when you click a little wildely
 
-- 404 image use
+- "core/misc/404sprite" isn't returned for missing graphics
 
 ### Loading font file: system://data/images/fonts/courier_small-iso-8859-9.font
 Font: datadir://images/fonts/courier_small-iso-8859-9.png
   Error: glyphs found: 188, expected 189
   Format: bpp: 32
 
-- remove SceneContext from Credits, replace with DrawingContext
+- bridging gets more complicated has graphical error (background?!)
+  surface background doesn't handle larger res due to the Playfield being 
offsetted
 
-Editor:
-=======
+- Liquids/water is 32, others are 64, this is causing trouble with the
+  collision map
 
-- keyboard shortcuts:
-  d      - duplicate
-  delete - delete object
-  insert - show/hide objectselector
-  cursor - pixel width moves
-  f      - flip
-  r      - rotate
+Less Important:
+===============
 
-- implement a minimap (just rects when surfaces are to tricky)
+- some people like auto-scrolling in window mode, in 0.6.0 it worked
+  even when completly out of the window, in SDL the mouse coords don't
+  get updated when the mouse isn't in the window (need to switch from
+  event to polling?!)
 
-- implement proper tmpfile Support (including backup use?)
+- action-axis doesn't handle analog (do we even need this or could we do with 
axis-button?)
 
-- ObjectSelector need to support more object types: Starbackground, 
SolidColorBackground
+- fix memory leaks in input/ (Controller doesn't clean up)
 
-- make combo box open to the top or bottom depending on variable
+- remove SceneContext from Credits, replace with DrawingContext
 
-- ObjectSelector scroll limit is missing, also doesn't display all objects
+- rapidly clicking the main menu buttons causes the game to crash
 
-- could/should rotate around object center
-
-- when drag&dropping objects, have them at center not top/left
-
-- fix align of exits
-
-- add icons to filedialog
-
-- add options to show/hide hidden files and filter stuff
-
-- write a color select widget (Hue, Saturation.Value)
-
-- bridging gets more complicated has graphical error (background?!)
-  surface background doesn't handle larger res due to the Playfield being 
offsetted
-
-Dialogs:
-
-Editor Properties:
-user name and email
-
-Nice to Have:
-=============
-
-- rapidly clicking the credits button causes the game to crash
-
-- grep for all the FIXME's and '#if 0' and find those that might be
-  important, add what you find to this TODO
-
 - jumper dies sometimes in data/levels/tutorial/snow11-grumbel.scm when 
hitting the ground
 
 - resource system needs a review
@@ -164,8 +133,6 @@
 
 - story graphics have a missing vertical line (due to age old gimp scaling bug)
 
-- separate gfx/colmap surfaces aren't used
-
 - CollisionMask can't handle RGBA images and likely shouldn't (due to
   them being animated and stuff like that), we however don't have
   seperate colmask for those images
@@ -173,9 +140,6 @@
 - convert all levels and check all classic levels for issues (run
   branches/pingus_sdl/contribl/levelconvert.sh from SVN toplevel dir)
 
-- Liquids/water is 32, others are 64, this is causing trouble with the
-  collision map
-
 - add drag&drop scrolling
 
 - nuke button is unclean, other buttons not so great either -> repaint
@@ -186,8 +150,61 @@
   (isn't used in tutorial island, since those levels don't have time)
   (have a blinking clock and tick sound or so)
 
-- "core/misc/404sprite" isn't returned for missing graphics
+
+Roadmap for Pingus Editor 0.7.1:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+Important:
+==========
+
+- ObjectSelector scroll limit is missing, also doesn't display all objects
+
+- ObjectSelector need to support more object types: Starbackground, 
SolidColorBackground
+
+- write ObjectSelectorSet: Collection of Objects for the selector
+  (thumbsize should be allowed to differ)
+
+- keyboard shortcuts need to be implemented (use input framework, but
+  how without support for keymaps?)
+
+  d       - duplicate
+  delete  - delete object
+  insert  - show/hide objectselector
+  cursor  - pixel width moves
+  f       - hflip
+  shift+f - vflip
+  r       - rotate90
+  shift+r - rotate270
+
+- implement a minimap (just rects when surfaces are to tricky)
+
+- implement proper tmpfile Support (save tmp levels to ~/.pingus/tmp/
+  for backup purpose in case of editor crash or so)
+
+- make combo box open to the top or bottom depending on variable
+
+- could/should rotate around object center
+
+- fix align of exits
+
+- add options to show/hide hidden files and filter stuff
+
+- add new level and save level dialogs
+
+- write a README.input
+
+Less Important:
+===============
+
+- write a color select widget (Hue, Saturation.Value)
+
+- object raising doesn't work for group
+
+- add icons to filedialog
+
+- Dialogs: Editor Properties: user name and email
+
+
 Older Stuff:
 ~~~~~~~~~~~~
 
@@ -325,5 +342,4 @@
 > ihn da wegzubekommen, muesste man ihn natuerlich sprengen (wie im
 > echten Leben *grins*).
 
-
 # EOF #

Modified: trunk/pingus/src/editor/level_objs.cpp
===================================================================
--- trunk/pingus/src/editor/level_objs.cpp      2007-09-15 13:27:04 UTC (rev 
3159)
+++ trunk/pingus/src/editor/level_objs.cpp      2007-09-15 15:22:32 UTC (rev 
3160)
@@ -93,18 +93,6 @@
 {
   if (!removed && attribs & (HAS_SURFACE | HAS_SURFACE_FAKE))
     {
-      // If selected, draw a highlighted box around it
-      if (selected)
-        {
-          Rect r((int)translated_pos.x, 
-                 (int)translated_pos.y, 
-                 (int)translated_pos.x + sprite.get_width(), 
-                 (int)translated_pos.y + sprite.get_height()); 
-
-          gc.draw_fillrect(r, Color(255,0,0,100), 5000);
-          gc.draw_rect(r, Color(255,0,0), 5000);
-        }
-
       if (attribs & HAS_WIDTH)
         {
           for(int x = int(pos.x); x < pos.x + width; x += sprite.get_width())
@@ -123,6 +111,18 @@
         {
           gc.draw(sprite, pos);
         }
+
+      // If selected, draw a highlighted box around it
+      if (selected)
+        {
+          Rect r((int)translated_pos.x, 
+                 (int)translated_pos.y, 
+                 (int)translated_pos.x + sprite.get_width(), 
+                 (int)translated_pos.y + sprite.get_height()); 
+
+          gc.draw_fillrect(r, Color(255,0,0,50));
+          gc.draw_rect(r, Color(255,0,0));
+        }
     }
 }
 

Modified: trunk/pingus/src/editor/object_selector_list.cpp
===================================================================
--- trunk/pingus/src/editor/object_selector_list.cpp    2007-09-15 13:27:04 UTC 
(rev 3159)
+++ trunk/pingus/src/editor/object_selector_list.cpp    2007-09-15 15:22:32 UTC 
(rev 3160)
@@ -141,7 +141,7 @@
   : RectComponent(rect_),
     editor(editor_),
     object_selector(object_selector_),
-    drawing_context(new DrawingContext(rect)),
+    drawing_context(new DrawingContext(rect, true)),
     offset(0),
     old_offset(0),
     mode(NOTHING),
@@ -157,49 +157,34 @@
 
   DrawingContext& gc = *drawing_context;
   gc.clear();
-
+  gc.fill_screen(Color(100, 100, 100));
   gc.push_modelview();
   gc.translate(0, offset);
 
   Objects::iterator i = objects.begin();
 
-  for(int y = 0; y < 20; ++y) // FIXME: This is incorrect
-    for(int x = 0; x < 5; ++x)
-      {
-        if (i != objects.end())
-          { // draw a item
-            if (has_mouse_over() && current_object != -1 && (i - 
objects.begin()) == current_object)
-              {
-                gc.draw_fillrect(x * 48,      y * 48, 
-                                 x * 48 + 48, y * 48 + 48, 
-                                 Color(150,150,150));
+  for(Objects::iterator i = objects.begin(); i != objects.end(); ++i)
+    {
+      int x = (i - objects.begin()) % 5;
+      int y = (i - objects.begin()) / 5;
 
+      gc.draw((*i)->thumbnail, Vector2i(x * 48, y * 48));
 
-                gc.draw_rect(x * 48,      y * 48, 
-                             x * 48 + 48, y * 48 + 48, 
-                             Color(255,255,255), 10000);
-              }
-            else
-              {
-                gc.draw_fillrect(x * 48,      y * 48, 
-                                 x * 48 + 48, y * 48 + 48, 
-                                 (((x-(y%2)) % 2) ? Color(0,0,0) : 
Color(100,100,100)));
-                
-                gc.draw_rect(x * 48,      y * 48, 
-                             x * 48 + 48, y * 48 + 48, 
-                             Color(155,155,155), 10000);
-              }
+      gc.draw_rect(x * 48,      y * 48, 
+                   x * 48 + 48, y * 48 + 48, 
+                   Color(155,155,155));
 
-            gc.draw((*i)->thumbnail, Vector2i(x * 48, y * 48));
-            ++i;
-          }
-        else
-          { // draw the quads for empty slots
-            gc.draw_fillrect(x * 48,      y * 48, 
-                             x * 48 + 48, y * 48 + 48, 
-                             (((x-(y%2)) % 2) ? Color(0,0,0) : 
Color(100,100,100)));
-          }
-      }
+      if (has_mouse_over() && current_object != -1 && (i - objects.begin()) == 
current_object)
+        {
+          gc.draw_fillrect(x * 48,      y * 48, 
+                           x * 48 + 48, y * 48 + 48, 
+                           Color(255,255,255, 100));
+
+          gc.draw_rect(x * 48,      y * 48, 
+                       x * 48 + 48, y * 48 + 48, 
+                       Color(255,255,255));
+        }
+    }
   
   gc.pop_modelview();
 
@@ -282,17 +267,24 @@
 
   mouse_pos = Vector2i(x - rect.left, y - rect.top);
 
+  int width = 5;
+  int height = (objects.size() / width) + ((objects.size() % width > 0) ? 1 : 
0);
+
   if (mode != OBJECT_DRAG)
     {
-      int obj_x = Math::clamp(0, mouse_pos.x / 48, 4);
-      int obj_y = Math::clamp(0, int(mouse_pos.y - offset) / 48, 200); // 
FIXME: 200 is placeholder
+      if (!objects.empty())
+        {
+          int obj_x = Math::clamp(0, mouse_pos.x / 48, width - 1);
+          int obj_y = Math::clamp(0, int(mouse_pos.y - offset) / 48, height-1);
 
-      current_object = Math::clamp(-1, (obj_y * 5) + obj_x, 
int(objects.size()-1));
+          current_object = Math::clamp(-1, (obj_y * 5) + obj_x, 
int(objects.size()-1));
+        }
     }
 
   if (mode == SCROLLING)
     {
       offset = old_offset + (y - drag_start.y);
+      offset = Math::clamp(Math::min(rect.get_height() - (height * 48.0f), 
0.0f), offset, 0.0f);
     }
 }
 
@@ -319,6 +311,7 @@
       objects.push_back(new Object(Resource::load_sprite(*i),
                                    Resource::load_thumb_sprite(*i)));
     }
+  offset = 0;
 }
 
 void
@@ -332,6 +325,7 @@
       //sprite.scale(48, 48);
       objects.push_back(new Groundpiece(*i, type));
     }
+  offset = 0;
 }
 
 void
@@ -375,6 +369,7 @@
       //sprite.scale(48, 48);
       objects.push_back(new Hotspot(*i));
     }
+  offset = 0;
 }
 
 void
@@ -388,6 +383,7 @@
       //sprite.scale(48, 48);
       objects.push_back(new SurfaceBackground(*i));
     }
+  offset = 0;
 }
 
 void
@@ -404,6 +400,7 @@
       if (*i != "entrances/generic")
         objects.push_back(new Hotspot(*i));
     }
+  offset = 0;
 }
 
 void
@@ -417,6 +414,7 @@
       //sprite.scale(48, 48);
       objects.push_back(new Exit(*i));
     }
+  offset = 0;
 }
 
 void





reply via email to

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