Changeset - r6615:56681ed23403
[Not reviewed]
master
0 6 0
truelight - 17 years ago 2007-05-14 15:20:50
truelight@openttd.org
(svn r9835) -Codechange: use Pixel typedef instead of byte where ever possible
6 files changed with 15 insertions and 15 deletions:
0 comments (0 inline, 0 general)
src/gfx.cpp
Show inline comments
 
@@ -64,12 +64,12 @@ static byte _dirty_blocks[DIRTY_BYTES_PE
 

	
 
void memcpy_pitch(void *dst, void *src, int w, int h, int srcpitch, int dstpitch)
 
{
 
	byte *dstp = (byte*)dst;
 
	byte *srcp = (byte*)src;
 
	Pixel *dstp = (Pixel *)dst;
 
	Pixel *srcp = (Pixel *)src;
 

	
 
	assert(h >= 0);
 
	for (; h != 0; --h) {
 
		memcpy(dstp, srcp, w);
 
		memcpy(dstp, srcp, w * sizeof(Pixel));
 
		dstp += dstpitch;
 
		srcp += srcpitch;
 
	}
 
@@ -110,7 +110,7 @@ void GfxScroll(int left, int top, int wi
 
		}
 

	
 
		for (ht = height; ht > 0; --ht) {
 
			memcpy(dst, src, width);
 
			memcpy(dst, src, width * sizeof(Pixel));
 
			src -= p;
 
			dst -= p;
 
		}
 
@@ -136,7 +136,7 @@ void GfxScroll(int left, int top, int wi
 
		/* the y-displacement may be 0 therefore we have to use memmove,
 
		 * because source and destination may overlap */
 
		for (ht = height; ht > 0; --ht) {
 
			memmove(dst, src, width);
 
			memmove(dst, src, width * sizeof(Pixel));
 
			src += p;
 
			dst += p;
 
		}
 
@@ -175,7 +175,7 @@ void GfxFillRect(int left, int top, int 
 
	if (!HASBIT(color, PALETTE_MODIFIER_GREYOUT)) {
 
		if (!HASBIT(color, USE_COLORTABLE)) {
 
			do {
 
				memset(dst, color, right);
 
				memset(dst, color, right * sizeof(Pixel));
 
				dst += dpi->pitch;
 
			} while (--bottom);
 
		} else {
src/screenshot.cpp
Show inline comments
 
@@ -449,7 +449,7 @@ void SetScreenshotFormat(int i)
 
static void CurrentScreenCallback(void *userdata, Pixel *buf, uint y, uint pitch, uint n)
 
{
 
	for (; n > 0; --n) {
 
		memcpy(buf, _screen.dst_ptr + y * _screen.pitch, _screen.width);
 
		memcpy(buf, _screen.dst_ptr + y * _screen.pitch, _screen.width * sizeof(Pixel));
 
		++y;
 
		buf += pitch;
 
	}
src/video/dedicated_v.cpp
Show inline comments
 
@@ -112,7 +112,7 @@ static void CloseWindowsConsoleThread()
 
#endif
 

	
 

	
 
static void *_dedicated_video_mem;
 
static Pixel *_dedicated_video_mem;
 

	
 
extern bool SafeSaveOrLoad(const char *filename, int mode, int newgm);
 
extern void SwitchMode(int new_mode);
 
@@ -122,7 +122,7 @@ static const char *DedicatedVideoStart(c
 
{
 
	_screen.width = _screen.pitch = _cur_resolution[0];
 
	_screen.height = _cur_resolution[1];
 
	_dedicated_video_mem = malloc(_cur_resolution[0]*_cur_resolution[1]);
 
	_dedicated_video_mem = (Pixel *)malloc(_cur_resolution[0] * _cur_resolution[1] * sizeof(Pixel));
 

	
 
	SetDebugString("net=6");
 

	
 
@@ -283,7 +283,7 @@ static void DedicatedVideoMainLoop()
 
			next_tick = cur_ticks + 30;
 

	
 
			GameLoop();
 
			_screen.dst_ptr = (Pixel*)_dedicated_video_mem;
 
			_screen.dst_ptr = _dedicated_video_mem;
 
			UpdateWindows();
 
		}
 
		CSleep(1);
src/video/null_v.cpp
Show inline comments
 
@@ -7,13 +7,13 @@
 
#include "../window.h"
 
#include "null_v.h"
 

	
 
static void* _null_video_mem = NULL;
 
static Pixel *_null_video_mem = NULL;
 

	
 
static const char* NullVideoStart(const char* const* parm)
 
{
 
	_screen.width = _screen.pitch = _cur_resolution[0];
 
	_screen.height = _cur_resolution[1];
 
	_null_video_mem = malloc(_cur_resolution[0] * _cur_resolution[1]);
 
	_null_video_mem = (Pixel *)malloc(_cur_resolution[0] * _cur_resolution[1] * sizeof(Pixel));
 
	return NULL;
 
}
 

	
 
@@ -27,7 +27,7 @@ static void NullVideoMainLoop()
 

	
 
	for (i = 0; i < 1000; i++) {
 
		GameLoop();
 
		_screen.dst_ptr = (Pixel*)_null_video_mem;
 
		_screen.dst_ptr = _null_video_mem;
 
		UpdateWindows();
 
	}
 
}
src/video/sdl_v.cpp
Show inline comments
 
@@ -195,7 +195,7 @@ static bool CreateMainSurface(int w, int
 

	
 
	_screen.width = newscreen->w;
 
	_screen.height = newscreen->h;
 
	_screen.pitch = newscreen->pitch;
 
	_screen.pitch = newscreen->pitch / sizeof(Pixel);
 

	
 
	_sdl_screen = newscreen;
 
	InitPalette();
src/video/win32_v.cpp
Show inline comments
 
@@ -671,7 +671,7 @@ static bool AllocateDibSection(int w, in
 

	
 
	if (_wnd.double_size) {
 
		w = ALIGN(w, 4);
 
		_wnd.alloced_bits = _wnd.buffer_bits = (Pixel*)malloc(w * h);
 
		_wnd.alloced_bits = _wnd.buffer_bits = (Pixel *)malloc(w * h * sizeof(Pixel));
 
		w *= 2;
 
		h *= 2;
 
	}
0 comments (0 inline, 0 general)