[Scummvm-cvs-logs] CVS: scummvm scaler.h,NONE,1.1 sdl.cpp,1.130,1.131 sdl_gl.cpp,1.1,1.2 2xsai.cpp,1.7,1.8
Max Horn
fingolfin at users.sourceforge.net
Tue Jul 16 04:10:02 CEST 2002
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/gui ListWidget.cpp,1.7,1.8 ListWidget.h,1.6,1.7 dialog.cpp,1.20,1.21 util.cpp,1.4,1.5 util.h,1.3,1.4 widget.cpp,1.17,1.18 widget.h,1.15,1.16
- Next message: [Scummvm-cvs-logs] CVS: scummvm/gui ListWidget.cpp,1.8,1.9
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv8975
Modified Files:
sdl.cpp sdl_gl.cpp 2xsai.cpp
Added Files:
scaler.h
Log Message:
renamed some variables for clarity; added scaler.h
--- NEW FILE: scaler.h ---
/* ScummVM - Scumm Interpreter
* Copyright (C) 2002 The ScummVM project
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Header: /cvsroot/scummvm/scummvm/scaler.h,v 1.1 2002/07/16 11:09:27 fingolfin Exp $
*/
#ifndef SCALER_H
#define SCALER_H
extern int Init_2xSaI (uint32 BitFormat);
extern void _2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, uint8 *dstPtr,
uint32 dstPitch, int width, int height);
extern void Super2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr,
uint8 *dstPtr, uint32 dstPitch, int width, int height);
extern void SuperEagle(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr,
uint8 *dstPtr, uint32 dstPitch, int width, int height);
extern void AdvMame2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
uint8 *dstPtr, uint32 dstPitch, int width, int height);
extern void Normal1x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
uint8 *dstPtr, uint32 dstPitch, int width, int height);
extern void Normal2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
uint8 *dstPtr, uint32 dstPitch, int width, int height);
extern void Normal3x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
uint8 *dstPtr, uint32 dstPitch, int width, int height);
#endif
Index: sdl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sdl.cpp,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -d -r1.130 -r1.131
--- sdl.cpp 15 Jul 2002 02:01:42 -0000 1.130
+++ sdl.cpp 16 Jul 2002 11:09:27 -0000 1.131
@@ -25,6 +25,7 @@
#include "mididrv.h"
#include "SDL_thread.h"
#include "gameDetector.h"
+#include "scaler.h"
#include "scummvm.xpm"
@@ -153,12 +154,12 @@
/* Keyboard mouse emulation */
struct KbdMouse {
- int16 x, y, xv, yv, xm, ym, xd, yd;
- uint32 last, delay, xdown, ydown;
+ int16 x, y, x_vel, y_vel, x_max, y_max, x_down_count, y_down_count;
+ uint32 last_time, delay_time, x_down_time, y_down_time;
} km;
struct MousePos {
- int16 x,y,w,h;
+ int16 x, y, w, h;
};
byte *_mouse_data;
@@ -197,22 +198,6 @@
void kbd_mouse();
};
-int Init_2xSaI (uint32 BitFormat);
-void _2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, uint8 *dstPtr,
- uint32 dstPitch, int width, int height);
-void Super2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr,
- uint8 *dstPtr, uint32 dstPitch, int width, int height);
-void SuperEagle(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr,
- uint8 *dstPtr, uint32 dstPitch, int width, int height);
-void AdvMame2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
- uint8 *dstPtr, uint32 dstPitch, int width, int height);
-void Normal1x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
- uint8 *dstPtr, uint32 dstPitch, int width, int height);
-void Normal2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
- uint8 *dstPtr, uint32 dstPitch, int width, int height);
-void Normal3x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
- uint8 *dstPtr, uint32 dstPitch, int width, int height);
-
void atexit_proc() {
SDL_ShowCursor(SDL_ENABLE);
@@ -371,10 +356,10 @@
}
// keyboard cursor control, some other better place for it?
- km.xm = SCREEN_WIDTH * scaling;
- km.ym = SCREEN_HEIGHT * scaling;
- km.delay = 25;
- km.last = 0;
+ km.x_max = SCREEN_WIDTH * scaling - 1;
+ km.y_max = SCREEN_HEIGHT * scaling - 1;
+ km.delay_time = 25;
+ km.last_time = 0;
}
@@ -704,66 +689,66 @@
void OSystem_SDL::kbd_mouse() {
uint32 time = get_msecs();
- if (time >= km.last + km.delay) {
- km.last = time;
- if (km.xd == 1) {
- km.xdown = time;
- km.xd = 2;
+ if (time >= km.last_time + km.delay_time) {
+ km.last_time = time;
+ if (km.x_down_count == 1) {
+ km.x_down_time = time;
+ km.x_down_count = 2;
}
- if (km.yd == 1) {
- km.ydown = time;
- km.yd = 2;
+ if (km.y_down_count == 1) {
+ km.y_down_time = time;
+ km.y_down_count = 2;
}
- if (km.xv || km.yv) {
- if (km.xd) {
- if (time > km.xdown + km.delay*12) {
- if (km.xv > 0)
- km.xv++;
+ if (km.x_vel || km.y_vel) {
+ if (km.x_down_count) {
+ if (time > km.x_down_time + km.delay_time*12) {
+ if (km.x_vel > 0)
+ km.x_vel++;
else
- km.xv--;
- } else if (time > km.xdown + km.delay*8) {
- if (km.xv > 0)
- km.xv = 5;
+ km.x_vel--;
+ } else if (time > km.x_down_time + km.delay_time*8) {
+ if (km.x_vel > 0)
+ km.x_vel = 5;
else
- km.xv = -5;
+ km.x_vel = -5;
}
}
- if (km.yd) {
- if (time > km.ydown + km.delay*12) {
- if (km.yv > 0)
- km.yv++;
+ if (km.y_down_count) {
+ if (time > km.y_down_time + km.delay_time*12) {
+ if (km.y_vel > 0)
+ km.y_vel++;
else
- km.yv--;
- } else if (time > km.ydown + km.delay*8) {
- if (km.yv > 0)
- km.yv = 5;
+ km.y_vel--;
+ } else if (time > km.y_down_time + km.delay_time*8) {
+ if (km.y_vel > 0)
+ km.y_vel = 5;
else
- km.yv = -5;
+ km.y_vel = -5;
}
}
- km.x += km.xv;
- km.y += km.yv;
+ km.x += km.x_vel;
+ km.y += km.y_vel;
if (km.x < 0) {
km.x = 0;
- km.xv = -1;
- km.xd = 1;
- } else if (km.x >= km.xm) {
- km.x = km.xm - 1;
- km.xv = 1;
- km.xd = 1;
+ km.x_vel = -1;
+ km.x_down_count = 1;
+ } else if (km.x > km.x_max) {
+ km.x = km.x_max;
+ km.x_vel = 1;
+ km.x_down_count = 1;
}
if (km.y < 0) {
km.y = 0;
- km.yv = -1;
- km.yd = 1;
- } else if (km.y >= km.ym) {
- km.y = km.ym - 1;
- km.yv = 1;
- km.yd = 1;
+ km.y_vel = -1;
+ km.y_down_count = 1;
+ } else if (km.y > km.y_max) {
+ km.y = km.y_max;
+ km.y_vel = 1;
+ km.y_down_count = 1;
}
SDL_WarpMouse(km.x, km.y);
@@ -874,20 +859,20 @@
event->kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod);
switch(ev.key.keysym.sym) {
case SDLK_LEFT:
- km.xv = -1;
- km.xd = 1;
+ km.x_vel = -1;
+ km.x_down_count = 1;
break;
case SDLK_RIGHT:
- km.xv = 1;
- km.xd = 1;
+ km.x_vel = 1;
+ km.x_down_count = 1;
break;
case SDLK_UP:
- km.yv = -1;
- km.yd = 1;
+ km.y_vel = -1;
+ km.y_down_count = 1;
break;
case SDLK_DOWN:
- km.yv = 1;
- km.yd = 1;
+ km.y_vel = 1;
+ km.y_down_count = 1;
break;
default:
break;
@@ -899,27 +884,27 @@
case SDL_KEYUP: {
switch(ev.key.keysym.sym){
case SDLK_LEFT:
- if (km.xv < 0) {
- km.xv = 0;
- km.xd = 0;
+ if (km.x_vel < 0) {
+ km.x_vel = 0;
+ km.x_down_count = 0;
}
break;
case SDLK_RIGHT:
- if (km.xv > 0) {
- km.xv = 0;
- km.xd = 0;
+ if (km.x_vel > 0) {
+ km.x_vel = 0;
+ km.x_down_count = 0;
}
break;
case SDLK_UP:
- if (km.yv < 0) {
- km.yv = 0;
- km.yd = 0;
+ if (km.y_vel < 0) {
+ km.y_vel = 0;
+ km.y_down_count = 0;
}
break;
case SDLK_DOWN:
- if (km.yv > 0) {
- km.yv = 0;
- km.yd = 0;
+ if (km.y_vel > 0) {
+ km.y_vel = 0;
+ km.y_down_count = 0;
}
break;
default:
Index: sdl_gl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sdl_gl.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- sdl_gl.cpp 17 Jun 2002 13:16:51 -0000 1.1
+++ sdl_gl.cpp 16 Jul 2002 11:09:27 -0000 1.2
@@ -25,6 +25,7 @@
#include "mididrv.h"
#include "SDL_thread.h"
#include "gameDetector.h"
+#include "scaler.h"
#include "scummvm.xpm"
@@ -196,22 +197,6 @@
void setup_icon();
};
-
-int Init_2xSaI (uint32 BitFormat);
-void _2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, uint8 *dstPtr,
- uint32 dstPitch, int width, int height);
-void Super2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr,
- uint8 *dstPtr, uint32 dstPitch, int width, int height);
-void SuperEagle(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr,
- uint8 *dstPtr, uint32 dstPitch, int width, int height);
-void AdvMame2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
- uint8 *dstPtr, uint32 dstPitch, int width, int height);
-void Normal1x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
- uint8 *dstPtr, uint32 dstPitch, int width, int height);
-void Normal2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
- uint8 *dstPtr, uint32 dstPitch, int width, int height);
-void Normal3x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
- uint8 *dstPtr, uint32 dstPitch, int width, int height);
void atexit_proc() {
SDL_ShowCursor(SDL_ENABLE);
Index: 2xsai.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/2xsai.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- 2xsai.cpp 7 Jul 2002 20:25:22 -0000 1.7
+++ 2xsai.cpp 16 Jul 2002 11:09:27 -0000 1.8
@@ -22,6 +22,7 @@
#include "stdafx.h"
#include "scummsys.h"
+#include "scaler.h"
/********** 2XSAI Filter *****************/
static uint32 colorMask = 0xF7DEF7DE;
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/gui ListWidget.cpp,1.7,1.8 ListWidget.h,1.6,1.7 dialog.cpp,1.20,1.21 util.cpp,1.4,1.5 util.h,1.3,1.4 widget.cpp,1.17,1.18 widget.h,1.15,1.16
- Next message: [Scummvm-cvs-logs] CVS: scummvm/gui ListWidget.cpp,1.8,1.9
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list