Upgrading Forge's Sprite APIs to 1.2

A place to talk to other users about the mod.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Upgrading Forge's Sprite APIs to 1.2

Post by FlowerChild »

Kinniken wrote:
FlowerChild wrote:Hey man, yeah, I was planning on PMing you that, but was totally burned out last night after wrapping this thing up for the new release. Give me a chance to have come coffee & cigarettes and I'll get that right to you :)
Take your time man, it's not to the minute ;) I doubt I'll release anything tonight, I'm deep in my own debugging. I know many of my users will be happy not to be dependent on Forge anymore though!
Well, I just PMed it to you, so no time taking required ;)

Let me know if you have any problems. Keep in mind that if you get compile errors, we may be using a different version of the MCP names or what have you, so you might have to fix that part manually.
Kinniken
Posts: 55
Joined: Sat Jan 28, 2012 11:14 am

Re: Upgrading Forge's Sprite APIs to 1.2

Post by Kinniken »

Great, thanks. i'll check it out. Does it include any other feature than the sprites?
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Upgrading Forge's Sprite APIs to 1.2

Post by FlowerChild »

Kinniken wrote:Great, thanks. i'll check it out. Does it include any other feature than the sprites?
Nope, it's just the infinite textures thing, and you're welcome :)

I really appreciate all the work you put into making Millenaire compatible with BTW, so it's the least I could do.
Kinniken
Posts: 55
Joined: Sat Jan 28, 2012 11:14 am

Re: Upgrading Forge's Sprite APIs to 1.2

Post by Kinniken »

Well, I have many players who play both, so I wouldn't want to force them to chose one or the other ;)

Oh, and unless you object, it's more than time I added you to my Millénaire Hall of Fame building.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Upgrading Forge's Sprite APIs to 1.2

Post by FlowerChild »

Oh, and BTW, you'll probably figure this out just by looking at it, but all changes from the original vanilla source-files are bracketed by:

// FCMOD: foo

and

// END FCMOD

With foo being a brief explanation of what is done to the code. Generally, the original code is left in place, commented out, which makes it easier to recognize what code has changed from one version to another, and if the modifications need to be adjusted accordingly.

Anyways, hopefully we won't have to do this again for another MC release, but if we do, those comments should make the process a lot easier for you if you want to tackle it on your own next time.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Upgrading Forge's Sprite APIs to 1.2

Post by FlowerChild »

Kinniken wrote:Well, I have many players who play both, so I wouldn't want to force them to chose one or the other ;)

Oh, and unless you object, it's more than time I added you to my Millénaire Hall of Fame building.
Hehe...I'd be flattered man, thanks :)
Kinniken
Posts: 55
Joined: Sat Jan 28, 2012 11:14 am

Re: Upgrading Forge's Sprite APIs to 1.2

Post by Kinniken »

Done:

Image

Image
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Upgrading Forge's Sprite APIs to 1.2

Post by FlowerChild »

Kinniken wrote:Done:
Wow, thanks man! I'm very touched :)

May I ask you remove the "Forge sprite API" thing though? That code isn't mine (it was written by Eloraam), and I'd prefer people not think I'm trying to take credit for it given the overall political situation involved :)
Kinniken
Posts: 55
Joined: Sat Jan 28, 2012 11:14 am

Re: Upgrading Forge's Sprite APIs to 1.2

Post by Kinniken »

Euh, good point!

I'll add Eloraam alongside you with "Original code for Forge Sprites" and put you as "Help with Forge Sprite API". Would that be fine?

Otherwise, unfortunately I've just tried adding your code to a clean MCP6 base and I'm still getting that crash (without Millénaire running). Any idea?
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Upgrading Forge's Sprite APIs to 1.2

Post by FlowerChild »

Kinniken wrote:Euh, good point!

I'll add Eloraam alongside you with "Original code for Forge Sprites" and put you as "Help with Forge Sprite API". Would that be fine?
Sure, that sounds good man :)
Kinniken wrote: Otherwise, unfortunately I've just tried adding your code to a clean MCP6 base and I'm still getting that crash (without Millénaire running). Any idea?
Doh! Man, that really surprises me, and unfortunately that error really doesn't mean anything to me. Any chance you can step through the code in debug and try to narrow down what's causing it?
Kinniken
Posts: 55
Joined: Sat Jan 28, 2012 11:14 am

Re: Upgrading Forge's Sprite APIs to 1.2

Post by Kinniken »

Hmm, how do I do that? I never tried using the debugger with MC.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Upgrading Forge's Sprite APIs to 1.2

Post by FlowerChild »

Kinniken wrote:Hmm, how do I do that? I never tried using the debugger with MC.
Well, it's only really possible if you're using a development environment like Eclipse. Are you not doing that?
Kinniken
Posts: 55
Joined: Sat Jan 28, 2012 11:14 am

Re: Upgrading Forge's Sprite APIs to 1.2

Post by Kinniken »

I'm using Eclipse, and I've used the debug tool in Eclipse in the past in other projects. I'm just not sure as to how to launch MCP from Eclipse.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Upgrading Forge's Sprite APIs to 1.2

