Skip to content

Commit

Permalink
Merge pull request #68 from somePythonProgrammer/main
Browse files Browse the repository at this point in the history
Adding cross-platform support + more efficient chunk generation
  • Loading branch information
N3RDIUM committed Aug 24, 2022
2 parents f436b6d + e5057f4 commit 89b19f1
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion __main__.py
Expand Up @@ -55,7 +55,7 @@
glHint(GL_FOG_HINT, GL_DONT_CARE)
glFogi(GL_FOG_MODE, GL_LINEAR)
glFogf(GL_FOG_START, CHUNK_SIZE*2)
glFogf(GL_FOG_END, (world.render_distance+2) * CHUNK_SIZE)
glFogf(GL_FOG_END, (world.render_distance - 1) * CHUNK_SIZE)

# get window size
def get_window_size():
Expand Down
1 change: 0 additions & 1 deletion core/fileutils.py
@@ -1,7 +1,6 @@
import os
import json
import threading
import sys

class ListenerBase:
def __init__(self, directory):
Expand Down
2 changes: 0 additions & 2 deletions core/renderer.py
Expand Up @@ -85,8 +85,6 @@ def shared_context(self, window):
except Exception as e:
pass

glfw.poll_events()
glfw.swap_buffers(window2)
glfw.terminate()

def create_vbo(self, window):
Expand Down
23 changes: 23 additions & 0 deletions launch.py
@@ -0,0 +1,23 @@
import sys
import subprocess
import pkg_resources

# make sure pip is installed
try:
pkg_resources.require("pip")
except pkg_resources.DistributionNotFound:
print("pip is not installed. Please install pip.")
sys.exit(1)

required = {'glfw', 'pygame', 'opensimplex', 'psutil', 'pyopengl', 'pyopengl-accelerate', 'numpy', 'pillow'}
installed = {pkg.key for pkg in pkg_resources.working_set}
missing = required - installed

if missing:
subprocess.Popen([sys.executable, '-m', 'pip', 'install', *missing]).wait()

# run git pull
subprocess.Popen(['git', 'pull']).wait()

# run the game
subprocess.Popen(['python', '__main__.py']).wait()
2 changes: 2 additions & 0 deletions terrain/chunk.py
@@ -1,4 +1,6 @@
import subprocess
import sys


from terrain.block import *
from core.renderer import *
Expand Down

0 comments on commit 89b19f1

Please sign in to comment.