Removed IrrlichtWrapper
authorPerttu Ahola <celeron55@gmail.com>
Fri, 22 Apr 2011 06:54:05 +0000 (09:54 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Fri, 22 Apr 2011 06:54:05 +0000 (09:54 +0300)
13 files changed:
src/CMakeLists.txt
src/iirrlichtwrapper.h [deleted file]
src/inventory.cpp
src/inventory.h
src/irrlichtwrapper.cpp [deleted file]
src/irrlichtwrapper.h [deleted file]
src/main.cpp
src/main.h
src/mapblock.cpp
src/mapblockobject.cpp
src/mapnode.h
src/utility.cpp
src/utility.h

index 1f7ad2200886d0448ad1df4f4cd35a1cb02b131b..aea98e19d0790d1b225efa55d79e5f7f7453beb0 100644 (file)
@@ -88,7 +88,6 @@ set(minetest_SRCS
        guiTextInputMenu.cpp
        guiInventoryMenu.cpp
        guiPauseMenu.cpp
-       irrlichtwrapper.cpp
        client.cpp
        tile.cpp
        main.cpp
diff --git a/src/iirrlichtwrapper.h b/src/iirrlichtwrapper.h
deleted file mode 100644 (file)
index 66f8a55..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-Minetest-c55
-Copyright (C) 2010 celeron55, Perttu Ahola <celeron55@gmail.com>
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program 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 General Public License for more details.
-
-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.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
-
-#ifndef IIRRLICHTWRAPPER_HEADER
-#define IIRRLICHTWRAPPER_HEADER
-
-#include "common_irrlicht.h"
-#include "texture.h"
-
-/*
-       NOTE: This is deprecated and should be removed completely
-*/
-
-/*
-       IrrlichtWrapper prototype.
-
-       Server supplies this as a dummy wrapper.
-*/
-
-class IIrrlichtWrapper
-{
-public:
-       IIrrlichtWrapper()
-       {
-       }
-       virtual ~IIrrlichtWrapper()
-       {
-       }
-       
-       // Should be called only from the main thread
-       virtual IrrlichtDevice* getDevice(){ return NULL; }
-       
-       virtual u32 getTime()
-       {
-               return 0;
-       }
-       
-       /*virtual textureid_t getTextureId(const std::string &name){ return 0; }
-       virtual std::string getTextureName(textureid_t id){ return ""; }
-       virtual video::ITexture* getTexture(const std::string &name){ return NULL; }
-       virtual video::ITexture* getTexture(const TextureSpec &spec){ return NULL; }*/
-       
-private:
-};
-
-#endif
-
index 289b5bb2b7dde6fce40a681aaed41ca655b55381..f91e2e0b6cd6e433e784d7b1b5ad0a18d757e135 100644 (file)
@@ -160,7 +160,6 @@ video::ITexture * CraftItem::getImage()
                name = "cloud.png";
        
        // Get such a texture
-       //return g_irrlicht->getTexture(name);
        return g_texturesource->getTextureRaw(name);
 }
 #endif
index f162952d32f19320c6edb16f886066648f09f7c6..07d81a3f7eecb77c8575616bd87a763d447357f4 100644 (file)
@@ -390,11 +390,6 @@ public:
                os<<basename<<"^[progressbar"<<value_f;
 
                return g_texturesource->getTextureRaw(os.str());
-
-               /*TextureSpec spec;
-               spec.addTid(g_irrlicht->getTextureId(basename));
-               spec.addTid(g_irrlicht->getTextureId(os.str()));
-               return g_irrlicht->getTexture(spec);*/
        }
 #endif
        std::string getText()
