Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Adriweb

Pages: 1 ... 11 12 [13] 14 15 ... 115
181
TI-Nspire / Re: [Lua] Worms Clone
« on: August 03, 2014, 05:38:43 pm »
Very cool :)

I believe I don't have many things to say about the code layout, at least from what I quickly saw it looks well indented and pretty clear to read (classes and good (enough) seperation from code and paint :) )
What editor did you use, btw ?

And I like the intro :P

(I may have a few optimizations, for example, you already make good things, like localizing things etc., but here is a mistake :
Code: [Select]
function Player:tick(del)
    local floor,abs=math.floor,math.abs
...
The point of localizing the math functions is to not having Lua access the math table. Here it's still being accessed at each tick :P You could simply put the local out of the function :)
Sure, what you do is already better than nothing since the local version will be used for the loops calculations, but anyway, let's go all the way :D
(and localize every math functions you use, btw, it can't be bad.)
Also, I see you declare functions within the paint function... why ? I suppose you can just put them somewhere else (and add parameters if needed), so they just get defined once, that'll speed things up.

One more thing (but you already know about that :D) : Computerview/iPad support :P

182
News / Re: Nspire 3.9 available, blocks 3.6+Ndless
« on: August 02, 2014, 03:35:06 pm »
Hum, where ? :P

These looks like the changes related to PublishView (that's not Lua, but some kind of "presentation/page format" in which you can put Nspire apps)

183
TI-Nspire / Re: Jens' Script Editor - An on-calc lua editor
« on: July 21, 2014, 01:03:29 pm »
If you want/need a string.ulen function, here you go :
 
Code: [Select]
function string.ulen(s) return select(2, s:gsub('[^\128-\193]', '')) end
(from https://github.com/Pogs/lua-utf8-simple/blob/master/utf8_simple.lua )

184
TI-Nspire / Re: Jens' Script Editor - An on-calc lua editor
« on: July 20, 2014, 06:34:07 pm »
@CinusMinus : nah, no need to port Luna, the OS has all the functions needed to create/encrypt/compress the XML into a proper .tns ;)
But then, it's a matter of finding them all (might have been done already) and call them correctly.

185
TI-Nspire / Re: Jens' Script Editor - An on-calc lua editor
« on: July 20, 2014, 06:47:39 am »
Sure, but for those who have it installed, the features is available and for those who don't, it's just "hidden" (or does nothing).
Detecting if ndless is installed is just doing : "if ndless then ... end", I believe. (that's because Ndless adds a global table called 'ndless' to Lua)


But that's not the "hard" part. The actual ndless hook (lua extension rather) that makes a proper .tns from a script is doable, I assume, but it would take a bit of work...


(@mdr1 : comments*)

186
Other Calculators / Re: Who wants an Nspire CX?
« on: July 14, 2014, 06:40:25 pm »
@will : boot2*
@matref : maintenance menu*

:D

But yeah, try the usual "repair" stuff.

187
TI-Nspire / Re: nGL - a fast (enough) 3D engine for the nspire
« on: July 10, 2014, 11:00:32 am »
Quote
Although a screenshot feature within the game would be cool (if it's not there already, I don't know )
I had implemented it once but lost the code somehow (it was before v0.7.2, when I moved to git). But it's on my todo list again!
Maybe a part of that could help (instead of recoding this feature from scratch) : http://tiplanet.org/forum/archives_voir.php?id=12264
(also, I like the Ctrl-capture shortcut ... :P)

188
TI-Nspire / Re: nGL - a fast (enough) 3D engine for the nspire
« on: July 10, 2014, 10:23:31 am »
Probably taken from running the game in nspire_emu. (well, at least it's the quickest way to get it)

Although a screenshot feature within the game would be cool (if it's not there already, I don't know :P)

189
TI-Nspire / Re: Jens' Script Editor - An on-calc lua editor
« on: July 09, 2014, 03:56:04 pm »
-Ability to save custom themes
Indeed, it works fine on the emulator but doesn't on the handheld. The problem seems to be that var.recall apparently doesn't work in the first call of on.activate. I hate that TI doesn't mention such things in their guide and have such differences between emulator and handheld...  :(  I'll try to find an other suitable event for initialization that fits all needs then...  :/


TI does warn about this kind of stuff for other functions... but apparently they forgot this one ?
Anyway, on.resize makes a good init functions.


But all that's obsolete with 3.9 where you can call any Nspire API function without having to worry if it's going to work (it will, as they kind of fake a first initial lua script setup, then launch the user code, so that the API is indeed ready.) So, basically, you're able to make an init() function and call it right after and whenever you need it.

190
TI-Nspire / Re: Jens' Script Editor - An on-calc lua editor
« on: July 08, 2014, 06:14:14 pm »
Very nice :D
(I summed it up on tiplanet, btw)

Also, it crashed (line 2327 : attempt to index field '?' a nil value) when I tried to copy a part of the code I selected.

Why don't you just enable the errorHandler, by the way, for "releases" ? :P
(I don't recommend enabling it while writing/debugging, though ^^)

191
General Discussion / Re: Watcha Been Listening To?
« on: July 04, 2014, 04:15:36 pm »
can't get tired of this 5-hour long mix :

192
Miscellaneous / Re: Bye for now
« on: June 30, 2014, 05:53:50 pm »
France just won against Nigeria 2-0 ^^

193
I included the Windows Visual Studio solution this time because its where I do development so it kind of belongs in the package.

Ha, pretty cool ! And nice job again in general :P

Just for fun, I ran PVS-Studio (static analyzer) on it :
33 level 1 warnings, 16 level 2, 379 level 3... Quake 1 source is fun .... :P

Examples:
Spoiler For Spoiler:
V583 The '?:' operator, regardless of its conditional expression, always returns one and the same value: m + 8. sbar.c 418
Code: [Select]
int Sbar_ColorForMap (int m)
{
return m < 128 ? m + 8 : m + 8;
}

V570 The 'r_drawsurf.surfwidth' variable is assigned to itself. d_surf.c 302
Code: [Select]
if( r_drawsurf.surfwidth & 3 )
{
r_drawsurf.surfwidth = r_drawsurf.surfwidth;
}

V501 There are identical sub-expressions to the left and to the right of the '-' operator: (byte *) sv.edicts - (byte *) sv.edicts pr_cmds.c 634


V523 The 'then' statement is equivalent to the 'else' statement. cl_input.c 190
Code: [Select]
if (impulseup && !impulsedown)
if (down)
val = 0; // I_Error ();
else
val = 0; // released this frame


V673 The '2000 << 24' expression evaluates to 33554432000. 35 bits are required to store the value, but the expression evaluates to the 'int' type which can only hold '32' bits. r_edge.c 700
I lol'd at this one :
Code: [Select]
// FIXME: do we need this now that we clamp x in r_draw.c?
edge_sentinel.u = 2000 << 24; // make sure nothing sorts past this
edge_sentinel.prev = &edge_aftertail;


194
Calculator C / Re: [Ndless] Help with bottleneck on color calcs only
« on: June 27, 2014, 06:32:10 pm »
Well, it's actually closer so 5 times, but OK, as long as tests are consistent it's good.

195
Calculator C / Re: [Ndless] Help with bottleneck on color calcs only
« on: June 27, 2014, 06:22:45 pm »
DJ : what you don't understand is that the program is already 6 times faster (according to latest aeTIos's tests) on GS calcs than on color calcs at merely the same frequency (120 MHz for GS vs 132 MHz for color).
In case you didn't see :
I decided to un-overclock my calc and re-run copyscreen1000times.12:53 seconds.

(Or well, I'm not sure where you see this '6x' faster :P)

GL&HF anyway ^^

Pages: 1 ... 11 12 [13] 14 15 ... 115