Random line of code thread
category: code [glöplog]
Code:
<button type="button" class="not-button">
main(argc, *argv[])
if ((argv[1] ==--sperm)||(argc > 2))
namespace::string destination = argv[2]
else
cerr << "fuck off" << \n;
if ((argv[1] ==--sperm)||(argc > 2))
namespace::string destination = argv[2]
else
cerr << "fuck off" << \n;
Code:
move.w d0,(p_LO-COPPERLIST)+6(a5)
Code:
c.a = (i == 0) ? 0 : (uint8)(255 * s * (c.a /255.f));
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?
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;
Code:
now.we.crash.the.demo.because.it.is.the.fastest.way.to.stop(":D");
Just found in an intro I made about 20 years ago:
Code:
move.l a0,a2 ; necessary!! (f*cking ASM-One bug)
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),
_ => ()
}
}
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)
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 )
Code:
enum TypeOfTexture
{
DiffuseMap_UNIT,
BumpMap_UNIT,
MaterialMap_UNIT,
GBuffer_WorldPos_UNIT,
GBuffer_Albedo_UNIT,
GBuffer_Normal_UNIT,
GBuffer_UV_UNIT,
AOBuffer_AO_UNIT,
AOBUFFER_BLUR_UNIT,
Size
};
struct EffectStage
{
int StageValue;
GLint TextureUnits[Size] ;
};
Don't let the name fool you, those GBuffer targets are convoluted as hell.
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);
:D
432hz mainittu
printf("If you see this message, consider this product fucked!\n");
Code:
vol[voice_idx] <= IN_DATA;
Code:
if(!codedToday) code();
even better:
Code:
result = codedToday ? codeSomeMore() : code();