fiserfd
This commit is contained in:
+8
-2
@@ -962,7 +962,13 @@ void Engine::Initiate()
|
|||||||
testcharacter->Step(deltatime);
|
testcharacter->Step(deltatime);
|
||||||
npc->Step(deltatime);
|
npc->Step(deltatime);
|
||||||
soundsystem->Update();
|
soundsystem->Update();
|
||||||
physicsengine->Step(deltatime);
|
// Split into equal substeps of at most 1/120 s so jump arcs, falling and collisions
|
||||||
|
// come out the same whatever the frame rate
|
||||||
|
{
|
||||||
|
const int substeps = std::max(1, (int)std::ceil(deltatime * 120.0f));
|
||||||
|
const float subDt = deltatime / float(substeps);
|
||||||
|
for (int i = 0; i < substeps; i++) physicsengine->Step(subDt);
|
||||||
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
// LAN: send our transform, apply the other player's
|
// LAN: send our transform, apply the other player's
|
||||||
@@ -1055,7 +1061,7 @@ void key_callback(GLFWwindow* window, int key, int scancode, int action, int mod
|
|||||||
{
|
{
|
||||||
// F11: toggle fullscreen on the primary monitor, restoring the old window rect on exit
|
// F11: toggle fullscreen on the primary monitor, restoring the old window rect on exit
|
||||||
if (key == GLFW_KEY_F11 && action == GLFW_PRESS) {
|
if (key == GLFW_KEY_F11 && action == GLFW_PRESS) {
|
||||||
static int wx = 100, wy = 100, ww = 1280, wh = 720;
|
static int wx = 100, wy = 100, ww = 1920, wh = 1080;
|
||||||
if (glfwGetWindowMonitor(window)) {
|
if (glfwGetWindowMonitor(window)) {
|
||||||
glfwSetWindowMonitor(window, nullptr, wx, wy, ww, wh, 0);
|
glfwSetWindowMonitor(window, nullptr, wx, wy, ww, wh, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ int main() {
|
|||||||
mouse = new Mouse();
|
mouse = new Mouse();
|
||||||
keyboard = new Keyboard();
|
keyboard = new Keyboard();
|
||||||
|
|
||||||
window = new Window(1280,720,"EIIFWHRN");
|
window = new Window(1920,1080,"EIIFWHRN");
|
||||||
soundsystem = new SoundSystem();
|
soundsystem = new SoundSystem();
|
||||||
resourcemanager = new ResourceManager();
|
resourcemanager = new ResourceManager();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user