diff --git a/src/irrlichtwrapper.cpp b/src/irrlichtwrapper.cpp
deleted file mode 100644 (file)
index 4a1f2c4..0000000
+++ /dev/null
@@ -1,452 +0,0 @@
-#include "irrlichtwrapper.h"
-#include "constants.h"
-#include "string.h"
-#include "strfnd.h"
-
-IrrlichtWrapper::IrrlichtWrapper(IrrlichtDevice *device)
-{
-       m_running = true;
-       m_main_thread = get_current_thread_id();
-       m_device_mutex.Init();
-       m_device = device;
-}
-
-IrrlichtWrapper::~IrrlichtWrapper()
-{
-#if 0
-       // Clear image cache
-       for(core::map<std::string, video::IImage*>::Iterator
-                       i = m_imagecache.getIterator();
-                       i.atEnd() == false; i++)
-       {
-               i.getNode()->getValue()->drop();
-       }
-#endif
-}
-
-void IrrlichtWrapper::Run()
-{
-#if 0
-       /*
-               Fetch textures
-       */
-       if(m_get_texture_queue.size() > 0)
-       {
-               GetRequest<TextureSpec, video::ITexture*, u8, u8>
-                               request = m_get_texture_queue.pop();
-
-               dstream<<"got texture request with"
-                               <<" key.tids[0]="<<request.key.tids[0]
-                               <<" [1]="<<request.key.tids[1]
-                               <<std::endl;
-
-               GetResult<TextureSpec, video::ITexture*, u8, u8>
-                               result;
-               result.key = request.key;
-               result.callers = request.callers;
-               result.item = getTextureDirect(request.key);
-
-               request.dest->push_back(result);
-       }
-#endif
-}
-
-void IrrlichtWrapper::Shutdown(bool shutdown)
-{
-       m_running = !shutdown;
-}
-
-IrrlichtDevice* IrrlichtWrapper::getDevice()
-{
-       if(get_current_thread_id() != m_main_thread)
-       {
-               dstream<<"WARNING: IrrlichtWrapper::getDevice() called "
-                               "not from main thread"<<std::endl;
-               return NULL;
-       }
-       return m_device;
-}
-
-#if 0
-textureid_t IrrlichtWrapper::getTextureId(const std::string &name)
-{
-       u32 id = m_namecache.getId(name);
-       return id;
-}
-
-std::string IrrlichtWrapper::getTextureName(textureid_t id)
-{
-       std::string name("");
-       m_namecache.getValue(id, name);
-       // In case it was found, return the name; otherwise return an empty name.
-       return name;
-}
-
-video::ITexture* IrrlichtWrapper::getTexture(const std::string &filename)
-{
-       TextureSpec spec(getTextureId(filename));
-       return getTexture(spec);
-}
-
-video::ITexture* IrrlichtWrapper::getTexture(const TextureSpec &spec)
-{
-       if(spec.empty())
-               return NULL;
-       
-       video::ITexture *t = m_texturecache.get(spec);
-       if(t != NULL)
-               return t;
-       
-       if(get_current_thread_id() == m_main_thread)
-       {
-               dstream<<"Getting texture directly: spec.tids[0]="
-                               <<spec.tids[0]<<std::endl;
-                               
-               t = getTextureDirect(spec);
-       }
-       else
-       {
-               // If irrlicht has shut down, just return NULL
-               if(m_running == false)
-                       return NULL;
-
-               // We're gonna ask the result to be put into here
-               ResultQueue<TextureSpec, video::ITexture*, u8, u8> result_queue;
-               
-               // Throw a request in
-               m_get_texture_queue.add(spec, 0, 0, &result_queue);
-               
-               dstream<<"Waiting for texture from main thread: spec.tids[0]="
-                               <<spec.tids[0]<<std::endl;
-               
-               try
-               {
-                       // Wait result for a second
-                       GetResult<TextureSpec, video::ITexture*, u8, u8>
-                                       result = result_queue.pop_front(1000);
-               
-                       // Check that at least something worked OK
-                       assert(result.key == spec);
-
-                       t = result.item;
-               }
-               catch(ItemNotFoundException &e)
-               {
-                       dstream<<"Waiting for texture timed out."<<std::endl;
-                       t = NULL;
-               }
-       }
-
-       // Add to cache and return
-       m_texturecache.set(spec, t);
-       return t;
-}
-
-// Draw a progress bar on the image
-void make_progressbar(float value, video::IImage *image);
-
-/*
-       Texture fetcher/maker function, called always from the main thread
-*/
-
-video::ITexture* IrrlichtWrapper::getTextureDirect(const TextureSpec &spec)
-{
-       // This would result in NULL image
-       if(spec.empty())
-               return NULL;
-       
-       // Don't generate existing stuff
-       video::ITexture *t = m_texturecache.get(spec);
-       if(t != NULL)
-       {
-               dstream<<"WARNING: Existing stuff requested from "
-                               "getTextureDirect()"<<std::endl;
-               return t;
-       }
-       
-       video::IVideoDriver* driver = m_device->getVideoDriver();
-
-       /*
-               An image will be built from files and then converted into a texture.
-       */
-       video::IImage *baseimg = NULL;
-
-       /*
-               Irrlicht requires a name for every texture, with which it
-               will be stored internally in irrlicht.
-       */
-       std::string texture_name;
-
-       for(u32 i=0; i<TEXTURE_SPEC_TEXTURE_COUNT; i++)
-       {
-               textureid_t tid = spec.tids[i];
-               if(tid == 0)
-                       continue;
-
-               std::string name = getTextureName(tid);
-               
-               // Add something to the name so that it is a unique identifier.
-               texture_name += "[";
-               texture_name += name;
-               texture_name += "]";
-               
-               /*
-                       Try to get image from image cache
-               */
-               {
-                       core::map<std::string, video::IImage*>::Node *n;
-                       n = m_imagecache.find(texture_name);
-                       if(n != NULL)
-                       {
-                               video::IImage *image = n->getValue();
-
-                               core::dimension2d<u32> dim = image->getDimension();
-                               baseimg = driver->createImage(video::ECF_A8R8G8B8, dim);
-                               image->copyTo(baseimg);
-
-                               dstream<<"INFO: getTextureDirect(): Loaded \""
-                                               <<texture_name<<"\" from image cache"
-                                               <<std::endl;
-                               
-                               // Do not process any further.
-                               continue;
-                       }
-               }
-
-               // Stuff starting with [ are special commands
-               if(name[0] != '[')
-               {
-                       // A normal texture; load it from a file
-                       std::string path = porting::getDataPath(name.c_str());
-                       dstream<<"INFO: getTextureDirect(): Loading path \""<<path
-                                       <<"\""<<std::endl;
-                       
-                       // DEBUG
-                       /*{
-                               dstream<<"DEBUG CODE: Loading base image "
-                                               "directly to texture"<<std::endl;
-                               t = driver->getTexture(path.c_str());
-                               driver->renameTexture(t, texture_name.c_str());
-                               return t;
-                       }*/
-                       
-                       video::IImage *image = driver->createImageFromFile(path.c_str());
-
-                       if(image == NULL)
-                       {
-                               dstream<<"WARNING: Could not load image \""<<name
-                                               <<"\" from path \""<<path<<"\""
-                                               <<" while building texture"<<std::endl;
-                               continue;
-                       }
-
-                       // If base image is NULL, load as base.
-                       if(baseimg == NULL)
-                       {
-                               dstream<<"INFO: Setting "<<name<<" as base"<<std::endl;
-                               /*
-                                       Copy it this way to get an alpha channel.
-                                       Otherwise images with alpha cannot be blitted on 
-                                       images that don't have alpha in the original file.
-                               */
-                               // This is a deprecated method
-                               //baseimg = driver->createImage(video::ECF_A8R8G8B8, image);
-                               core::dimension2d<u32> dim = image->getDimension();
-                               baseimg = driver->createImage(video::ECF_A8R8G8B8, dim);
-                               image->copyTo(baseimg);
-                               image->drop();
-                               //baseimg = image;
-                       }
-                       // Else blit on base.
-                       else
-                       {
-                               dstream<<"INFO: Blitting "<<name<<" on base"<<std::endl;
-                               // Size of the copied area
-                               core::dimension2d<u32> dim = image->getDimension();
-                               //core::dimension2d<u32> dim(16,16);
-                               // Position to copy the blitted to in the base image
-                               core::position2d<s32> pos_to(0,0);
-                               // Position to copy the blitted from in the blitted image
-                               core::position2d<s32> pos_from(0,0);
-                               // Blit
-                               image->copyToWithAlpha(baseimg, pos_to,
-                                               core::rect<s32>(pos_from, dim),
-                                               video::SColor(255,255,255,255),
-                                               NULL);
-                               // Drop image
-                               image->drop();
-                       }
-               }
-               else
-               {
-                       // A special texture modification
-                       dstream<<"INFO: getTextureDirect(): generating \""<<name<<"\""
-                                       <<std::endl;
-                       if(name.substr(0,6) == "[crack")
-                       {
-                               u16 progression = stoi(name.substr(6));
-                               // Size of the base image
-                               core::dimension2d<u32> dim_base = baseimg->getDimension();
-                               // Crack will be drawn at this size
-                               u32 cracksize = 16;
-                               // Size of the crack image
-                               core::dimension2d<u32> dim_crack(cracksize,cracksize);
-                               // Position to copy the crack from in the crack image
-                               core::position2d<s32> pos_other(0, 16 * progression);
-
-                               video::IImage *crackimage = driver->createImageFromFile(
-                                               porting::getDataPath("crack.png").c_str());
-                       
-                               if(crackimage)
-                               {
-                                       /*crackimage->copyToWithAlpha(baseimg, v2s32(0,0),
-                                                       core::rect<s32>(pos_other, dim_base),
-                                                       video::SColor(255,255,255,255),
-                                                       NULL);*/
-
-                                       for(u32 y0=0; y0<dim_base.Height/dim_crack.Height; y0++)
-                                       for(u32 x0=0; x0<dim_base.Width/dim_crack.Width; x0++)
-                                       {
-                                               // Position to copy the crack to in the base image
-                                               core::position2d<s32> pos_base(x0*cracksize, y0*cracksize);
-                                               crackimage->copyToWithAlpha(baseimg, pos_base,
-                                                               core::rect<s32>(pos_other, dim_crack),
-                                                               video::SColor(255,255,255,255),
-                                                               NULL);
-                                       }
-
-                                       crackimage->drop();
-                               }
-                       }
-                       else if(name.substr(0,8) == "[combine")
-                       {
-                               // "[combine:16x128:0,0=stone.png:0,16=grass.png"
-                               Strfnd sf(name);
-                               sf.next(":");
-                               u32 w0 = stoi(sf.next("x"));
-                               u32 h0 = stoi(sf.next(":"));
-                               dstream<<"INFO: combined w="<<w0<<" h="<<h0<<std::endl;
-                               core::dimension2d<u32> dim(w0,h0);
-                               baseimg = driver->createImage(video::ECF_A8R8G8B8, dim);
-                               while(sf.atend() == false)
-                               {
-                                       u32 x = stoi(sf.next(","));
-                                       u32 y = stoi(sf.next("="));
-                                       std::string filename = sf.next(":");
-                                       dstream<<"INFO: Adding \""<<filename
-                                                       <<"\" to combined ("<<x<<","<<y<<")"
-                                                       <<std::endl;
-                                       video::IImage *img = driver->createImageFromFile(
-                                                       porting::getDataPath(filename.c_str()).c_str());
-                                       if(img)
-                                       {
-                                               core::dimension2d<u32> dim = img->getDimension();
-                                               dstream<<"INFO: Size "<<dim.Width
-                                                               <<"x"<<dim.Height<<std::endl;
-                                               core::position2d<s32> pos_base(x, y);
-                                               video::IImage *img2 =
-                                                               driver->createImage(video::ECF_A8R8G8B8, dim);
-                                               img->copyTo(img2);
-                                               img->drop();
-                                               img2->copyToWithAlpha(baseimg, pos_base,
-                                                               core::rect<s32>(v2s32(0,0), dim),
-                                                               video::SColor(255,255,255,255),
-                                                               NULL);
-                                               img2->drop();
-                                       }
-                                       else
-                                       {
-                                               dstream<<"WARNING: img==NULL"<<std::endl;
-                                       }
-                               }
-                       }
-                       else if(name.substr(0,12) == "[progressbar")
-                       {
-                               float value = stof(name.substr(12));
-                               make_progressbar(value, baseimg);
-                       }
-                       else
-                       {
-                               dstream<<"WARNING: getTextureDirect(): Invalid "
-                                               " texture: \""<<name<<"\""<<std::endl;
-                       }
-               }
-               
-               /*
-                       Add to image cache
-               */
-               if(baseimg != NULL)
-               {
-                       core::map<std::string, video::IImage*>::Node *n;
-                       n = m_imagecache.find(texture_name);
-                       if(n != NULL)
-                       {
-                               video::IImage *img = n->getValue();
-                               if(img != baseimg)
-                               {
-                                       img->drop();
-                               }
-                       }
-                       
-                       m_imagecache[texture_name] = baseimg;
-               }
-       }
-
-       // If no resulting image, return NULL
-       if(baseimg == NULL)
-       {
-               dstream<<"WARNING: getTextureDirect(): baseimg is NULL (attempted to"
-                               " create texture \""<<texture_name<<"\""<<std::endl;
-               return NULL;
-       }
-       
-       /*// DEBUG: Paint some pixels
-       video::SColor c(255,255,0,0);
-       baseimg->setPixel(1,1, c);
-       baseimg->setPixel(1,14, c);
-       baseimg->setPixel(14,1, c);
-       baseimg->setPixel(14,14, c);*/
-
-       // Create texture from resulting image
-       t = driver->addTexture(texture_name.c_str(), baseimg);
-
-       dstream<<"INFO: getTextureDirect(): created texture \""<<texture_name
-                       <<"\""<<std::endl;
-
-       return t;
-
-}
-
-void make_progressbar(float value, video::IImage *image)
-{
-       if(image == NULL)
-               return;
-       
-       core::dimension2d<u32> size = image->getDimension();
-
-       u32 barheight = 1;
-       u32 barpad_x = 1;
-       u32 barpad_y = 1;
-       u32 barwidth = size.Width - barpad_x*2;
-       v2u32 barpos(barpad_x, size.Height - barheight - barpad_y);
-
-       u32 barvalue_i = (u32)(((float)barwidth * value) + 0.5);
-
-       video::SColor active(255,255,0,0);
-       video::SColor inactive(255,0,0,0);
-       for(u32 x0=0; x0<barwidth; x0++)
-       {
-               video::SColor *c;
-               if(x0 < barvalue_i)
-                       c = &active;
-               else
-                       c = &inactive;
-               u32 x = x0 + barpos.X;
-               for(u32 y=barpos.Y; y<barpos.Y+barheight; y++)
-               {
-                       image->setPixel(x,y, *c);
-               }
-       }
-}
-#endif
-
diff --git a/src/irrlichtwrapper.h b/src/irrlichtwrapper.h
deleted file mode 100644 (file)
index 55e021b..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
-Minetest-c55
-Copyright (C) 2010 celeron55, Perttu Ahola <celeron55@gmail.com>
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program 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 General Public License for more details.
-
-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.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
-
-#ifndef IRRLICHTWRAPPER_HEADER
-#define IRRLICHTWRAPPER_HEADER
-
-#include "threads.h"
-#include "common_irrlicht.h"
-#include "debug.h"
-#include "utility.h"
-#include "texture.h"
-#include "iirrlichtwrapper.h"
-
-#include <jmutex.h>
-#include <jmutexautolock.h>
-#include <string>
-
-/*
-       NOTE: This is deprecated and should be removed completely
-*/
-
-/*
-       A thread-safe texture pointer cache.
-       
-       This is used so that irrlicht doesn't get called from many
-       threads, because texture pointers have to be handled in
-       background threads.
-*/
-
-#if 0
-/*
-       A thread-safe texture pointer cache
-*/
-class TextureCache
-{
-public:
-       TextureCache()
-       {
-               m_mutex.Init();
-               assert(m_mutex.IsInitialized());
-       }
-       
-       void set(const TextureSpec &spec, video::ITexture *texture)
-       {
-               if(texture == NULL)
-                       return;
-               
-               JMutexAutoLock lock(m_mutex);
-
-               m_textures[spec] = texture;
-       }
-       
-       video::ITexture* get(const TextureSpec &spec)
-       {
-               JMutexAutoLock lock(m_mutex);
-
-               core::map<TextureSpec, video::ITexture*>::Node *n;
-               n = m_textures.find(spec);
-
-               if(n != NULL)
-                       return n->getValue();
-
-               return NULL;
-       }
-
-private:
-       core::map<TextureSpec, video::ITexture*> m_textures;
-       JMutex m_mutex;
-};
-#endif
-
-/*
-       A thread-safe wrapper for irrlicht, to be accessed from
-       background worker threads.
-
-       Queues tasks to be done in the main thread.
-
-       Also caches texture specification strings to ids and textures.
-
-       TODO: Remove this and move all texture functionality to TextureSource
-*/
-
-class IrrlichtWrapper : public IIrrlichtWrapper
-{
-public:
-       /*
-               These are called from the main thread
-       */
-
-       IrrlichtWrapper(IrrlichtDevice *device);
-
-       ~IrrlichtWrapper();
-       
-       // Run queued tasks
-       void Run();
-
-       // Shutdown wrapper; this disables queued texture fetching
-       void Shutdown(bool shutdown);
-
-       IrrlichtDevice* getDevice();
-       
-       /*
-               These are called from other threads
-       */
-
-       // Not exactly thread-safe but this needs to be fast.
-       // getTimer()->getRealTime() only reads one variable anyway.
-       u32 getTime()
-       {
-               return m_device->getTimer()->getRealTime();
-       }
-
-#if 0
-       /*
-               Format of a texture name:
-                       "stone.png" (filename in image data directory)
-                       "[crack1" (a name starting with "[" is a special feature)
-                       "[progress1.0" (a name starting with "[" is a special feature)
-       */
-       /*
-               Loads texture defined by "name" and assigns a texture id to it.
-               If texture has to be generated, generates it.
-               If the texture has already been loaded, returns existing id.
-       */
-       textureid_t getTextureId(const std::string &name);
-       // The reverse of the above
-       std::string getTextureName(textureid_t id);
-       // Gets a texture based on a filename
-       video::ITexture* getTexture(const std::string &filename);
-       // Gets a texture based on a TextureSpec (a textureid_t is fine too)
-       video::ITexture* getTexture(const TextureSpec &spec);
-#endif
-       
-private:
-       /*
-               Non-thread-safe variants of stuff, for internal use
-       */
-
-       // Constructs a texture according to spec
-       //video::ITexture* getTextureDirect(const TextureSpec &spec);
-       
-       /*
-               Members
-       */
-
-       bool m_running;
-       
-       // The id of the thread that can (and has to) use irrlicht directly
-       threadid_t m_main_thread;
-       
-       // The irrlicht device
-       JMutex m_device_mutex;
-       IrrlichtDevice *m_device;
-       
-#if 0
-       // Queued texture fetches (to be processed by the main thread)
-       RequestQueue<TextureSpec, video::ITexture*, u8, u8> m_get_texture_queue;
-
-       // Cache of textures by spec
-       TextureCache m_texturecache;
-
-       // Cached or generated source images by texture name
-       core::map<std::string, video::IImage*> m_imagecache;
-
-       // A mapping from texture id to string spec
-       MutexedIdGenerator<std::string> m_namecache;
-#endif
-};
-
-#endif
-
index 436e5babc9557cfdf908adefc14a1b0c6a392ccf..6293809be0d4b69fbb0e1c9da0412bfb59b266d0 100644 (file)
@@ -136,6 +136,9 @@ Game content:
   - The player would have some of that stuff at the beginning, and\r
     would need new supplies of it when it runs out\r
 \r
