mirror of https://github.com/adamdruppe/arsd.git
wrong version
This commit is contained in:
parent
8616028534
commit
ed61b3ce0b
20
cgi.d
20
cgi.d
|
@ -343,6 +343,26 @@ class Cgi {
|
|||
CommandLine }
|
||||
|
||||
|
||||
/+
|
||||
/++
|
||||
Cgi provides a per-request memory pool
|
||||
|
||||
+/
|
||||
void[] allocateMemory(size_t nBytes) {
|
||||
|
||||
}
|
||||
|
||||
/// ditto
|
||||
void[] reallocateMemory(void[] old, size_t nBytes) {
|
||||
|
||||
}
|
||||
|
||||
/// ditto
|
||||
void freeMemory(void[] memory) {
|
||||
|
||||
}
|
||||
+/
|
||||
|
||||
|
||||
/*
|
||||
import core.runtime;
|
||||
|
|
|
@ -115,7 +115,10 @@ class GameHelperBase {
|
|||
/// The virtual digital controllers are best to use if that model fits you because it
|
||||
/// works with several kinds of controllers as well as keyboards.
|
||||
|
||||
JoystickUpdate joystick1;
|
||||
JoystickUpdate joysticks[4];
|
||||
ref JoystickUpdate joystick1() { return joysticks[0]; }
|
||||
|
||||
bool[256] keyboardState;
|
||||
}
|
||||
|
||||
/// The max rates are given in executions per second
|
||||
|
@ -135,11 +138,11 @@ void runGame(T : GameHelperBase)(T game, int maxUpdateRate = 20, int maxRedrawRa
|
|||
|
||||
window.eventLoop(1000 / maxUpdateRate,
|
||||
delegate() {
|
||||
if(joystickPlayers) {
|
||||
foreach(p; 0 .. joystickPlayers) {
|
||||
version(linux)
|
||||
readJoystickEvents(joystickFds[0]);
|
||||
auto update = getJoystickUpdate(0);
|
||||
game.joystick1 = update;
|
||||
readJoystickEvents(joystickFds[p]);
|
||||
auto update = getJoystickUpdate(p);
|
||||
game.joysticks[p] = update;
|
||||
} else assert(0);
|
||||
|
||||
auto now = MonoTime.currTime;
|
||||
|
@ -151,6 +154,7 @@ void runGame(T : GameHelperBase)(T game, int maxUpdateRate = 20, int maxRedrawRa
|
|||
},
|
||||
|
||||
delegate (KeyEvent ke) {
|
||||
game.keyboardState[ke.hardwareCode] = ke.pressed;
|
||||
// FIXME
|
||||
}
|
||||
);
|
||||
|
|
|
@ -198,7 +198,7 @@ version(linux) {
|
|||
joystickMapping[player] = &xbox360Mapping;
|
||||
}
|
||||
} else if(event.number == 6) {
|
||||
if(event.value == 32767 && joystickMapping[player] is null) {
|
||||
if((event.value == 32767 || event.value == -32767) && joystickMapping[player] is null) {
|
||||
joystickMapping[player] = &ps1Mapping;
|
||||
}
|
||||
}
|
||||
|
|
13
script.d
13
script.d
|
@ -1,3 +1,16 @@
|
|||
/*
|
||||
REPL plan:
|
||||
easy movement to/from a real editor
|
||||
can edit a specific function
|
||||
repl is a different set of globals
|
||||
maybe ctrl+enter to execute vs insert another line
|
||||
|
||||
write state to file
|
||||
read state from file
|
||||
state consists of all variables and source to functions
|
||||
|
||||
Steal Ruby's [regex, capture] maybe
|
||||
*/
|
||||
/++
|
||||
A small script interpreter that builds on [arsd.jsvar] to be easily embedded inside and to have has easy
|
||||
two-way interop with the host D program. The script language it implements is based on a hybrid of D and Javascript.
|
||||
|
|
|
@ -819,7 +819,7 @@ version(Windows) {
|
|||
|
||||
pragma(lib, "gdi32");
|
||||
pragma(lib, "user32");
|
||||
} else version (Posix) {
|
||||
} else version (linux) {
|
||||
//k8: this is hack for rdmd. sorry.
|
||||
static import core.sys.linux.epoll;
|
||||
static import core.sys.linux.timerfd;
|
||||
|
@ -8288,7 +8288,7 @@ version(X11) {
|
|||
// set the pid property for lookup later by window managers
|
||||
// a standard convenience
|
||||
import core.sys.posix.unistd;
|
||||
uint pid = getpid();
|
||||
arch_ulong pid = getpid();
|
||||
|
||||
XChangeProperty(
|
||||
display,
|
||||
|
|
Loading…
Reference in New Issue