Post by FlowerChild »

Kinniken wrote:I'm using Eclipse, and I've used the debug tool in Eclipse in the past in other projects. I'm just not sure as to how to launch MCP from Eclipse.
You mean launch the game right? This shouldn't involve launching MCP.

If you're using the Eclipse project bundled with MCP, you should be able to launch the game in debug using F11. You'll need to set breakpoints within the code (F9) to stop execution at various points and then step through the code to find out where the crash happens.
Kinniken
Posts: 55
Joined: Sat Jan 28, 2012 11:14 am

Re: Upgrading Forge's Sprite APIs to 1.2

Post by Kinniken »

Ah, right! I had never used the pre-configured Eclipse project, I always made my own. Ok, I'll try debuggging.

In any case, I tried the compiled classes in a Minecraft jar, and they worked fine, so I can release it :) Finding out what is going wrong in MCP is less urgent.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Upgrading Forge's Sprite APIs to 1.2

Post by FlowerChild »

Kinniken wrote:Ah, right! I had never used the pre-configured Eclipse project, I always made my own. Ok, I'll try debuggging.

In any case, I tried the compiled classes in a Minecraft jar, and they worked fine, so I can release it :) Finding out what is going wrong in MCP is less urgent.
Cool stuff man. Glad you figured out a way around it :)
Kinniken
Posts: 55
Joined: Sat Jan 28, 2012 11:14 am

Re: Upgrading Forge's Sprite APIs to 1.2

Post by Kinniken »

Hey man, quick question on Forge's texture handling - don't bother if you don't know it off the top of your head ;) Is there a simple way to check the size of the texture pack currently being used? I.e whether it's a 16x, 32x, etc?
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Upgrading Forge's Sprite APIs to 1.2

Post by FlowerChild »

Kinniken wrote:Hey man, quick question on Forge's texture handling - don't bother if you don't know it off the top of your head ;) Is there a simple way to check the size of the texture pack currently being used? I.e whether it's a 16x, 32x, etc?
Yikes. No idea :)

Isn't some kind of external patch required for textures beyond 16x?
User avatar
Battosay
Posts: 2043
Joined: Mon Jul 04, 2011 7:37 pm

Re: Upgrading Forge's Sprite APIs to 1.2

Post by Battosay »

FlowerChild wrote:Isn't some kind of external patch required for textures beyond 16x?
Yep.
Jeb mentioned adding higher resolution support soon, which means that it's not in yet ;)
Kinniken
Posts: 55
Joined: Sat Jan 28, 2012 11:14 am

Re: Upgrading Forge's Sprite APIs to 1.2

Post by Kinniken »

Someone on the MCP IRC chan gave me a solution that seems to work fine:

GL11.glBindTexture(GL11.GL_TEXTURE_2D, ModLoader.getMinecraftInstance().renderEngine.getTexture("/terrain.png"));
MLN.textureSize = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH)/16;

It's not dependent on MCPatcher or any other HD solution, it works fine even with just Forge.
Kinniken
Posts: 55
Joined: Sat Jan 28, 2012 11:14 am

Re: Upgrading Forge's Sprite APIs to 1.2

Post by Kinniken »

Well, it's update time again ;)

Strangely enough, this time I got it to work while in dev mode using MCP without too much issues, just reusing the 1.2.3 classes you had provided with minor updates to account for method name changes. However, it crashes with a black screen when packaged:

Code: Select all

Mod Initialized: mod_Millenaire 2.4.7
Mod Loaded: mod_Millenaire 2.4.7
Done.
Restoring disabled mods
Loading: net.java.games.input.OSXEnvironmentPlugin
########## GL ERROR ##########
@ Pre startup
1286: Invalid framebuffer operation

Starting up SoundSystem...
Initializing LWJGL OpenAL
    (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
OpenAL initialized.

########## GL ERROR ##########
@ Post render
1286: Invalid framebuffer operation
########## GL ERROR ##########
@ Post render
1286: Invalid framebuffer operation
I'll ask some users to test it, to see if it's just an error for me.
User avatar
embirrim
Posts: 814
Joined: Sat Dec 03, 2011 2:09 pm
Location: Portugal

Re: Upgrading Forge's Sprite APIs to 1.2

Post by embirrim »

I can't guarantee but I believe FC is not planning on updating to 1.2.4. If that's what you're talking about :P
Just a heads-up, as I'm sure he'll be glad to help.
Kinniken
Posts: 55
Joined: Sat Jan 28, 2012 11:14 am

Re: Upgrading Forge's Sprite APIs to 1.2

Post by Kinniken »

If true that's bad news for me. Ah well :P
Kinniken
Posts: 55
Joined: Sat Jan 28, 2012 11:14 am

Re: Upgrading Forge's Sprite APIs to 1.2

Post by Kinniken »

Ok, the problem must have been with my Minecraft install, because I started again from scratch installing both ModLoader and the Forge Sprite classes manually and it's working fine.
Post Reply