Exemple #1
0
def Init():
    """Initialise everything. Run once on startup"""
    w,h = (1280,720)
    globals.tile_scale            = Point(1,1)
    globals.scale                 = Point(3,3)
    globals.screen                = Point(w,h)/globals.scale
    globals.screen_root           = ui.UIRoot(Point(0,0),globals.screen)
    globals.quad_buffer           = drawing.QuadBuffer(131072)
    globals.screen_texture_buffer = drawing.QuadBuffer(131072)
    globals.ui_buffer             = drawing.QuadBuffer(131072)
    globals.nonstatic_text_buffer = drawing.QuadBuffer(131072)
    globals.colour_tiles          = drawing.QuadBuffer(131072)
    globals.mouse_relative_buffer = drawing.QuadBuffer(1024)
    globals.line_buffer           = drawing.LineBuffer(16384)
    globals.tile_dimensions       = Point(16,16)*globals.tile_scale
    globals.sounds                = sounds.Sounds()
    globals.zoom_scale            = None

    globals.dirs = globals.types.Directories('resource')

    pygame.init()
    screen = pygame.display.set_mode((w,h),pygame.OPENGL|pygame.DOUBLEBUF)
    pygame.display.set_caption('The Gosh Signal')
    drawing.Init(globals.screen.x,globals.screen.y)

    globals.text_manager = drawing.texture.TextManager()
Exemple #2
0
def Init():
    """Initialise everything. Run once on startup"""
    w, h = (1920, 1080)
    globals.tile_scale = Point(1, 1)
    globals.scale = Point(1, 1)
    globals.screen_abs = Point(w, h)
    globals.screen = globals.screen_abs / globals.scale
    globals.screen_root = ui.UIRoot(Point(0, 0), globals.screen_abs)
    globals.mouse_screen = Point(0, 0)

    globals.quad_buffer = drawing.QuadBuffer(131072)
    globals.screen_texture_buffer = drawing.QuadBuffer(131072, ui=True)
    globals.ui_buffer = drawing.QuadBuffer(131072, ui=True)
    globals.nonstatic_text_buffer = drawing.QuadBuffer(131072, ui=True)
    globals.colour_tiles = drawing.QuadBuffer(131072)
    globals.mouse_relative_buffer = drawing.QuadBuffer(1024,
                                                       ui=True,
                                                       mouse_relative=True)
    globals.line_buffer = drawing.LineBuffer(16384)
    globals.tile_dimensions = Point(16, 16) * globals.tile_scale
    globals.zoom_scale = None
    globals.time_step = 0.05
    globals.processing = False

    globals.dirs = globals.types.Directories('resource')

    pygame.init()
    screen = pygame.display.set_mode((w, h), pygame.OPENGL | pygame.DOUBLEBUF)
    pygame.display.set_caption('Pathfinder')

    drawing.Init(globals.screen.x, globals.screen.y)
    pygame.mouse.set_visible(False)
    globals.text_manager = drawing.texture.TextManager()
def Init():
    """Initialise everything. Run once on startup"""
    #w,h = (1600,1100)
    w, h = (1280, 720)
    globals.tile_scale = Point(1, 1)
    globals.scale = Point(2, 2)
    globals.screen_abs = Point(w, h)
    globals.screen = globals.screen_abs / globals.scale
    globals.screen_root = ui.UIRoot(Point(0, 0), globals.screen_abs)
    globals.mouse_screen = Point(0, 0)
    globals.lights = []
    globals.cone_lights = []
    globals.non_shadow_lights = []
    globals.uniform_lights = []

    globals.quad_buffer = drawing.QuadBuffer(131072)
    globals.screen_texture_buffer = drawing.QuadBuffer(131072, ui=True)
    globals.ui_buffer = drawing.QuadBuffer(131072, ui=True)
    globals.nonstatic_text_buffer = drawing.QuadBuffer(131072, ui=True)
    globals.light_quads = drawing.QuadBuffer(16384)
    globals.nightlight_quads = drawing.QuadBuffer(16)
    globals.temp_mouse_light = drawing.QuadBuffer(16)
    globals.colour_tiles = drawing.QuadBuffer(131072)
    globals.mouse_relative_buffer = drawing.QuadBuffer(1024,
                                                       ui=True,
                                                       mouse_relative=True)
    globals.line_buffer = drawing.LineBuffer(16384)
    globals.shadow_quadbuffer = drawing.ShadowQuadBuffer(256 * 4)
    globals.temp_mouse_shadow = globals.shadow_quadbuffer.NewLight()
    globals.tile_dimensions = Point(16, 16) * globals.tile_scale
    globals.sounds = sounds.Sounds()
    globals.zoom_scale = None
    globals.time_step = 0.05

    #WTF?
    globals.mouse_light_quad = drawing.Quad(globals.temp_mouse_light)
    #globals.mouse_light_quad.SetVertices(Point(0,0),
    #                                         Point(500,500),10)
    #globals.mouse_light_quad.Disable()

    globals.dirs = globals.types.Directories('resource')

    pygame.init()
    screen = pygame.display.set_mode((w, h), pygame.OPENGL | pygame.DOUBLEBUF)
    pygame.display.set_caption('Rogue Planet')
    drawing.Init(globals.screen.x, globals.screen.y)

    globals.text_manager = drawing.texture.TextManager()