+- A bomb\r
+- A spread-items-on-map routine for the bomb, and for dying players\r
+\r
 Documentation:\r
 --------------\r
 \r
@@ -175,14 +178,14 @@ SUGG: Draw cubes in inventory directly with 3D drawing commands, so that
 \r
 SUGG: Option for enabling proper alpha channel for textures\r
 \r
+TODO: Make all water not backside culled\r
+\r
 Configuration:\r
 --------------\r
 \r
 Client:\r
 -------\r
 \r
-TODO: Remove IrrlichtWrapper\r
-\r
 TODO: Untie client network operations from framerate\r
       - Needs some input queues or something\r
          - This won't give much performance boost because calculating block\r
@@ -195,6 +198,10 @@ TODO: Don't update all meshes always on single node changes, but
          - implement Map::updateNodeMeshes() and the usage of it\r
          - It will give almost always a 4x boost in mesh update performance.\r
 \r
+- A weapon engine\r
+\r
+- Tool/weapon visualization\r
+\r
 Server:\r
 -------\r
 \r
@@ -209,9 +216,6 @@ FIXME: Server sometimes goes into some infinite PeerNotFoundException loop
 * Make a small history check to transformLiquids to detect and log\r
   continuous oscillations, in such detail that they can be fixed.\r
 \r
