video/null_v.c
author tron
Sat, 30 Jul 2005 09:29:20 +0000
changeset 2238 33361a216301
parent 2228 93cdde0f85ba
permissions -rw-r--r--
(svn r2758) Add the AB() macro to add a value to a bit range and use it in a few places, also make use of GB and SB nearby
2186
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2174
diff changeset
     1
/* $Id$ */
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2174
diff changeset
     2
2189
5cdc11ffeaa4 (svn r2704) Remove . from include path again, too much trouble. Also add some #ifdefs and #includes for the Windows build
tron
parents: 2186
diff changeset
     3
#include "../stdafx.h"
5cdc11ffeaa4 (svn r2704) Remove . from include path again, too much trouble. Also add some #ifdefs and #includes for the Windows build
tron
parents: 2186
diff changeset
     4
#include "../openttd.h"
5cdc11ffeaa4 (svn r2704) Remove . from include path again, too much trouble. Also add some #ifdefs and #includes for the Windows build
tron
parents: 2186
diff changeset
     5
#include "../gfx.h"
5cdc11ffeaa4 (svn r2704) Remove . from include path again, too much trouble. Also add some #ifdefs and #includes for the Windows build
tron
parents: 2186
diff changeset
     6
#include "../variables.h"
5cdc11ffeaa4 (svn r2704) Remove . from include path again, too much trouble. Also add some #ifdefs and #includes for the Windows build
tron
parents: 2186
diff changeset
     7
#include "../window.h"
5cdc11ffeaa4 (svn r2704) Remove . from include path again, too much trouble. Also add some #ifdefs and #includes for the Windows build
tron
parents: 2186
diff changeset
     8
#include "null_v.h"
2174
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
     9
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    10
static void* _null_video_mem = NULL;
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    11
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    12
static const char* NullVideoStart(const char* const* parm)
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    13
{
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    14
	_screen.width = _screen.pitch = _cur_resolution[0];
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    15
	_screen.height = _cur_resolution[1];
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    16
	_null_video_mem = malloc(_cur_resolution[0] * _cur_resolution[1]);
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    17
	return NULL;
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    18
}
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    19
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    20
static void NullVideoStop(void) { free(_null_video_mem); }
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    21
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    22
static void NullVideoMakeDirty(int left, int top, int width, int height) {}
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    23
2228
93cdde0f85ba (svn r2748) Remove unused cruft from the main loop
tron
parents: 2189
diff changeset
    24
static void NullVideoMainLoop(void)
2174
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    25
{
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    26
	uint i;
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    27
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    28
	for (i = 0; i < 1000; i++) {
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    29
		GameLoop();
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    30
		_screen.dst_ptr = _null_video_mem;
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    31
		UpdateWindows();
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    32
	}
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    33
}
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    34
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    35
static bool NullVideoChangeRes(int w, int h) { return false; }
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    36
static void NullVideoFullScreen(bool fs) {}
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    37
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    38
const HalVideoDriver _null_video_driver = {
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    39
	NullVideoStart,
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    40
	NullVideoStop,
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    41
	NullVideoMakeDirty,
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    42
	NullVideoMainLoop,
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    43
	NullVideoChangeRes,
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    44
	NullVideoFullScreen,
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents:
diff changeset
    45
};