[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r2564 - trunk/src/editor
From: |
jave27 |
Subject: |
[Pingus-CVS] r2564 - trunk/src/editor |
Date: |
Tue, 27 Dec 2005 22:24:16 +0100 |
Author: jave27
Date: 2005-12-27 22:24:12 +0100 (Tue, 27 Dec 2005)
New Revision: 2564
Modified:
trunk/src/editor/editor_viewport.cxx
trunk/src/editor/editor_viewport.hxx
trunk/src/editor/level_objs.cxx
Log:
some editor cleanup
Modified: trunk/src/editor/editor_viewport.cxx
===================================================================
--- trunk/src/editor/editor_viewport.cxx 2005-12-27 20:50:43 UTC (rev
2563)
+++ trunk/src/editor/editor_viewport.cxx 2005-12-27 21:24:12 UTC (rev
2564)
@@ -37,7 +37,6 @@
state(CL_Display::get_width(), CL_Display::get_height()),
scene_context(new SceneContext()),
editor(e),
- bg_surface(0),
autoscroll(true)
{
// FIXME: Hardcoded values should be determined by level size
@@ -48,19 +47,17 @@
// Destructor
EditorViewport::~EditorViewport ()
{
- if (bg_surface) delete bg_surface;
}
// When someone right-clicks inside the viewport
void
EditorViewport::on_secondary_button_click(int x, int y)
{
- // FIXME: Hardcoded 15 & 25 should probably be dynamic
- std::cout << "Right-click at " << x - 15 - (state.get_width()/2 -
state.get_pos().x) << ", "
- << y - 25 - (state.get_height()/2 - state.get_pos().y) <<
std::endl;
+ std::cout << "Right-click at " << x - (state.get_width()/2 -
state.get_pos().x) << ", "
+ << y - (state.get_height()/2 - state.get_pos().y) << std::endl;
- LevelObj* obj = object_at(x - 15 - (state.get_width()/2 -
(int)state.get_pos().x),
- y - 25 - (state.get_height()/2 - (int)state.get_pos().y));
+ LevelObj* obj = object_at(x - (state.get_width()/2 -
(int)state.get_pos().x),
+ y - (state.get_height()/2 - (int)state.get_pos().y));
if (obj)
obj->on_primary_button_click(x, y);
}
@@ -74,11 +71,6 @@
// Now, draw all of the objects
- // FIXME: Should draw the background(s) over the whole viewport
(stretched or tiled)
- if (bg_surface)
- scene_context->color().draw(*bg_surface, Vector());
-
- // FIXME: This is obviously not correct, but it's just a proof of
concept now.
// Draw the level objects
std::vector<LevelObj*> objs = editor->get_level()->get_objects();
for (unsigned i = 0; i < objs.size(); i++)
Modified: trunk/src/editor/editor_viewport.hxx
===================================================================
--- trunk/src/editor/editor_viewport.hxx 2005-12-27 20:50:43 UTC (rev
2563)
+++ trunk/src/editor/editor_viewport.hxx 2005-12-27 21:24:12 UTC (rev
2564)
@@ -20,7 +20,6 @@
#ifndef HEADER_PINGUS_EDITOR_VIEWPORT_HXX
#define HEADER_PINGUS_EDITOR_VIEWPORT_HXX
-#include <ClanLib/Display/sprite.h>
#include "../gui/component.hxx"
#include "../graphic_context_state.hxx"
#include <vector>
@@ -83,9 +82,6 @@
/** Collection of objects inside the viewport (groundpieces, traps,
etc.) */
std::vector<std::string> objs;
- /** Background image - if null, will display dark gray background */
- CL_Surface* bg_surface;
-
/** Whether or not Autoscrolling is turned on */
bool autoscroll;
Modified: trunk/src/editor/level_objs.cxx
===================================================================
--- trunk/src/editor/level_objs.cxx 2005-12-27 20:50:43 UTC (rev 2563)
+++ trunk/src/editor/level_objs.cxx 2005-12-27 21:24:12 UTC (rev 2564)
@@ -100,7 +100,9 @@
UNUSED_ARG(y);
pos.x += 10;
// FIXME: Remove debugging stuff.
- std::cout << "New pos.x: " << pos.x << ", y: " << pos.y << std::endl;
+ std::cout << "New pos.x: " << pos.x << ", y: " << pos.y
+ << ", end spot: x: " << pos.x + sprite.get_width() << ", y: "
+ << pos.y + sprite.get_height() << std::endl;
}
void
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r2564 - trunk/src/editor,
jave27 <=