-
WORK ITEM:
- Work closure
- pointer to TASK
-
TASK:
- WORK ITEMs Array
- Atomic num_open_work_items counter - init to number of WORK ITEMs
- Permits pointer to TASK which depends on this one
-
WORKER
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
local sdl = require 'SDL' | |
local image = require 'SDL.image' | |
local ttf = require 'SDL.ttf' | |
local table, math, string = table, math, string | |
local status, err = sdl.init { | |
sdl.flags.Video | |
} | |
if not status then |
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
local sdl = require 'SDL' | |
local image = require 'SDL.image' | |
local ttf = require 'SDL.ttf' | |
local table, math, string = table, math, string | |
local status, err = sdl.init { | |
sdl.flags.Video | |
} | |
if not status then |
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
local function clear_tile_teams() | |
for i = 1, conf_map_num do | |
local tile = g_map[i] | |
local tile_type = tile.tile_type | |
if tile_type ~= 'water' and | |
tile_type ~= 'bridge' and | |
tile_type ~= 'rocks' and | |
tile_type ~= 'building' then | |
tile.team = nil | |
end |
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
#[derive(Copy, Clone, Debug)] | |
struct Tile { | |
/// A - B - C | |
/// | | | |
/// H D | |
/// | | | |
/// G - F - E | |
/// | |
/// A = 0 |
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
#![feature(link_args)] | |
// Don't try and do this via cargo it's a huge disaster, | |
// just ignore the ominous warnings about link_args being | |
// broken. (requires nightly, too, hurray) | |
#[cfg(target_os="windows")] | |
#[link_args="/EXPORT:NvOptimusEnablement"] | |
extern {} | |
#[allow(non_upper_case_globals)] |
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
// Attempting to find the link_map for an executable without | |
// actually using the relocations / symtab / etc so we can elide | |
// all that stuff from our ELF file. (for an executable packer) | |
// With a .got entry it should be not so difficult to do, | |
// since GOT[0] is always the link_map. (depending on what | |
// actually triggers this entry to be written by ld-linux.so.1) | |
// This code scans the aux vector for the address of the program's |
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
#[inline(force)] | |
let cur = |data: &[u8], pos| -> usize { | |
unsafe { *data.get_unchecked(pos) as usize } | |
}; | |
#[inline(force)] | |
let skip_whitespace = |data, pos| -> usize { | |
let mut ws = 0; | |
'outer: while PARSE_FLAGS[cur(data, pos + ws)] & PARSE_FLAG_WS != 0 { | |
'skip_ws: loop { |
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
fn main() { | |
static TEST_VS: &'static [u8] = glsl_vs!{r#" | |
#version 400 | |
#extension GL_ARB_separate_shader_objects : enable | |
#extension GL_ARB_shading_language_420pack : enable | |
layout (location = 0) in vec4 pos; | |
layout (location = 1) in vec4 color; | |
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
use winit; | |
struct Game { | |
window: winit::Window, | |
ev: winit::EventLoop | |
} | |
impl Game { | |
fn new() -> Game { | |
let ev = winit::EventsLoop::new(); |