Quote:
I've not been keeping up with journals as much as I'd like, but I remember you writing about jobs a while back. You've got somewhere with it I take it?
Firstly, tsk at not reading journals, anyone would think you have a job or something [grin]
On the job front however, the job in question isn't any of the ones I've mentioned to you in the past.
The one with NaturalMotion is obviously a bust I'd have said, about a month without hearing anything tends to hint at that [wink]. The other one which was an outside possibility was with at the same company as a friend of mine in the TV subtitling business; how ever totally unshockingly nothing came of that [grin]
The job in question is with a friend of mine from my degree course. Only going to be a few mornings a week, however it keeps the bills paied and me in vodka so it works out perfectly from that point of view [smile].
For the record it takes me about 20mins to cycle from my house to his 'office' in a converted barn outside of town; that's with flatish tires on my bike as well, heh.
In other news, I was saying in the last entry about how default values were a problem, certainly where colours were concerned. Well, with that in mind I've gone back and made an adjustment to the 'getColorFromTable' function.
Instead of blindly reading 4 keys and hoping for the best it instead walks over the table, checking the key value for the 4 colour codes and setting the value. On startup the function sets the value to 'sane' numbers; rgb = 0, a = 255. I figure full alpha is going to be the most likely required usage pattern and rbg should nearly always all be there.
void getColorFromTable(lua_State *L, int index, GLubyte *colour){ lua_pushnil(L); if(index < 0) index -= 1; colour[0] = colour[1] = colour [2] = 0; colour[3] = 255; // default to full on for when we have no alpha information so that it's sane while(lua_next(L,index)) { lua_pushvalue(L,-2); const char * key = lua_tolstring(L,-1,NULL); if(key != NULL) { switch(key[0]) { case 'r': case 'R': colour[0] = lua_tointeger(L,-2); break; case 'g': case 'G': colour[1] = lua_tointeger(L,-2); break; case 'b': case 'B': colour[2] = lua_tointeger(L,-2); break; case 'a': case 'A': colour[3] = lua_tointeger(L,-2); break; } } lua_pop(L,2); // remove the duplicate of the 'key' and the value }}
Maybe not as fast but certainly more 'correct' and correctness is more important than speed at this point; if you want speed when it comes to colour setting functions you can always supply rgb(a) seperately instead and void this routine all together.
I'm as yet to decide if the number/float and integer extraction routines need changing; 0 seems reasonably for them imo.
Tonight I'm going to change the event model; namely make one *chuckles*
At the moment all you can check for is the window closing, so I'm going to add support for returning all the events which have happened since the last time the query function was called; this is somewhat modeled after Pygame in that regard (and I guess VB6 as I'm pretty sure that had an event type as well.
This also means keyboard entry of data can be done [smile]
This'll be in the 'input' module I think as events are input after all.
Glad you will be able to pay the vodka bills though and you can always bring a hip flask to help you through that 20 minute cycle [wink]