[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src col_map.cxx,1.11,1.12
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src col_map.cxx,1.11,1.12 |
Date: |
28 Sep 2002 18:11:42 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src
In directory dark:/tmp/cvs-serv21386
Modified Files:
col_map.cxx
Log Message:
- cleanup
- added clear of colmap
Index: col_map.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/col_map.cxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- col_map.cxx 28 Sep 2002 11:52:21 -0000 1.11
+++ col_map.cxx 28 Sep 2002 18:11:40 -0000 1.12
@@ -36,6 +36,8 @@
height(h),
colmap(new unsigned char[width * height])
{
+ // Clear the colmap
+ memset(colmap, Groundtype::GP_NOTHING, sizeof(unsigned char) * width *
height);
}
ColMap::~ColMap()
@@ -43,50 +45,6 @@
//std::cout << "ColMap:~ColMap" << std::endl;
delete[] colmap;
}
-
-#if 0
-int
-ColMap::load(ResDescriptor desc)
-{
- switch(desc.type) {
- case ResDescriptor::RD_FILE:
- PingusError::raise(_("ColMap: File load - Feature is no longer
implemented")); // return load(desc.res_name);
- break;
- case ResDescriptor::RD_RESOURCE:
- {
- CL_Surface sur;
- CL_SurfaceProvider* provider;
-
- sur = PingusResource::load_surface(desc);
- provider = sur.get_provider();
- if (provider->get_depth() != 8)
- PingusError::raise(_("PingusBmpMap::get_colmap: Surface has wrong pixel
format, need 8bpp!"));
-
- width = provider->get_width();
- height = provider->get_height();
-
- provider->lock();
-
- colmap = new unsigned char[provider->get_pitch() *
provider->get_height()];
- memcpy(colmap, provider->get_data(), provider->get_pitch() *
provider->get_height());
-
- // FIXME: Memory hole
- //provider->unlock();
-
- init = true;
-
- return 0;
- }
- break;
- default:
- assert(false);
- return 0;
- break;
- }
-
- return 0; // never reached
-}
-#endif
int
ColMap::getpixel(int x, int y)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src col_map.cxx,1.11,1.12,
grumbel <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src/editor editor_groundpiece_obj.cxx,1.13,NONE editor_groundpiece_obj.hxx,1.10,NONE
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src true_server.cxx,1.10,1.11
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src/editor editor_groundpiece_obj.cxx,1.13,NONE editor_groundpiece_obj.hxx,1.10,NONE
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src true_server.cxx,1.10,1.11
- Index(es):