-FIXME: If something is removed from craftresult with a right click,\r
-       it is only possible to get one item from it should give 4\r
-\r
 Objects:\r
 --------\r
 \r
@@ -241,17 +245,18 @@ SUGG: Erosion simulation at map generation time
        - Simulate rock falling from cliffs when water has removed\r
          enough solid rock from the bottom\r
 \r
+SUGG: Try out the notch way of generating maps, that is, make bunches\r
+      of low-res 3d noise and interpolate linearly.\r
+\r
 Mapgen v2:\r
-* only_from_disk might not work anymore - check and fix it.\r
-* Make the generator to run in background and not blocking block\r
-  placement and transfer\r
 * Possibly add some kind of erosion and other stuff\r
 * Better water generation (spread it to underwater caverns but don't\r
   fill dungeons that don't touch big water masses)\r
 * When generating a chunk and the neighboring chunk doesn't have mud\r
   and stuff yet and the ground is fairly flat, the mud will flow to\r
   the other chunk making nasty straight walls when the other chunk\r
-  is generated. Fix it.\r
+  is generated. Fix it. Maybe just a special case if the ground is\r
+  flat?\r
 \r
 Misc. stuff:\r
 ------------\r
@@ -321,7 +326,6 @@ Making it more portable:
 #include "constants.h"\r
 //#include "strfnd.h"\r
 #include "porting.h"\r
-#include "irrlichtwrapper.h"\r
 #include "gettime.h"\r
 #include "porting.h"\r
 #include "guiPauseMenu.h"\r
@@ -337,9 +341,6 @@ Making it more portable:
 #include "tile.h"\r
 #include "guiFurnaceMenu.h"\r
 \r
-// TODO: Remove this\r
-IrrlichtWrapper *g_irrlicht = NULL;\r
-\r
 // This makes textures\r
 ITextureSource *g_texturesource = NULL;\r
 \r
@@ -495,9 +496,9 @@ u32 getTimeMs()
                Use irrlicht because it is more precise than porting.h's\r
                getTimeMs()\r
        */\r
-       if(g_irrlicht == NULL)\r
+       if(g_device == NULL)\r
                return 0;\r
-       return g_irrlicht->getTime();\r
+       return g_device->getTimer()->getRealTime();\r
 }\r
 \r
 /*\r
@@ -2049,7 +2050,6 @@ int main(int argc, char *argv[])
                return 1; // could not create selected driver.\r
        \r
        g_device = device;\r
-       g_irrlicht = new IrrlichtWrapper(device);\r
        TextureSource *texturesource = new TextureSource(device);\r
        g_texturesource = texturesource;\r
 \r
@@ -2217,9 +2217,6 @@ int main(int argc, char *argv[])
 \r
                while(g_device->run() && kill == false)\r
                {\r
-                       // Run global IrrlichtWrapper's main thread processing stuff\r
-                       g_irrlicht->Run();\r
-                       \r
                        if(menu->getStatus() == true)\r
                                break;\r
 \r
@@ -2284,9 +2281,6 @@ int main(int argc, char *argv[])
        */\r
        {\r
 \r
-       // This is set to true at the end of the scope\r
-       g_irrlicht->Shutdown(false);\r
-\r
        /*\r
                Draw "Loading" screen\r
        */\r
@@ -2484,11 +2478,6 @@ int main(int argc, char *argv[])
                        break;\r
                }\r
 \r
