Exemplo n.º 1
0
    elif o in ("-t", "--gametype"):
        gametype = a
    elif o in ("-c", "--config"):
        config = a
    else:
        sys.stderr.write("Unknown option %s\n" % o)
        usage()
        sys.exit()

# Tell Opde.Root to only create CORE services (those which are sufficient for tools, no renderer, etc)

# Logging - defaults to none. the line below would enable logging to opde.log in the current directory
# Which is good for debugging
# Log level : 0-4
if (debug != 0):
    opderoot = opde.createRoot(opde.services.SERVICE_CORE, "opde.log")
    opderoot.setLogLevel(4)
else:
    opderoot = opde.createRoot(opde.services.SERVICE_CORE)
    opderoot.setLogLevel(0)

# Opde logging can be done from python with Opde.log_debug, Opde.log_error and such functions (see bindings.h)
# Setup resources
# Should have some better way of providing the resource config...
# Loading resources autotmatically will result in an assert over here (No texture manager singleton)
# This file should better exist, otherwise an exception will jump up from the call...
opderoot.loadConfigFile(config)

# Just some resource path initializations
# These configurations should be based on some platform service
cfgsrv = opde.services.getConfigService()
Exemplo n.º 2
0
		config = a
	else:
		sys.stderr.write("Unknown option %s\n" % o)
		usage()
		sys.exit()



# Tell Opde.Root to only create CORE services (those which are sufficient for tools, no renderer, etc)


# Logging - defaults to none. the line below would enable logging to opde.log in the current directory
# Which is good for debugging
# Log level : 0-4 
if (debug != 0):
	opderoot = opde.createRoot(opde.services.SERVICE_CORE, "opde.log")
	opderoot.setLogLevel(4)
else:
	opderoot = opde.createRoot(opde.services.SERVICE_CORE)
	opderoot.setLogLevel(0)

# Opde logging can be done from python with Opde.log_debug, Opde.log_error and such functions (see bindings.h)
# Setup resources
# Should have some better way of providing the resource config...
# Loading resources autotmatically will result in an assert over here (No texture manager singleton)
# This file should better exist, otherwise an exception will jump up from the call...
opderoot.loadConfigFile(config)

# Just some resource path initializations
# These configurations should be based on some platform service
cfgsrv = opde.services.getConfigService()
Exemplo n.º 3
0
import opde

# TODO: We need to export service mask constants!
opderoot = opde.createRoot(opde.services.SERVICE_ALL)

opderoot.logToFile("opde.log")
opderoot.setLogLevel(4)

# Setup resources
opderoot.loadResourceConfig("thief1.cfg")
opderoot.loadConfigFile("opde.cfg")

# Load the dype scripts (this should vary depending on the game type)
# opderoot.loadDTypeScript("common.dtype", "General")
#opderoot.loadDTypeScript("t1-types.dtype", "General")
#opderoot.loadPLDefScript("t1-links.pldef", "General")
#opderoot.loadPLDefScript("t1-props.pldef", "General")

# Bootstrapping finished. We can progress wit the actual engine run
opderoot.bootstrapFinished()

# Service globals
lsrv = opde.services.getLoopService()
isrv = opde.services.getInputService()

# osrv = Services.ObjectService()


# ------------- State management -------------
# To sim menu switcher
# To be called from a key input handler
Exemplo n.º 4
0
import opde

# TODO: We need to export service mask constants!
opderoot = opde.createRoot(opde.services.SERVICE_ALL)

opderoot.logToFile("opde.log")
opderoot.setLogLevel(4)

# Setup resources
opderoot.loadResourceConfig("thief1.cfg")
opderoot.loadConfigFile("opde.cfg")

# Load the dype scripts (this should vary depending on the game type)
# opderoot.loadDTypeScript("common.dtype", "General")
#opderoot.loadDTypeScript("t1-types.dtype", "General")
#opderoot.loadPLDefScript("t1-links.pldef", "General")
#opderoot.loadPLDefScript("t1-props.pldef", "General")


# Bootstrapping finished. We can progress wit the actual engine run
opderoot.bootstrapFinished();

# Service globals
lsrv = opde.services.getLoopService()
isrv = opde.services.getInputService()
# osrv = Services.ObjectService()

# ------------- State management -------------
# To sim menu switcher
# To be called from a key input handler
def switchToSimMenu():