(svn r9835) -Codechange: use Pixel typedef instead of byte where ever possible
This commit is contained in:
@@ -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(const char * const *parm)
|
||||
{
|
||||
_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);
|
||||
|
@@ -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();
|
||||
}
|
||||
}
|
||||
|
@@ -195,7 +195,7 @@ static bool CreateMainSurface(int w, int h)
|
||||
|
||||
_screen.width = newscreen->w;
|
||||
_screen.height = newscreen->h;
|
||||
_screen.pitch = newscreen->pitch;
|
||||
_screen.pitch = newscreen->pitch / sizeof(Pixel);
|
||||
|
||||
_sdl_screen = newscreen;
|
||||
InitPalette();
|
||||
|
@@ -671,7 +671,7 @@ static bool AllocateDibSection(int w, int h)
|
||||
|
||||
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user