This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function TS_Line(integer x1, integer y1, integer x2, integer y2, Color){ | |
integer w = absolute_value(x1-x2); | |
integer h = absolute_value(y1-y2); | |
integer sx; | |
integer sy; | |
if (x1<x2){ | |
sx = 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function BodyPart.draw(spritex, spritey){ | |
//this.color should be updated to an appropriate color whenever the bodypart takes damage. | |
//alternatively, if could be calculated at the start of this function. | |
integer number_of_nodes = this.nodes.length; | |
integer i = 0; | |
//this line handles the wraparound from the last to the first node. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void TS_BMPFont::addline(const char **textlines, int *readylines, char *linebuffer){ | |
(*readylines)++; | |
textlines = (const char **)realloc(textlines, (*readylines)*sizeof(const char *)); | |
textlines[(*readylines)-1] = strdup(linebuffer); | |
linebuffer = (char *)realloc(linebuffer, 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <class TSim> | |
TS_Texture getTextureFromImage(TSim *a) { | |
return a->texture; | |
} | |
v8Function spritebatcherAddImage(V8ARGS){ | |
if(args.Length()==0){ | |
THROWERROR(" Error: Called with fewer than one argument."); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
#include <functional> | |
#include <cstring> | |
void (*function1)(int , int); | |
template<typename R, typename ...A>int CreateThread(R(*ThreadFunc)(A...), A ...args){ | |
std::function<R(A...)>func(ThreadFunc); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void CallFuncPP(void *r){ | |
void **d = (void **)r; | |
void(**e)(void) = (voidFunc *)d; | |
e[0](); | |
} | |
///// | |
//Example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/////////////////////////////////////////////////////////////////////////////// | |
/* | |
TurboSphere Plugin SDK | |
Copyright (c) 2012-2014 Martin McDonough. | |
All rights reserved. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Calls Feh, puts a randomized image on the background, and changes | |
# the image every 5 minutes. | |
import os | |
import glob | |
import subprocess | |
import time | |
import random | |
images = glob.glob('images/*') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def StringifyKeepingValue(s): | |
stringy = "" | |
while s: | |
digit = s %256 | |
s-= s%256 | |
s = s/256 | |
stringy+=chr(digit) | |
return stringy | |
def PadString(val, s, l): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/////////////////////////////////////////////////////////////////////////////// | |
/* | |
TurboSphere Plugin SDK | |
Copyright (c) 2012-2014 Martin McDonough. | |
All rights reserved. | |
OlderNewer