-               /*\r
-                       Run global IrrlichtWrapper's main thread processing stuff\r
-               */\r
-               g_irrlicht->Run();\r
-\r
                /*\r
                        Process TextureSource's queue\r
                */\r
@@ -3550,22 +3539,8 @@ int main(int argc, char *argv[])
                        device->setWindowCaption(str.c_str());\r
                        lastFPS = fps;\r
                }\r
-               \r
-               /*}\r
-               else\r
-                       device->yield();*/\r
        }\r
 \r
-       //delete quick_inventory;\r
-\r
-       /*\r
-               Disable texture fetches and other stuff that is queued\r
-               to be processed by the main loop.\r
-\r
-               This has to be done before client goes out of scope.\r
-       */\r
-       g_irrlicht->Shutdown(true);\r
-\r
        } // client and server are deleted at this point\r
 \r
        } //try\r
index b951ab5b04440c6453d9f8f82a66567778c5d9e8..4248bd3e4041a8c688b4f5b007cf9529321cc235 100644 (file)
@@ -24,12 +24,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "utility.h"
 extern Settings g_settings;
 
-// A thread safe wrapper to irrlicht
-// On a server build, this is always NULL.
-// TODO: Remove this
-#include "irrlichtwrapper.h"
-extern IrrlichtWrapper *g_irrlicht;
-
 // This makes and maps textures
 #include "tile.h"
 extern ITextureSource *g_texturesource;
