posx/posy args added to soso to support window placement
This commit is contained in:
parent
055456a023
commit
e1ddbf30a0
@ -1,7 +1,7 @@
|
|||||||
//doomgeneric for soso os
|
//doomgeneric for soso os
|
||||||
|
|
||||||
#include "doomkeys.h"
|
#include "doomkeys.h"
|
||||||
|
#include "m_argv.h"
|
||||||
#include "doomgeneric.h"
|
#include "doomgeneric.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -22,6 +22,9 @@ static unsigned short s_KeyQueue[KEYQUEUE_SIZE];
|
|||||||
static unsigned int s_KeyQueueWriteIndex = 0;
|
static unsigned int s_KeyQueueWriteIndex = 0;
|
||||||
static unsigned int s_KeyQueueReadIndex = 0;
|
static unsigned int s_KeyQueueReadIndex = 0;
|
||||||
|
|
||||||
|
static unsigned int s_PositionX = 0;
|
||||||
|
static unsigned int s_PositionY = 0;
|
||||||
|
|
||||||
static unsigned char convertToDoomKey(unsigned char scancode)
|
static unsigned char convertToDoomKey(unsigned char scancode)
|
||||||
{
|
{
|
||||||
unsigned char key = 0;
|
unsigned char key = 0;
|
||||||
@ -133,6 +136,21 @@ void DG_Init()
|
|||||||
//enter non-blocking mode
|
//enter non-blocking mode
|
||||||
syscall_ioctl(KeyboardFd, 1, (void*)1);
|
syscall_ioctl(KeyboardFd, 1, (void*)1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int argPosX = 0;
|
||||||
|
int argPosY = 0;
|
||||||
|
|
||||||
|
argPosX = M_CheckParmWithArgs("-posx", 1);
|
||||||
|
if (argPosX > 0)
|
||||||
|
{
|
||||||
|
sscanf(myargv[argPosX + 1], "%d", &s_PositionX);
|
||||||
|
}
|
||||||
|
|
||||||
|
argPosY = M_CheckParmWithArgs("-posy", 1);
|
||||||
|
if (argPosY > 0)
|
||||||
|
{
|
||||||
|
sscanf(myargv[argPosY + 1], "%d", &s_PositionY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handleKeyInput()
|
static void handleKeyInput()
|
||||||
@ -173,7 +191,7 @@ void DG_DrawFrame()
|
|||||||
|
|
||||||
for (int i = 0; i < DOOMGENERIC_RESY; ++i)
|
for (int i = 0; i < DOOMGENERIC_RESY; ++i)
|
||||||
{
|
{
|
||||||
memcpy(FrameBuffer + i * screenWidth, DG_ScreenBuffer + i * DOOMGENERIC_RESX, DOOMGENERIC_RESX * 4);
|
memcpy(FrameBuffer + s_PositionX + (i + s_PositionY) * screenWidth, DG_ScreenBuffer + i * DOOMGENERIC_RESX, DOOMGENERIC_RESX * 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user