Experimenting with 2 layers
This commit is contained in:
parent
f3b3823b0c
commit
ecc1d7c416
|
@ -19,48 +19,49 @@ static Uint8 blending[5][16] = {
|
||||||
{2, 3, 1, 2, 2, 3, 1, 2, 2, 3, 1, 2, 2, 3, 1, 2},
|
{2, 3, 1, 2, 2, 3, 1, 2, 2, 3, 1, 2, 2, 3, 1, 2},
|
||||||
{1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0}};
|
{1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0}};
|
||||||
|
|
||||||
void
|
|
||||||
ppu_frame(Ppu *p)
|
|
||||||
{
|
|
||||||
p->reqdraw = 0;
|
|
||||||
p->i0 = p->width / PPW + p->height * p->stride;
|
|
||||||
p->i1 = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ppu_clear(Ppu *p)
|
ppu_clear(Ppu *p)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
int x, y;
|
||||||
for(i = 0; i < p->stride * p->height; ++i)
|
for(y = 0; y < p->height; ++y) {
|
||||||
p->dat[i] = 0;
|
for(x = 0; x < p->width; ++x) {
|
||||||
|
ppu_write(p, p->bg, x, y, 0);
|
||||||
|
ppu_write(p, p->fg, x, y, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Uint8
|
Uint8
|
||||||
ppu_read(Ppu *p, Uint16 x, Uint16 y)
|
ppu_read(Ppu *p, Uint16 x, Uint16 y)
|
||||||
{
|
{
|
||||||
unsigned int i = x / PPW + y * p->stride, shift = x % PPW * 4;
|
int ch1, ch2, r = (y % 8) + ((x / 8 + y / 8 * p->width / 8) * 16);
|
||||||
return (p->dat[i] >> shift) & 0xf;
|
ch1 = (p->fg[r] >> (7 - x % 8)) & 1;
|
||||||
|
ch2 = (p->fg[r + 8] >> (7 - x % 8)) & 1;
|
||||||
|
if(!ch1 && !ch2) {
|
||||||
|
ch1 = (p->bg[r] >> (7 - x % 8)) & 1;
|
||||||
|
ch2 = (p->bg[r + 8] >> (7 - x % 8)) & 1;
|
||||||
|
}
|
||||||
|
return ch1 + (ch2 << 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ppu_write(Ppu *p, int fg, Uint16 x, Uint16 y, Uint8 color)
|
ppu_write(Ppu *p, Uint8 *layer, Uint16 x, Uint16 y, Uint8 color)
|
||||||
{
|
{
|
||||||
unsigned int v, i = x / PPW + y * p->stride, shift = x % PPW * 4;
|
int row = (y % 8) + ((x / 8 + y / 8 * p->width / 8) * 16), col = x % 8;
|
||||||
if(x >= p->width || y >= p->height)
|
if(x >= p->width || y >= p->height)
|
||||||
return;
|
return;
|
||||||
v = p->dat[i];
|
if(color == 0 || color == 2)
|
||||||
if(fg) shift += 2;
|
layer[row] &= ~(1UL << (7 - col));
|
||||||
p->dat[i] &= ~(3 << shift);
|
else
|
||||||
p->dat[i] |= color << shift;
|
layer[row] |= 1UL << (7 - col);
|
||||||
if((v ^ p->dat[i]) != 0) {
|
if(color == 0 || color == 1)
|
||||||
p->reqdraw = 1;
|
layer[row + 8] &= ~(1UL << (7 - col));
|
||||||
p->i0 = p->i0 < i ? p->i0 : i;
|
else
|
||||||
p->i1 = p->i1 > i ? p->i1 : i;
|
layer[row + 8] |= 1UL << (7 - col);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ppu_1bpp(Ppu *p, int fg, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uint8 flipx, Uint8 flipy)
|
ppu_1bpp(Ppu *p, Uint8 *layer, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uint8 flipx, Uint8 flipy)
|
||||||
{
|
{
|
||||||
Uint16 v, h;
|
Uint16 v, h;
|
||||||
for(v = 0; v < 8; v++)
|
for(v = 0; v < 8; v++)
|
||||||
|
@ -68,7 +69,7 @@ ppu_1bpp(Ppu *p, int fg, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uint8 f
|
||||||
Uint8 ch1 = (sprite[v] >> (7 - h)) & 0x1;
|
Uint8 ch1 = (sprite[v] >> (7 - h)) & 0x1;
|
||||||
if(ch1 || blending[4][color])
|
if(ch1 || blending[4][color])
|
||||||
ppu_write(p,
|
ppu_write(p,
|
||||||
fg,
|
layer,
|
||||||
x + (flipx ? 7 - h : h),
|
x + (flipx ? 7 - h : h),
|
||||||
y + (flipy ? 7 - v : v),
|
y + (flipy ? 7 - v : v),
|
||||||
blending[ch1][color]);
|
blending[ch1][color]);
|
||||||
|
@ -76,7 +77,7 @@ ppu_1bpp(Ppu *p, int fg, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uint8 f
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ppu_2bpp(Ppu *p, int fg, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uint8 flipx, Uint8 flipy)
|
ppu_2bpp(Ppu *p, Uint8 *layer, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uint8 flipx, Uint8 flipy)
|
||||||
{
|
{
|
||||||
Uint16 v, h;
|
Uint16 v, h;
|
||||||
for(v = 0; v < 8; v++)
|
for(v = 0; v < 8; v++)
|
||||||
|
@ -86,7 +87,7 @@ ppu_2bpp(Ppu *p, int fg, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uint8 f
|
||||||
Uint8 ch = ch1 + ch2 * 2;
|
Uint8 ch = ch1 + ch2 * 2;
|
||||||
if(ch || blending[4][color])
|
if(ch || blending[4][color])
|
||||||
ppu_write(p,
|
ppu_write(p,
|
||||||
fg,
|
layer,
|
||||||
x + (flipx ? 7 - h : h),
|
x + (flipx ? 7 - h : h),
|
||||||
y + (flipy ? 7 - v : v),
|
y + (flipy ? 7 - v : v),
|
||||||
blending[ch][color]);
|
blending[ch][color]);
|
||||||
|
@ -98,12 +99,12 @@ ppu_2bpp(Ppu *p, int fg, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uint8 f
|
||||||
int
|
int
|
||||||
ppu_set_size(Ppu *p, Uint16 width, Uint16 height)
|
ppu_set_size(Ppu *p, Uint16 width, Uint16 height)
|
||||||
{
|
{
|
||||||
p->width = width;
|
|
||||||
p->stride = (width + PPW - 1) / PPW;
|
|
||||||
p->height = height;
|
|
||||||
p->dat = realloc(p->dat, p->stride * p->height * sizeof(unsigned int));
|
|
||||||
if(p->dat == NULL) return 0;
|
|
||||||
ppu_clear(p);
|
ppu_clear(p);
|
||||||
ppu_frame(p);
|
p->width = width;
|
||||||
return 1;
|
p->height = height;
|
||||||
|
p->pixels = realloc(p->bg, p->width / 4 * p->height * sizeof(Uint8) * 2);
|
||||||
|
p->bg = p->pixels;
|
||||||
|
p->fg = p->pixels + (p->width / 4 * p->height * sizeof(Uint8));
|
||||||
|
ppu_clear(p);
|
||||||
|
return p->bg && p->fg;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,14 +22,14 @@ typedef unsigned short Uint16;
|
||||||
typedef unsigned int Uint32;
|
typedef unsigned int Uint32;
|
||||||
|
|
||||||
typedef struct Ppu {
|
typedef struct Ppu {
|
||||||
Uint8 reqdraw;
|
Uint8 *bg, *fg, *pixels, reqdraw;
|
||||||
Uint16 width, height;
|
Uint16 width, height;
|
||||||
unsigned int i0, i1, *dat, stride;
|
|
||||||
} Ppu;
|
} Ppu;
|
||||||
|
|
||||||
Uint8 ppu_read(Ppu *p, Uint16 x, Uint16 y);
|
Uint8 ppu_read(Ppu *p, Uint16 x, Uint16 y);
|
||||||
void ppu_write(Ppu *p, int fg, Uint16 x, Uint16 y, Uint8 color);
|
void ppu_write(Ppu *p, Uint8 *layer, Uint16 x, Uint16 y, Uint8 color);
|
||||||
void ppu_frame(Ppu *p);
|
void ppu_frame(Ppu *p);
|
||||||
void ppu_1bpp(Ppu *p, int fg, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uint8 flipx, Uint8 flipy);
|
|
||||||
void ppu_2bpp(Ppu *p, int fg, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uint8 flipx, Uint8 flipy);
|
void ppu_1bpp(Ppu *p, Uint8 *layer, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uint8 flipx, Uint8 flipy);
|
||||||
|
void ppu_2bpp(Ppu *p, Uint8 *layer, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uint8 flipx, Uint8 flipy);
|
||||||
int ppu_set_size(Ppu *p, Uint16 width, Uint16 height);
|
int ppu_set_size(Ppu *p, Uint16 width, Uint16 height);
|
||||||
|
|
72
src/uxnemu.c
72
src/uxnemu.c
|
@ -37,7 +37,7 @@ static SDL_Rect gRect;
|
||||||
static Ppu ppu;
|
static Ppu ppu;
|
||||||
static Apu apu[POLYPHONY];
|
static Apu apu[POLYPHONY];
|
||||||
static Device *devsystem, *devscreen, *devmouse, *devctrl, *devaudio0, *devconsole;
|
static Device *devsystem, *devscreen, *devmouse, *devctrl, *devaudio0, *devconsole;
|
||||||
static Uint8 zoom = 1, reqdraw = 0;
|
static Uint8 zoom = 1;
|
||||||
static Uint32 *ppu_screen, stdin_event, audio0_event, palette[16];
|
static Uint32 *ppu_screen, stdin_event, audio0_event, palette[16];
|
||||||
|
|
||||||
static Uint8 font[][8] = {
|
static Uint8 font[][8] = {
|
||||||
|
@ -118,14 +118,14 @@ set_palette(Uint8 *addr)
|
||||||
}
|
}
|
||||||
for(i = 4; i < 16; ++i)
|
for(i = 4; i < 16; ++i)
|
||||||
palette[i] = palette[i / 4];
|
palette[i] = palette[i / 4];
|
||||||
reqdraw = 1;
|
ppu.reqdraw = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_inspect(Uint8 flag)
|
set_inspect(Uint8 flag)
|
||||||
{
|
{
|
||||||
devsystem->dat[0xe] = flag;
|
devsystem->dat[0xe] = flag;
|
||||||
reqdraw = 1;
|
ppu.reqdraw = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -144,7 +144,7 @@ set_zoom(Uint8 scale)
|
||||||
if(scale == zoom || !gWindow)
|
if(scale == zoom || !gWindow)
|
||||||
return;
|
return;
|
||||||
set_window_size(gWindow, (ppu.width + PAD * 2) * zoom, (ppu.height + PAD * 2) * zoom);
|
set_window_size(gWindow, (ppu.width + PAD * 2) * zoom, (ppu.height + PAD * 2) * zoom);
|
||||||
reqdraw = 1;
|
ppu.reqdraw = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -165,7 +165,7 @@ set_size(Uint16 width, Uint16 height, int is_resize)
|
||||||
return error("sdl_texture", SDL_GetError());
|
return error("sdl_texture", SDL_GetError());
|
||||||
if(is_resize)
|
if(is_resize)
|
||||||
set_window_size(gWindow, (ppu.width + PAD * 2) * zoom, (ppu.height + PAD * 2) * zoom);
|
set_window_size(gWindow, (ppu.width + PAD * 2) * zoom, (ppu.height + PAD * 2) * zoom);
|
||||||
reqdraw = 1;
|
ppu.reqdraw = 1;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,51 +190,46 @@ static void
|
||||||
draw_inspect(Ppu *p, Uint8 *stack, Uint8 wptr, Uint8 rptr, Uint8 *memory)
|
draw_inspect(Ppu *p, Uint8 *stack, Uint8 wptr, Uint8 rptr, Uint8 *memory)
|
||||||
{
|
{
|
||||||
Uint8 i, x, y, b;
|
Uint8 i, x, y, b;
|
||||||
for(i = 0; i < 0x20; ++i) { /* stack */
|
|
||||||
|
for(i = 0; i < 0x20; ++i) {
|
||||||
x = ((i % 8) * 3 + 1) * 8, y = (i / 8 + 1) * 8, b = stack[i];
|
x = ((i % 8) * 3 + 1) * 8, y = (i / 8 + 1) * 8, b = stack[i];
|
||||||
ppu_1bpp(p, 1, x, y, font[(b >> 4) & 0xf], 1 + (wptr == i) * 0x7, 0, 0);
|
/* working stack */
|
||||||
ppu_1bpp(p, 1, x + 8, y, font[b & 0xf], 1 + (wptr == i) * 0x7, 0, 0);
|
ppu_1bpp(p, ppu.fg, x, y, font[(b >> 4) & 0xf], 1 + (wptr == i) * 0x7, 0, 0);
|
||||||
|
ppu_1bpp(p, ppu.fg, x + 8, y, font[b & 0xf], 1 + (wptr == i) * 0x7, 0, 0);
|
||||||
|
y = 0x28 + (i / 8 + 1) * 8;
|
||||||
|
b = memory[i];
|
||||||
|
/* return stack */
|
||||||
|
ppu_1bpp(p, ppu.fg, x, y, font[(b >> 4) & 0xf], 3, 0, 0);
|
||||||
|
ppu_1bpp(p, ppu.fg, x + 8, y, font[b & 0xf], 3, 0, 0);
|
||||||
}
|
}
|
||||||
/* return pointer */
|
/* return pointer */
|
||||||
ppu_1bpp(p, 1, 0x8, y + 0x10, font[(rptr >> 4) & 0xf], 0x2, 0, 0);
|
ppu_1bpp(p, ppu.fg, 0x8, y + 0x10, font[(rptr >> 4) & 0xf], 0x2, 0, 0);
|
||||||
ppu_1bpp(p, 1, 0x10, y + 0x10, font[rptr & 0xf], 0x2, 0, 0);
|
ppu_1bpp(p, ppu.fg, 0x10, y + 0x10, font[rptr & 0xf], 0x2, 0, 0);
|
||||||
for(i = 0; i < 0x20; ++i) { /* memory */
|
/* guides */
|
||||||
x = ((i % 8) * 3 + 1) * 8, y = 0x38 + (i / 8 + 1) * 8, b = memory[i];
|
for(x = 0; x < 0x10; ++x) {
|
||||||
ppu_1bpp(p, 1, x, y, font[(b >> 4) & 0xf], 3, 0, 0);
|
ppu_write(p, ppu.fg, x, p->height / 2, 2);
|
||||||
ppu_1bpp(p, 1, x + 8, y, font[b & 0xf], 3, 0, 0);
|
ppu_write(p, ppu.fg, p->width - x, p->height / 2, 2);
|
||||||
}
|
ppu_write(p, ppu.fg, p->width / 2, p->height - x, 2);
|
||||||
for(x = 0; x < 0x10; ++x) { /* guides */
|
ppu_write(p, ppu.fg, p->width / 2, x, 2);
|
||||||
ppu_write(p, 1, x, p->height / 2, 2);
|
ppu_write(p, ppu.fg, p->width / 2 - 0x10 / 2 + x, p->height / 2, 2);
|
||||||
ppu_write(p, 1, p->width - x, p->height / 2, 2);
|
ppu_write(p, ppu.fg, p->width / 2, p->height / 2 - 0x10 / 2 + x, 2);
|
||||||
ppu_write(p, 1, p->width / 2, p->height - x, 2);
|
|
||||||
ppu_write(p, 1, p->width / 2, x, 2);
|
|
||||||
ppu_write(p, 1, p->width / 2 - 0x10 / 2 + x, p->height / 2, 2);
|
|
||||||
ppu_write(p, 1, p->width / 2, p->height / 2 - 0x10 / 2 + x, 2);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
redraw(Uxn *u)
|
redraw(Uxn *u)
|
||||||
{
|
{
|
||||||
Uint16 x, y, y0 = 0, y1 = ppu.height;
|
Uint16 x, y;
|
||||||
SDL_Rect up = gRect;
|
|
||||||
if(devsystem->dat[0xe])
|
if(devsystem->dat[0xe])
|
||||||
draw_inspect(&ppu, u->wst.dat, u->wst.ptr, u->rst.ptr, u->ram.dat);
|
draw_inspect(&ppu, u->wst.dat, u->wst.ptr, u->rst.ptr, u->ram.dat);
|
||||||
if(!reqdraw && ppu.reqdraw) {
|
for(y = 0; y < ppu.height; ++y)
|
||||||
y0 = ppu.i0 / ppu.stride;
|
|
||||||
y1 = ppu.i1 / ppu.stride + 1;
|
|
||||||
up.y += y0;
|
|
||||||
up.h = y1 - y0;
|
|
||||||
}
|
|
||||||
for(y = y0; y < y1; ++y)
|
|
||||||
for(x = 0; x < ppu.width; ++x)
|
for(x = 0; x < ppu.width; ++x)
|
||||||
ppu_screen[x + y * ppu.width] = palette[ppu_read(&ppu, x, y)];
|
ppu_screen[x + y * ppu.width] = palette[ppu_read(&ppu, x, y)];
|
||||||
SDL_UpdateTexture(gTexture, &up, ppu_screen + y0 * ppu.width, ppu.width * sizeof(Uint32));
|
SDL_UpdateTexture(gTexture, &gRect, ppu_screen, ppu.width * sizeof(Uint32));
|
||||||
SDL_RenderClear(gRenderer);
|
SDL_RenderClear(gRenderer);
|
||||||
SDL_RenderCopy(gRenderer, gTexture, NULL, NULL);
|
SDL_RenderCopy(gRenderer, gTexture, NULL, NULL);
|
||||||
SDL_RenderPresent(gRenderer);
|
SDL_RenderPresent(gRenderer);
|
||||||
reqdraw = 0;
|
ppu.reqdraw = 0;
|
||||||
ppu_frame(&ppu);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -395,7 +390,7 @@ screen_talk(Device *d, Uint8 b0, Uint8 w)
|
||||||
Uint16 x = peek16(d->dat, 0x8);
|
Uint16 x = peek16(d->dat, 0x8);
|
||||||
Uint16 y = peek16(d->dat, 0xa);
|
Uint16 y = peek16(d->dat, 0xa);
|
||||||
Uint8 layer = d->dat[0xe] & 0x40;
|
Uint8 layer = d->dat[0xe] & 0x40;
|
||||||
ppu_write(&ppu, layer, x, y, d->dat[0xe] & 0x3);
|
ppu_write(&ppu, layer ? ppu.fg : ppu.bg, x, y, d->dat[0xe] & 0x3);
|
||||||
if(d->dat[0x6] & 0x01) poke16(d->dat, 0x8, x + 1); /* auto x+1 */
|
if(d->dat[0x6] & 0x01) poke16(d->dat, 0x8, x + 1); /* auto x+1 */
|
||||||
if(d->dat[0x6] & 0x02) poke16(d->dat, 0xa, y + 1); /* auto y+1 */
|
if(d->dat[0x6] & 0x02) poke16(d->dat, 0xa, y + 1); /* auto y+1 */
|
||||||
break;
|
break;
|
||||||
|
@ -406,14 +401,15 @@ screen_talk(Device *d, Uint8 b0, Uint8 w)
|
||||||
Uint8 layer = d->dat[0xf] & 0x40;
|
Uint8 layer = d->dat[0xf] & 0x40;
|
||||||
Uint8 *addr = &d->mem[peek16(d->dat, 0xc)];
|
Uint8 *addr = &d->mem[peek16(d->dat, 0xc)];
|
||||||
if(d->dat[0xf] & 0x80) {
|
if(d->dat[0xf] & 0x80) {
|
||||||
ppu_2bpp(&ppu, layer, x, y, addr, d->dat[0xf] & 0xf, d->dat[0xf] & 0x10, d->dat[0xf] & 0x20);
|
ppu_2bpp(&ppu, layer ? ppu.fg : ppu.bg, x, y, addr, d->dat[0xf] & 0xf, d->dat[0xf] & 0x10, d->dat[0xf] & 0x20);
|
||||||
if(d->dat[0x6] & 0x04) poke16(d->dat, 0xc, peek16(d->dat, 0xc) + 16); /* auto addr+16 */
|
if(d->dat[0x6] & 0x04) poke16(d->dat, 0xc, peek16(d->dat, 0xc) + 16); /* auto addr+16 */
|
||||||
} else {
|
} else {
|
||||||
ppu_1bpp(&ppu, layer, x, y, addr, d->dat[0xf] & 0xf, d->dat[0xf] & 0x10, d->dat[0xf] & 0x20);
|
ppu_1bpp(&ppu, layer ? ppu.fg : ppu.bg, x, y, addr, d->dat[0xf] & 0xf, d->dat[0xf] & 0x10, d->dat[0xf] & 0x20);
|
||||||
if(d->dat[0x6] & 0x04) poke16(d->dat, 0xc, peek16(d->dat, 0xc) + 8); /* auto addr+8 */
|
if(d->dat[0x6] & 0x04) poke16(d->dat, 0xc, peek16(d->dat, 0xc) + 8); /* auto addr+8 */
|
||||||
}
|
}
|
||||||
if(d->dat[0x6] & 0x01) poke16(d->dat, 0x8, x + 8); /* auto x+8 */
|
if(d->dat[0x6] & 0x01) poke16(d->dat, 0x8, x + 8); /* auto x+8 */
|
||||||
if(d->dat[0x6] & 0x02) poke16(d->dat, 0xa, y + 8); /* auto y+8 */
|
if(d->dat[0x6] & 0x02) poke16(d->dat, 0xa, y + 8); /* auto y+8 */
|
||||||
|
ppu.reqdraw = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -546,7 +542,7 @@ run(Uxn *u)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
uxn_eval(u, devscreen->vector);
|
uxn_eval(u, devscreen->vector);
|
||||||
if(reqdraw || ppu.reqdraw || devsystem->dat[0xe])
|
if(ppu.reqdraw || devsystem->dat[0xe])
|
||||||
redraw(u);
|
redraw(u);
|
||||||
if(!BENCH) {
|
if(!BENCH) {
|
||||||
elapsed = (SDL_GetPerformanceCounter() - start) / (double)SDL_GetPerformanceFrequency() * 1000.0f;
|
elapsed = (SDL_GetPerformanceCounter() - start) / (double)SDL_GetPerformanceFrequency() * 1000.0f;
|
||||||
|
|
Loading…
Reference in New Issue