index 5b8bc7b9f80762b0e818574fe158789e641c7e3b..6f7e7533ee3d53d32d74b99d993ca3bcc80354ee 100644 (file)
@@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include "mapblock.h"
 #include "map.h"
-// For g_settings and g_irrlicht
+// For g_settings
 #include "main.h"
 #include "light.h"
 #include <sstream>
@@ -676,7 +676,6 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data)
 
                        const u16 indices[] = {0,1,2,2,3,0};
                        
-                       //video::ITexture *texture = g_irrlicht->getTexture(f.tile.spec);
                        video::ITexture *texture = f.tile.texture.atlas;
                        if(texture == NULL)
                                continue;
@@ -701,12 +700,10 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data)
        // Flowing water material
        video::SMaterial material_water1;
        material_water1.setFlag(video::EMF_LIGHTING, false);
-       //material_water1.setFlag(video::EMF_BACK_FACE_CULLING, false);
+       material_water1.setFlag(video::EMF_BACK_FACE_CULLING, false);
        material_water1.setFlag(video::EMF_BILINEAR_FILTER, false);
        material_water1.setFlag(video::EMF_FOG_ENABLE, true);
        material_water1.MaterialType = video::EMT_TRANSPARENT_VERTEX_ALPHA;
-       //TODO
-       //material_water1.setTexture(0, g_irrlicht->getTexture("water.png"));
        AtlasPointer pa_water1 = g_texturesource->getTexture(
                        g_texturesource->getTextureId("water.png"));
        material_water1.setTexture(0, pa_water1.atlas);
