Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Obscure, Incomprehensible and just plain Broken

Sign in to follow this  


I was off work this week. Tomorrow could be interesting since I think the code I checked in just before I left might have broken the build. It should only be a small break, but unfortunately build success is a binary state - the build is either broken or it's not. I did email them about it with steps to fix so hopefully it won't have been much of a problem.

I spent my week working on the Jpeg2000 loader again, working through the new source code I talked about last month. Also Christmas shopping, playing DHTML Lemmings and various other random activities, so not actually as much time on the loader as I'd been intending.

The new source code is still pretty awful:
int i,k1,k2,k3,k4,l;           // counters
int tmp1,tmp2,tmp3,tmp4; // temporary storage for sample values
int mv1,mv2,mv3,mv4; // max value for each component
int ls1,ls2,ls3,ls4; // level shift for each component
int fb1,fb2,fb3,fb4; // fractional bits for each component
int[] data1,data2,data3,data4; // references to data buffers
final ImageConsumer[] cons; // image consumers cache
int hints; // hints to image consumers
int height; // image height
int width; // image width
int pixbuf[]; // line buffer for pixel data
DataBlkInt db1,db2,db3,db4; // data-blocks to request data from src
int tOffx, tOffy; // Active tile offset
boolean prog; // Flag for progressive data
Coord nT = src.getNumTiles(null);
// 38 lines which don't modify nT or src
// getNumTiles is a non-modifying getter
nT = src.getNumTiles(null);
Not to mention the seemingly everpresent "what, you mean some people don't use the same size tabs as me" interchange of tabs and spaces for indentation. I really ought to find a beautifier. Still, it's easier to work through that the jasper source. Feels a bit strange to be working with Java again though.

Next weeks installment will either be a day early or won't get written, since I'm away for Christmas as of next Sunday.

Sign in to follow this  

1 Comment

Recommended Comments

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!