[Scummvm-cvs-logs] CVS: residual driver_tinygl.cpp,1.17,1.18 lua.cpp,1.123,1.124 primitives.cpp,1.1,1.2 primitives.h,1.1,1.2
Pawel Kolodziejski
aquadran at users.sourceforge.net
Fri Apr 8 02:34:36 CEST 2005
Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12585
Modified Files:
driver_tinygl.cpp lua.cpp primitives.cpp primitives.h
Log Message:
added rectangle drawing support, gl driver is not working properly only tinygl
Index: driver_tinygl.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/driver_tinygl.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- driver_tinygl.cpp 7 Apr 2005 20:06:26 -0000 1.17
+++ driver_tinygl.cpp 8 Apr 2005 09:33:21 -0000 1.18
@@ -94,7 +94,7 @@
}
DriverTinyGL::DriverTinyGL(int screenW, int screenH, int screenBPP, bool fullscreen) {
- Uint32 flags = SDL_HWSURFACE;
+ uint32 flags = SDL_HWSURFACE;
if (fullscreen)
flags |= SDL_FULLSCREEN;
_screen = SDL_SetVideoMode(screenW, screenH, screenBPP, flags);
@@ -373,7 +373,7 @@
void DriverTinyGL::selectMaterial(const Material *material) {
#ifdef TURN_ON_LIGTHS_WITHOUT_TEXTURES
-return;
+ return;
#endif
TGLuint *textures = (TGLuint *)material->_textures;
tglBindTexture(TGL_TEXTURE_2D, textures[material->_currImage]);
@@ -502,10 +502,10 @@
for (int x = x1; x < x2; x++) {
WRITE_LE_UINT16(dst + 640 * y2 + x, c);
}
- for (int y = y1; y1 < y2; y++) {
+ for (int y = y1; y < y2; y++) {
WRITE_LE_UINT16(dst + 640 * y + x1, c);
}
- for (int y = y1; y1 < y2; y++) {
+ for (int y = y1; y < y2; y++) {
WRITE_LE_UINT16(dst + 640 * y + x2, c);
}
}
Index: lua.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/lua.cpp,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -d -r1.123 -r1.124
--- lua.cpp 8 Apr 2005 08:39:02 -0000 1.123
+++ lua.cpp 8 Apr 2005 09:33:21 -0000 1.124
@@ -1196,7 +1196,7 @@
else if (num >= SDLK_AXIS_JOY1_X && num <= SDLK_AXIS_MOUSE_Z)
lua_pushnumber(0);
else {
- Uint8 *keystate = SDL_GetKeyState(NULL);
+ uint8 *keystate = SDL_GetKeyState(NULL);
pushbool(keystate[num] != 0);
}
}
@@ -1245,10 +1245,11 @@
}
}
-/* Clean the buffer of text objects
+/* Clean the buffer of text objects and primitives
* this is known to be used when changing between menus
*/
static void CleanBuffer() {
+ g_engine->killPrimitiveObjects();
g_engine->killTextObjects();
}
@@ -1287,7 +1288,7 @@
lua_Object menuTable = lua_getparam(1);
lua_Object keycode = lua_getparam(2);
lua_Object pushcode = lua_getparam(3);
- lua_Object itemTable, item;
+ lua_Object itemTable/*, item*/;
int sliderValue = 0;
int key, operation;
int menuItem = 1, menuItems = 1;
@@ -1604,7 +1605,9 @@
filled = true;
}
- //g_driver->CreateFilledRectangle(x1, x2, y1, y2, color, filled);
+ PrimitiveObject *p = new PrimitiveObject();
+ p->createRectangle(x1, x2, y1, y2, color, filled);
+ g_engine->registerPrimitiveObject(p);
}
static void DimScreen() {
Index: primitives.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/primitives.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- primitives.cpp 7 Apr 2005 19:29:05 -0000 1.1
+++ primitives.cpp 8 Apr 2005 09:33:21 -0000 1.2
@@ -15,6 +15,7 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#include "stdafx.h"
#include "debug.h"
#include "font.h"
#include "color.h"
@@ -39,7 +40,7 @@
PrimitiveObject::~PrimitiveObject() {
}
-void PrimitiveObject::createRectangle(int x1, int y1, int x2, int y2, Color color, bool filled) {
+void PrimitiveObject::createRectangle(int x1, int x2, int y1, int y2, Color color, bool filled) {
_x1 = x1;
_y1 = y1;
_x2 = x2;
Index: primitives.h
===================================================================
RCS file: /cvsroot/scummvm/residual/primitives.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- primitives.h 7 Apr 2005 19:29:05 -0000 1.1
+++ primitives.h 8 Apr 2005 09:33:21 -0000 1.2
@@ -18,6 +18,7 @@
#ifndef PRIMITIVESOBJECT_H
#define PRIMITIVESOBJECT_H
+#include "stdafx.h"
#include "debug.h"
#include "font.h"
#include "color.h"
@@ -31,7 +32,7 @@
PrimitiveObject();
~PrimitiveObject();
- void createRectangle(int x1, int y1, int x2, int y2, Color color, bool filled);
+ void createRectangle(int x1, int x2, int y1, int y2, Color color, bool filled);
int getX1() { return _x1; }
int getX2() { return _x2; }
int getY1() { return _y1; }
More information about the Scummvm-git-logs
mailing list