cpowell / ruby-entity-component-framework Goto Github PK
View Code? Open in Web Editor NEWA JRuby entity-component framework for game programming.
License: Other
A JRuby entity-component framework for game programming.
License: Other
Play the game, fly off the screen
Exit the game
run the game again, hit 'P', exception thrown
(Windows 7 64bit)
I wrote a begin .. rescue.. end around the Marshal.load code, and it's loading the file because when I hit 'P' to play it says 'You win!'. Not sure how to fix it though.
Error:
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: org.jruby.exceptions.RaiseException: (ArgumentError) dump format error(
)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:111)
Caused by: org.jruby.exceptions.RaiseException: (ArgumentError) dump format error(
)
at org.jruby.RubyMarshal.load(org/jruby/RubyMarshal.java:148)
at RUBY.show(C:/Users/ben/Documents/GitHub/ruby-entity-component-framework/lib/ruby/playing_state.rb:44)
at PlayingState_366901582.show(PlayingState_366901582.gen:13)
at StartupState.render(C:/Users/ben/Documents/GitHub/ruby-entity-component-framework/lib/ruby/startup_state.rb:54)
at StartupState_366901585.render(StartupState_366901585.gen:13)
I just pulled the code and ran ./run.sh and this is the output:
I, [2013-01-12T22:49:11.701000 #16949] INFO -- : Uses The Ruby Entity-Component Framework, Copyright 2012 Prylis Inc. I, [2013-01-12T22:49:12.180000 #16949] INFO -- : See https://github.com/cpowell/ruby-entity-component-framework I, [2013-01-12T22:49:12.182000 #16949] INFO -- : Please preserve this notice in your own games. Thanks for playing fair! Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: com.badlogic.gdx.utils.GdxRuntimeException: Texture width and height must be powers of two: 640x480 at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:111) Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Texture width and height must be powers of two: 640x480 at com.badlogic.gdx.graphics.Texture.uploadImageData(Texture.java:204) at com.badlogic.gdx.graphics.Texture.load(Texture.java:179) at com.badlogic.gdx.graphics.Texture.create(Texture.java:159) at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:133) at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:122) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at org.jruby.javasupport.JavaConstructor.newInstanceDirect(JavaConstructor.java:275) at org.jruby.java.invokers.ConstructorInvoker.call(ConstructorInvoker.java:91) at org.jruby.java.invokers.ConstructorInvoker.call(ConstructorInvoker.java:178) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:336) at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:179) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:183) at org.jruby.java.proxies.ConcreteJavaProxy$2.call(ConcreteJavaProxy.java:52) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:336) at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:179) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:183) at org.jruby.RubyClass.newInstance(RubyClass.java:855) at org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen) at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroOrOneOrNBlock.call(JavaMethod.java:278) at org.jruby.java.proxies.ConcreteJavaProxy$3.call(ConcreteJavaProxy.java:148) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170) at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57) at org.jruby.ast.InstAsgnNode.interpret(InstAsgnNode.java:95) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105) at org.jruby.ast.BlockNode.interpret(BlockNode.java:71) at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75) at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:112) at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:154) at StartupState_796620960.show(StartupState_796620960.gen:13) at com.badlogic.gdx.Game.setScreen(Game.java:59) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:455) at org.jruby.javasupport.JavaMethod.tryProxyInvocation(JavaMethod.java:631) at org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:313) at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:61) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170) at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105) at org.jruby.ast.BlockNode.interpret(BlockNode.java:71) at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75) at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:112) at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:126) at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:163) at org.jruby.javasupport.proxy.JavaProxyConstructor$2.invoke(JavaProxyConstructor.java:224) at org.jruby.proxy.com.badlogic.gdx.Game$Proxy0.create(Unknown Source) at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:125) at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:108)
I'm running archlinux i386 uname -a:
Linux SpellBook 3.6.11-1-ARCH #1 SMP PREEMPT Tue Dec 18 12:58:46 CET 2012 i686 GNU/Linux
java -version:
java version "1.7.0_09" OpenJDK Runtime Environment (IcedTea7 2.3.3) (ArchLinux build 7.u9_2.3.3-1-i686) OpenJDK Client VM (build 23.2-b09, mixed mode)
jruby -v:
jruby 1.7.2 (1.9.3p327) 2013-01-04 302c706 on OpenJDK Client VM 1.7.0_09-b30 [linux-i386]
Am I doing something wrong? Just trying to test the code, I'm a newbie to jruby. I have run bundle and installed the proper gems as well. Does this code require a specific jruby/java version or is this intended behavior? It seems to me cfg.useGL20 = true in bin/main.rb should allow loading NPOT textures so somehow I don't think this is getting set right. Please advise.
JRuby 1.7.10 currently raises a TypeError when the sample game is exited using the Escape key. Specifically, the offending line is in lib/ruby/playing_state.rb
, line 143. Marshal.dump
is being called on the EntityManager
instance, which uses a hash with a default proc for its @component_stores
instance variable -- but JRuby can't dump a hash with a default proc.
Tested in Fedora 20 with JRuby 1.7.10. Will try testing on a Windows box when I have one available.
% ruby -v
jruby 1.7.10 (1.9.3p392) 2014-01-09 c4ecd6b on OpenJDK 64-Bit Server VM 1.7.0_51-mockbuild_2014_01_17_13_38-b00 [linux-amd64]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.