// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
#include <config.h>
-#include "background.h"
-#include "app/globals.h"
-#include "camera.h"
-#include "video/drawing_context.h"
-#include "lisp/lisp.h"
-#include "lisp/writer.h"
-#include "object_factory.h"
+#include "background.hpp"
+#include "camera.hpp"
+#include "video/drawing_context.hpp"
+#include "lisp/lisp.hpp"
+#include "lisp/writer.hpp"
+#include "object_factory.hpp"
+#include "resources.hpp"
+#include "main.hpp"
Background::Background()
: type(INVALID), layer(LAYER_BACKGROUND0), image(0)
}
void
-Background::action(float)
+Background::update(float)
{
}
this->speed = speed;
delete image;
- image = new Surface(datadir + "/images/background/" + name, false);
+ image = new Surface("images/background/" + name, false);
}
void
gradient_bottom = bottom;
delete image;
- image = new Surface(top, bottom, screen->w, screen->h);
+ image = new Surface(top, bottom, SCREEN_WIDTH, SCREEN_HEIGHT);
}
void
int sy = int(-context.get_translation().y * speed) % image->h - image->h;
context.push_transform();
context.set_translation(Vector(0, 0));
- for(int x = sx; x < screen->w; x += image->w)
- for(int y = sy; y < screen->h; y += image->h)
+ for(int x = sx; x < SCREEN_WIDTH; x += image->w)
+ for(int y = sy; y < SCREEN_HEIGHT; y += image->h)
context.draw_surface(image, Vector(x, y), layer);
context.pop_transform();
}