🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by chine.bleu Tue, 13 Oct 2026 08:27
Re: will it be optimized?
#313
Author: chine.bleu
Date: Tue, 13 Oct 2026 08:27
45 lines
2436 bytes
fir wrote:
> inline void MoveObject3D(Object3D *o)
> {
>      Object3D a=*o;
>
>      float dt=0.01f;
>
>      if(a.type!='ship') return;

Bad idea a.field = 1 changes a local variable
o->field = 2 changes a distant variable
Unless you are very good with your interface contracts this can lead to 
long tedious pointer chasing debugs.

Alternatively run your source through a filter like tr so you xcan use 
more expressive characters

	¬	!
	≤	<=
	≥	>=
	≠	!=
	→	->
	=	==
	:==	=
	:=	=

et cetera

 > inline void MoveObject3D(Object3D *o)
 >      float dt:=0.01f;
 >      if(o→type≠'ship') return;
>    if(frame_number%5=0)
>     {
>         Position p:=o→p; BagAdd(&p,'deb',500); return;
>     }
>     float3 b:=o→p.pos;
>     float dist:=length(b);
>     o→maneuver_time-:=dt;
>     if(o→maneuver_time≤0)

-- 
Siri Seal of Disavowal #777-000. Disavowed. Denied.  @
NO KINGS    For I desire mercy not sacrifice.       /|\
The Church of the Holey Apple .signature 5.5        / \
of Discordian Mysteries. This post insults Islam. Mohamed
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads