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
-- title: Mode7 | |
-- author: MonstersGoBoom and Nopy | |
-- desc: Mode7 | |
-- script: lua | |
-- utility scripts | |
local math_sin = math.sin | |
local math_cos = math.cos | |
local math_rad = math.rad |
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
-- by MonstersGoBoom | |
--[[ | |
Copyright (c) 2017 MonstersGoBoom | |
All rights reserved. | |
Redistribution and use in source and binary forms are permitted | |
provided that the above copyright notice and this paragraph are | |
duplicated in all such forms and that any documentation, | |
advertising materials, and other materials related to such | |
distribution and use acknowledge that the software was developed |
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
-- title: game title | |
-- author: game developer | |
-- desc: short description | |
-- script: lua | |
function table.remove(a,b) | |
for c,d in ipairs(a) do | |
if d==b then | |
a[c]=a[#a] | |
a[#a]=nil |
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
-- title: Particle test 2 | |
-- author: Time_Tripper | |
-- desc: Particle test 2 | |
-- script: lua | |
-- input: mouse | |
-- Optimization from MonstersGoBoom | |
-- create a single table for everything , reducing lookups | |
local particle = {} | |
function particle:new (o,x,y,vx,vy,c,l) | |
o = o or {} -- create object if user does not provide one |
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
#version 130 | |
in vec2 out_uv; | |
out vec4 out_0; | |
uniform sampler2D vramimage; | |
uniform sampler1D vrampalette; | |
void main(void) | |
{ |
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 <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#pragma pack(1) | |
typedef struct | |
{ | |
int32_t x, y; |
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
-- some math stuff for speed | |
local _atan2=math.atan2 | |
local _sqrt=math.sqrt | |
local _sin=math.sin | |
local _cos=math.cos | |
local _2pi=math.pi * 2 | |
-- 2d vector | |
local vec2 = {} | |
setmetatable(vec2, vec2); | |
vec2.type = vec2 |
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
#define C64_BLACK ImVec4(0,0,0,1) | |
#define C64_WHITE ImVec4(1,1,1,1) | |
#define C64_RED ImVec4(136/255.0f,57/255.0f,50/255.0f,1.0f) | |
#define C64_CYAN ImVec4(103/255.0f,182/255.0f,189/255.0f,1.0f) | |
#define C64_PURPLE ImVec4(139/255.0f,63/255.0f,150/255.0f,1.0f) | |
#define C64_GREEN ImVec4(85/255.0f,160/255.0f,73/255.0f,1.0f) | |
#define C64_BLUE ImVec4(64/255.0f,49/255.0f,141/255.0f,1.0f) | |
#define C64_YELLOW ImVec4(191/255.0f,206/255.0f,114/255.0f,1.0f) | |
#define C64_ORANGE ImVec4(139/255.0f,84/255.0f,41/255.0f,1.0f) | |
#define C64_BROWN ImVec4(87/255.0f,66/255.0f,0/255.0f,1.0f) |
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
langDef.mTokenRegexStrings.push_back(std::make_pair<std::string, TextEditor::PaletteIndex>("[#][$][0-9a-fA-F]+[uU]?[lL]?[lL]?", TextEditor::PaletteIndex::Number)); | |
langDef.mTokenRegexStrings.push_back(std::make_pair<std::string, TextEditor::PaletteIndex>("[$][0-9a-fA-F]+[uU]?[lL]?[lL]?", TextEditor::PaletteIndex::Number)); | |
langDef.mTokenRegexStrings.push_back(std::make_pair<std::string, TextEditor::PaletteIndex>("0[xX][0-9a-fA-F]+[uU]?[lL]?[lL]?", TextEditor::PaletteIndex::Number)); |
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
// found pngs here https://opengameart.org/content/the-collection-of-8-bit-fonts-for-grafx2-r2 | |
TigrFont *tigrGrafx2Font(const char *filename) | |
{ | |
TigrFont *font = (TigrFont *)calloc(1, sizeof(TigrFont)); | |
Tigr *fbit = tigrLoadImage(filename); | |
font->bitmap = fbit; | |
font->numGlyphs = 128-32; | |
font->glyphs = (TigrGlyph *)calloc(font->numGlyphs, sizeof(TigrGlyph)); | |
// top line of font is markers |
OlderNewer