Mercurial > fife-parpg
changeset 666:3944096d12ce
* More updates to CHANGES
* Updated the shooter demo settings-dist.xml to disable lights
* Removed FIFE::CamreaZoneRenderer as it is not used
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Mon, 08 Nov 2010 18:06:05 +0000 |
parents | 0a798d5c241a |
children | a5809f60d548 |
files | CHANGES demos/shooter/settings-dist.xml engine/core/controller/engine.cpp engine/core/view/renderers/camerazonerenderer.cpp engine/core/view/renderers/camerazonerenderer.h |
diffstat | 5 files changed, 8 insertions(+), 211 deletions(-) [+] |
line wrap: on
line diff
--- a/CHANGES Mon Nov 08 16:52:13 2010 +0000 +++ b/CHANGES Mon Nov 08 18:06:05 2010 +0000 @@ -10,10 +10,13 @@ _\///_______________\///////////___\///_______________\///////////////__ ================================================================================ -== 0.3.2 (2010) == +== 0.3.2 (November 19th, 2010) == ================================================================================ === Engine === + * Removed the Camreazone renderer + * Added light support (OpenGL only) by merging the light branch. Speacial + thanks to Helios for all his hard work in this area (#364) * Added a percentage bar widget (#411) * Modified some size_t definitions to more appropriate ones (#152) * Instance rotation changes are reported to the instance change listeners
--- a/demos/shooter/settings-dist.xml Mon Nov 08 16:52:13 2010 +0000 +++ b/demos/shooter/settings-dist.xml Mon Nov 08 18:06:05 2010 +0000 @@ -13,11 +13,13 @@ <Setting name="Font" type="str"> fonts/FreeSans.ttf </Setting> <Setting name="FontGlyphs" strip="0" type="str"> abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-+/():;%&`'*#=[]\"</Setting> <Setting name="DefaultFontSize" type="int"> 16 </Setting> - <Setting name="LogModules" type="list"> controller ; audio ; vfs ; script ; loaders ; pool ; view ; video ; model ; metamodel ; event_channel ; xml </Setting> + <Setting name="LogModules" type="list"> controller ; video </Setting> <Setting name="PychanDebug" type="bool"> False </Setting> <Setting name="LogToPrompt" type="int"> 1 </Setting> + <Setting name="UsePsyco" type="bool"> False </Setting> + <Setting name="ProfilingOn" type="bool"> False </Setting> <Setting name="LogToFile" type="int"> 0 </Setting> - <Setting name="Lighting" type="int"> 0 </Setting> + <Setting name="Lighting" type="int"> 0 </Setting> </Module> <Module name="shooter"> <Setting name="MaxSounds" type="int">100</Setting>
--- a/engine/core/controller/engine.cpp Mon Nov 08 16:52:13 2010 +0000 +++ b/engine/core/controller/engine.cpp Mon Nov 08 18:06:05 2010 +0000 @@ -66,7 +66,6 @@ #include "pathfinder/routepather/routepather.h" #include "model/metamodel/grids/hexgrid.h" #include "model/metamodel/grids/squaregrid.h" -#include "view/renderers/camerazonerenderer.h" #include "view/renderers/quadtreerenderer.h" #include "view/renderers/gridrenderer.h" #include "view/renderers/instancerenderer.h" @@ -287,7 +286,6 @@ m_soundmanager->setVolume(static_cast<float>(m_settings.getInitialVolume()) / 10); FL_LOG(_log, "Creating renderers"); - m_renderers.push_back(new CameraZoneRenderer(m_renderbackend, 0, m_imagepool)); m_renderers.push_back(new InstanceRenderer(m_renderbackend, 10, m_imagepool, m_animpool)); m_renderers.push_back(new GridRenderer(m_renderbackend, 20)); m_renderers.push_back(new CellSelectionRenderer(m_renderbackend, 30));
--- a/engine/core/view/renderers/camerazonerenderer.cpp Mon Nov 08 16:52:13 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,137 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005-2008 by the FIFE team * - * http://www.fifengine.de * - * This file is part of FIFE. * - * * - * FIFE is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - ***************************************************************************/ - -// Standard C++ library includes - -// 3rd party library includes - -// FIFE includes -// These includes are split up in two parts, separated by one empty line -// First block: files included from the FIFE root src directory -// Second block: files included from the same folder -#include "video/renderbackend.h" -#include "video/image.h" -#include "util/math/fife_math.h" -#include "util/log/logger.h" -#include "model/metamodel/grids/cellgrid.h" -#include "model/structures/instance.h" -#include "model/structures/layer.h" -#include "model/structures/location.h" - -#include "view/camera.h" -#include "camerazonerenderer.h" - - - -namespace FIFE { - static Logger _log(LM_VIEWVIEW); - - CameraZoneRenderer::CameraZoneRenderer(RenderBackend* renderbackend, int position, ImagePool* imagepool): - RendererBase(renderbackend, position), - m_imagepool(imagepool), - m_zone_image(NULL) { - setEnabled(false); - } - - CameraZoneRenderer::CameraZoneRenderer(const CameraZoneRenderer& old): - RendererBase(old), - m_imagepool(old.m_imagepool), - m_zone_image(NULL) { - setEnabled(false); - } - - RendererBase* CameraZoneRenderer::clone() { - return new CameraZoneRenderer(*this); - } - - CameraZoneRenderer::~CameraZoneRenderer() { - delete m_zone_image; - } - - - - void CameraZoneRenderer::render(Camera* cam, Layer* layer, RenderList& instances) { - CellGrid* cg = layer->getCellGrid(); - if (!cg) { - FL_WARN(_log, "No cellgrid assigned to layer, cannot draw camera zones"); - return; - } - // draw this layer's grid as the camera sees it - Rect rect = cam->getViewPort(); - if (!m_zone_image) { - // build zone image - int dataSize = rect.w * rect.h; - - // initally all pixels are transparent - uint32_t* data = new uint32_t[dataSize]; - uint32_t* end = data + dataSize; - - #if SDL_BYTEORDER == SDL_BIG_ENDIAN - uint32_t empty_pixel = 0;//0xff << 24; - uint32_t edge_pixel = 0xff << 16 | 0xff << 24; - #else - uint32_t empty_pixel = 0;//0xff; - uint32_t edge_pixel = 0xff << 8 | 0xff; - #endif - - std::fill(data, end, empty_pixel); - - // go from screen coords to grid coords (layer coords) - // Search through pixel space, drawing pixels at boundaries - ModelCoordinate prevLayerCoord; - for (int y = 0; y < rect.h; y++) { - for (int x = 0; x < rect.w; x++) { - ExactModelCoordinate mapCoord = cam->toMapCoordinates(ScreenPoint(x, y)); - ModelCoordinate layerCoord = cg->toLayerCoordinates(mapCoord); - - if (prevLayerCoord != layerCoord) { - data[x + rect.w * y] = edge_pixel; - } - prevLayerCoord = layerCoord; - } - } - - - for (int x = 0; x < rect.w; x++) { - for (int y = 0; y < rect.h; y++) { - ExactModelCoordinate mapCoord = cam->toMapCoordinates(ScreenPoint(x, y)); - ModelCoordinate layerCoord = cg->toLayerCoordinates(mapCoord); - - if (prevLayerCoord != layerCoord) { - data[x + rect.w * y] = edge_pixel; - } - prevLayerCoord = layerCoord; - } - } - - m_zone_image = m_renderbackend->createImage((uint8_t*) data, rect.w, rect.h); - delete data; - } - m_zone_image->render(rect); - } - - void CameraZoneRenderer::setEnabled(bool enabled) { - if (!enabled) { - delete m_zone_image; - m_zone_image = NULL; - } - } -}
--- a/engine/core/view/renderers/camerazonerenderer.h Mon Nov 08 16:52:13 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005-2008 by the FIFE team * - * http://www.fifengine.de * - * This file is part of FIFE. * - * * - * FIFE is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - ***************************************************************************/ - -#ifndef FIFE_CAMERAZONERENDERER_H -#define FIFE_CAMERAZONERENDERER_H - -// Standard C++ library includes - -// 3rd party library includes - -// FIFE includes -// These includes are split up in two parts, separated by one empty line -// First block: files included from the FIFE root src directory -// Second block: files included from the same folder -#include "view/rendererbase.h" - -namespace FIFE { - class RenderBackend; - class ImagePool; - - class CameraZoneRenderer: public RendererBase { - public: - /** constructor. - * @param renderbackend to use - * @param position position for this renderer in rendering pipeline - * @param imagepool image pool where from fetch images - */ - CameraZoneRenderer(RenderBackend* renderbackend, int position, ImagePool* imagepool); - - CameraZoneRenderer(const CameraZoneRenderer& old); - - RendererBase* clone(); - - /** Destructor. - */ - virtual ~CameraZoneRenderer(); - - void render(Camera* cam, Layer* layer, RenderList& instances); - - std::string getName() { return "CameraZoneRenderer"; } - - void setEnabled(bool enabled); - - private: - ImagePool* m_imagepool; - Image* m_zone_image; - }; - -} - -#endif