[Scummvm-cvs-logs] CVS: residual bitmap.cpp,1.32,1.33 bitmap.h,1.17,1.18 lua.cpp,1.132,1.133
Pawel Kolodziejski
aquadran at users.sourceforge.net
Fri Apr 8 07:35:51 CEST 2005
Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13344
Modified Files:
bitmap.cpp bitmap.h lua.cpp
Log Message:
added code for hardware setup, and another Bitmap constructor
Index: bitmap.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/bitmap.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- bitmap.cpp 8 Apr 2005 11:16:56 -0000 1.32
+++ bitmap.cpp 8 Apr 2005 14:35:13 -0000 1.33
@@ -77,6 +77,21 @@
g_driver->createBitmap(this);
}
+Bitmap::Bitmap(const char *data, int width, int height, const char *filename) :
+ Resource(filename) {
+ strcpy(_filename, filename);
+ _currImage = 1;
+ _numImages = 1;
+ _x = 0;
+ _y = 0;
+ _width = width;
+ _height = height;
+ _data = new char *[_numImages];
+ _data[0] = new char[2 * _width * _height];
+ memcpy(_data[0], data, 2 * _width * _height);
+ g_driver->createBitmap(this);
+}
+
void Bitmap::draw() const {
if (_currImage == 0)
return;
Index: bitmap.h
===================================================================
RCS file: /cvsroot/scummvm/residual/bitmap.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- bitmap.h 8 Apr 2005 11:16:56 -0000 1.17
+++ bitmap.h 8 Apr 2005 14:35:13 -0000 1.18
@@ -26,6 +26,7 @@
public:
// Construct a bitmap from the given data.
Bitmap(const char *filename, const char *data, int len);
+ Bitmap(const char *data, int width, int height, const char *filename);
void draw() const;
Index: lua.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/lua.cpp,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -d -r1.132 -r1.133
--- lua.cpp 8 Apr 2005 13:07:30 -0000 1.132
+++ lua.cpp 8 Apr 2005 14:35:13 -0000 1.133
@@ -509,7 +509,13 @@
}
static void SetHardwareState() {
- // ignore changing hardware state
+ // changing only in config setup (software/hardware rendering)
+ bool accel = getbool(1);
+ if (accel)
+ g_registry->set("soft", "FALSE");
+ else
+ g_registry->set("soft", "TRUE");
+ g_registry->save();
}
static void SetVideoDevices() {
@@ -517,15 +523,31 @@
}
static void GetVideoDevices() {
- // ignore getting of video devices
+ lua_pushnumber(0.0);
+ lua_pushnumber(-1.0);
}
static void EnumerateVideoDevices() {
- // ignore list of video devices
+ lua_Object result = lua_createtable();
+ lua_pushobject(result);
+ lua_pushnumber(0); // id of device
+ lua_pushstring("SDL Video Device"); // name of device
+ lua_settable();
+ lua_pushobject(result);
}
static void Enumerate3DDevices() {
- // ignore list of 3d devices
+ int num = check_int(1);
+ lua_Object result = lua_createtable();
+ lua_pushobject(result);
+ lua_pushnumber(-1);
+ if (g_driver->isHardwareAccelerated()) {
+ lua_pushstring("OpenGL"); // type of 3d renderer
+ } else {
+ lua_pushstring("/engn003/Software"); // type of 3d renderer
+ }
+ lua_settable();
+ lua_pushobject(result);
}
static void IsActorResting() {
More information about the Scummvm-git-logs
mailing list