src/video/null_v.cpp
changeset 7111 269c76b5b987
parent 6573 7624f942237f
child 6720 35756db7e577
child 7374 54c06f06ecc8
child 9628 b5c2449616b5
equal deleted inserted replaced
7110:1f9336148544 7111:269c76b5b987
     5 #include "../gfx.h"
     5 #include "../gfx.h"
     6 #include "../variables.h"
     6 #include "../variables.h"
     7 #include "../window.h"
     7 #include "../window.h"
     8 #include "null_v.h"
     8 #include "null_v.h"
     9 
     9 
    10 static void* _null_video_mem = NULL;
    10 static Pixel *_null_video_mem = NULL;
    11 
    11 
    12 static const char* NullVideoStart(const char* const* parm)
    12 static const char* NullVideoStart(const char* const* parm)
    13 {
    13 {
    14 	_screen.width = _screen.pitch = _cur_resolution[0];
    14 	_screen.width = _screen.pitch = _cur_resolution[0];
    15 	_screen.height = _cur_resolution[1];
    15 	_screen.height = _cur_resolution[1];
    16 	_null_video_mem = malloc(_cur_resolution[0] * _cur_resolution[1]);
    16 	_null_video_mem = (Pixel *)malloc(_cur_resolution[0] * _cur_resolution[1] * sizeof(Pixel));
    17 	return NULL;
    17 	return NULL;
    18 }
    18 }
    19 
    19 
    20 static void NullVideoStop() { free(_null_video_mem); }
    20 static void NullVideoStop() { free(_null_video_mem); }
    21 
    21 
    25 {
    25 {
    26 	uint i;
    26 	uint i;
    27 
    27 
    28 	for (i = 0; i < 1000; i++) {
    28 	for (i = 0; i < 1000; i++) {
    29 		GameLoop();
    29 		GameLoop();
    30 		_screen.dst_ptr = (Pixel*)_null_video_mem;
    30 		_screen.dst_ptr = _null_video_mem;
    31 		UpdateWindows();
    31 		UpdateWindows();
    32 	}
    32 	}
    33 }
    33 }
    34 
    34 
    35 static bool NullVideoChangeRes(int w, int h) { return false; }
    35 static bool NullVideoChangeRes(int w, int h) { return false; }