@@ -718,8 +715,6 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data)
        material_leaves1.setFlag(video::EMF_BILINEAR_FILTER, false);
        material_leaves1.setFlag(video::EMF_FOG_ENABLE, true);
        material_leaves1.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF;
-       //TODO
-       //material_leaves1.setTexture(0, g_irrlicht->getTexture("leaves.png"));
        AtlasPointer pa_leaves1 = g_texturesource->getTexture(
                        g_texturesource->getTextureId("leaves.png"));
        material_leaves1.setTexture(0, pa_leaves1.atlas);
index f59a90a5f930dbe8dae894c847503a485872b91e..343926f8152f733426ea8f949f927541e267e716 100644 (file)
@@ -24,7 +24,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 // For object wrapping
 #include "map.h"
 #include "inventory.h"
-#include "irrlichtwrapper.h"
 #include "utility.h"
 
 /*
@@ -361,8 +360,6 @@ video::ITexture * ItemObject::getItemImage()
        InventoryItem *item = createInventoryItem();
        if(item)
                texture = item->getImage();
-       /*else
-               texture = g_irrlicht->getTexture(porting::getDataPath("cloud.png").c_str());*/
        if(item)
                delete item;
        return texture;
index f359ecbbb6769214a7037af7bf70ce8fd1d5d7ea..ef1ec8ae3f3819df4dcfba83372118740c1a3bcd 100644 (file)
@@ -27,7 +27,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "exceptions.h"
 #include "serialization.h"
 #include "tile.h"
-#include "iirrlichtwrapper.h"
 
 /*
        Initializes all kind of stuff in here.
index ae4fe435f83dea493a89f087fd2e7c1afe6e76b1..95c5d8bf572a75707cab022fa52de65a5e48a657 100644 (file)
@@ -22,7 +22,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 */
 
 #include "utility.h"
-#include "irrlichtwrapper.h"
 #include "gettime.h"
 
 TimeTaker::TimeTaker(const char *name, u32 *result)
index c6bb3f87905304266659db5d15a3545b07f0ed0a..9c2099fb8e32e9f3ef9a34b97c6081844d6fa5b8 100644 (file)
@@ -496,8 +496,6 @@ private:
        TimeTaker
 */
 
-class IrrlichtWrapper;
-
 class TimeTaker
 {
 public: