pouët.net

Random line of code thread

category: code [glöplog]
Code:<button type="button" class="not-button">
added on the 2017-03-24 12:25:17 by raina raina
main(argc, *argv[])

if ((argv[1] ==--sperm)||(argc > 2))
namespace::string destination = argv[2]
else
cerr << "fuck off" << \n;
added on the 2017-03-25 03:23:36 by Deus Deus
Code:move.w d0,(p_LO-COPPERLIST)+6(a5)
added on the 2017-03-29 17:15:56 by StingRay StingRay
Code:c.a = (i == 0) ? 0 : (uint8)(255 * s * (c.a /255.f));
added on the 2017-03-29 17:18:03 by Preacher Preacher
Code:tx_texturecolumn = (segl->offset-IMFixMul(finetangent[(segl->CenterAngle+xtoviewangle[x])> >ANGLETOFINESHIFT], segl->distance))>>FRACBITS;


From 3DO doom code, most probably also in PC doom code.

I always thought for a linedef from column x0 to x1, doom would interpolate u0 to u1 texcoord with perspective correct per column. But no, it calculates the U column coord based on viewing angle and distance. Makes sense now, in some console ports (both PS1 and Saturn and few others), maybe because of smaller precision or LUTs, when you look from a wide angle (especially noticable on some buttons texture) there is an awfully wrong U offset (doesn't happen on 3DO or PC versions though). I don't know which method would be faster or better, the interpolation would be more accurate but maybe the perspective calcs slower?
added on the 2017-04-09 13:31:25 by Optimus Optimus
Code:m_filterHist[8] = (m_filterHist[8] - m_delayLines[5].Get(m_delayTaps[5])) * m_delayCoeffs[5][1] + m_delayLines[5].Get(m_delayTaps[5]);
>+++++++>++++++++++>+++>+<<<<-
Code:drawcopy -t @dm.interlace.1 $2 0 0 320 180 $1 0 0
Code:mov dx,text3+7
Code:rnd = frac(asint(constantbuffer[primid & 4095])*.01*time / primid) - .5;
added on the 2017-04-23 00:35:38 by Psycho Psycho
Code:now.we.crash.the.demo.because.it.is.the.fastest.way.to.stop(":D");
added on the 2017-04-23 10:02:40 by sigveseb sigveseb
Just found in an intro I made about 20 years ago:

Code: move.l a0,a2 ; necessary!! (f*cking ASM-One bug)
added on the 2017-05-04 15:51:02 by StingRay StingRay
Code:mov byte[fs:bx+320*92+40],al
Code:fn print_shader_err(err: glium::program::ProgramCreationError) { match err { glium::CompilationError(fuck) => println!("{}", fuck), _ => () } }
added on the 2017-05-13 12:23:01 by MandelBOT MandelBOT
Code:a=filter((lambda x: re.match(r"^\d+(\.\d+){1,2}$", x)), a) a=max(a, key=(lambda x: re.sub(r"\d+", (lambda y: y.group(0).zfill(5)), x))) a=re.sub(r"^(\d+\.\d+\.)(\d+)$", (lambda x: x.group(1)+str(int(x.group(2))+1)), a) a=re.sub(r"^(\d+\.\d+)$", r"\1.1", a)
added on the 2017-05-17 22:21:45 by Tigrou Tigrou
Code: def _get_commits(self, trunk) : commits = [] trunk_fullname = trunk.fullname() master_context = trunk.ctx while (master_context) : commits.append(master_context) parents = master_context.parents() master_context = None for e in parents : if (trunk_fullname == e.branch()) : master_context = e break return commits def _tag_last_version(self, trunk, tag_name, branch_name) : commits = self._get_commits(trunk) already_merged = filter(lambda x: branch_name in x.description(), commits) tags = reduce((lambda x,y: x+y.tags()), commits, []) tag_name = tags[0] if (not already_merged): self._tag( tag_name, force = True )
added on the 2017-05-19 00:39:16 by Tigrou Tigrou
Code:enum TypeOfTexture { DiffuseMap_UNIT, BumpMap_UNIT, MaterialMap_UNIT, GBuf fer_WorldPos_UNIT, GBuffer_Albedo_UNIT, GBuffer_Normal_UNIT, GBuffer_UV_UNI T, AOBuffer_AO_UNIT, AOBUFFER_BLUR_UNIT, Size }; struct EffectStage { int StageValue; GLint TextureUnits[Size] ; };
added on the 2017-05-21 01:53:52 by Deus Deus
Don't let the name fool you, those GBuffer targets are convoluted as hell.
added on the 2017-05-21 02:08:34 by Deus Deus
Code:return 440.0 * pow(2.0, (note - 69.0) / 12.0);


Or the tin foil hat version

Code:return 432.0 * pow(2.0, (note - 69.0) / 12.0);
added on the 2017-05-21 14:49:10 by djh0ffman djh0ffman
:D
added on the 2017-05-21 14:57:20 by noby noby
432hz mainittu
added on the 2017-05-21 15:04:26 by leGend leGend

login