repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
kgrz97/Oprogramowanie_PC
SerialPort_test/SerialPort_test/SerialPort_test.h
<reponame>kgrz97/Oprogramowanie_PC #pragma once #include <QtWidgets/QMainWindow> #include "ui_SerialPort_test.h" #include <QPushButton> #include <QSpinBox> #include <QPlainTextEdit> #include <QCheckBox> class SerialPort_test : public QMainWindow { Q_OBJECT public: SerialPort_test(QWidget *parent = Q_NULLPTR); pri...
kbrafford/graph_helper
simple_img_system/indexed_palette_img.h
#ifndef __INDEXED_PALETTE_IMG_H__ #define __INDEXED_PALETTE_IMG_H__ #include "simple_img_system.h" img_t *indexed_palette_img_create(img_type_t type, uint16_t w, uint16_t h,uint32_t c); void indexed_palette_img_clear_to_color(img_t *pimg, uint32_t c); void indexed_palette_img_fill_vtable(img_t *pimg); #endif
kbrafford/graph_helper
simple_img_system/grayscale_img.h
#ifndef __GRAYSCALE_IMG_H__ #define __GRAYSCALE_IMG_H__ #include "simple_img_system.h" img_t *grayscale_img_create(img_type_t type, uint16_t w, uint16_t h, uint32_t c); void grayscale_img_fill_vtable(img_t *pimg); #endif
kbrafford/graph_helper
simple_img_system/p565_img.h
<reponame>kbrafford/graph_helper #ifndef __P565_IMG_H__ #define __P565_IMG_H__ #include "simple_img_system.h" img_t *p565_img_create(img_type_t type, uint16_t w, uint16_t h, uint32_t c); void p565_img_fill_vtable(img_t *pimg); #endif
kbrafford/graph_helper
test.c
#include "simple_img_system.h" #include <stdio.h> #define IMG_X 1920*2 #define IMG_Y 1080*2 /* PICK WHICH STYLE OF IMAGE YOU WANT */ /* Note that if you use indexed_palette, you will run out of colors fast if drawing a lot of different things */ //img_type_t type = img_type_p565; //img_type_t type = img_type_inde...
kbrafford/graph_helper
simple_img_system/p565_img.c
#include <stdlib.h> #include <stdio.h> #include <stdint.h> #include "p565_img.h" #define COLOR2P565_B(c) ((((c) & 0xFF) * 249 + 1014) >> 11) #define COLOR2P565_G(c) (((((c) & 0xFF00) >> 8) * 253 + 505) >> 10) #define COLOR2P565_R(c) (((((c) & 0xFF0000) >> 16) * 249 + 1014) >> 11) #define COLOR2P332_B(c) (((c) & 0xFF...
kbrafford/graph_helper
simple_img_system/rgb888_img.c
#include <stdlib.h> #include <stdio.h> #include <stdint.h> #include "rgb888_img.h" #define COLOR_B(c) ((c) & 0xFF) #define COLOR_G(c) (((c) & 0xFF00) >> 8) #define COLOR_R(c) (((c) & 0xFF0000) >> 16) typedef struct _rgb888_pixel_t { uint8_t b; uint8_t g; uint8_t r; } rgb888_pixel_t; img_t *rgb888_img_create(i...
kbrafford/graph_helper
simple_img_system/rgb888_img.h
#ifndef __RGB888_IMG_H__ #define __RGB888_IMG_H__ #include "simple_img_system.h" img_t *rgb888_img_create(img_type_t type, uint16_t w, uint16_t h, uint32_t c); void rgb888_img_fill_vtable(img_t *pimg); #endif
kbrafford/graph_helper
simple_img_system/indexed_palette_img.c
<filename>simple_img_system/indexed_palette_img.c #include <string.h> #include <math.h> #include <stdlib.h> #include <stdio.h> #include "simple_img_system.h" #include "indexed_palette_img.h" typedef struct _indexed_palette_extra_t { uint32_t palette[4096]; uint32_t _mrc; uint8_t next_color; uint8_t _mrc_idx...
kbrafford/graph_helper
simple_img_system/simple_img_system.c
<filename>simple_img_system/simple_img_system.c<gh_stars>0 #define MINIZ_NO_STDIO #define MINIZ_NO_TIME #define MINIZ_NO_ZLIB_APIS #include "miniz.h" #include <math.h> #include <stdio.h> #include "simple_img_system.h" #include "indexed_palette_img.h" #include "p565_img.h" #include "grayscale_img.h" #include "rgb888_...
kbrafford/graph_helper
simple_img_system/grayscale_img.c
#include <stdlib.h> #include <stdio.h> #include <stdint.h> #include <string.h> #include "grayscale_img.h" #define COLOR2G8(c) (((c) & 0xFF00) >> 8) #define COLOR2G4(c) ((((c) & 0xFF00) >> 8) >> 4) const uint8_t _LUT4[16] = { 0, 17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255 }; i...
kbrafford/graph_helper
simple_img_system/simple_img_system.h
#ifndef __SIMPLE_IMG_SYSTEM_H__ #define __SIMPLE_IMG_SYSTEM_H__ #include <stdint.h> #define SIS_NUM_THREADS 4 #define _CLAMP(v, min, max) if (v < min) { v = min; } else if (v > max) { v = max; } // Interfacing with our uint32_t style pixel #define RGB(r, g, b) ((r)<<16 | ((g)<<8) | (b)) #define GET_R(c) (((c) & 0x...
gregtour/netBEAM
Wii/input.c
<filename>Wii/input.c /* **************************************** Input Module **************************************** */ #include <wiiuse/wpad.h> #include "netbeam.h" #include "input.h" int InitInput(INPUT_STATE* ref) { WPAD_Init(); return 0; } int ShutdownInput(INPUT_STATE* ref) { return 0; }...
gregtour/netBEAM
Wii/video.h
/* Released under Artistic License 2.0. Netbeam 2016. */ #ifndef _NETBEAM_VIDEO_H #define _NETBEAM_VIDEO_H #define USING_GRRLIB #ifdef USING_GRRLIB #include <grrlib.h> #endif extern const int DRAW_BUFFER_WIDTH; extern const int DRAW_BUFFER_HEIGHT; typedef struct { unsigned int * pixels; un...
gregtour/netBEAM
compression.c
/* netBEAm - dctcompress */ #define SIG_TERMS 9 typedef struct { char coefRed[8]; char coefGreen[8]; char coefBlue[8]; } MACROBLOCK; typedef struct { char red[8][8]; char green[8][8]; char blue[8][8]; } IMAGEBLOCK; // DCT { 1/4 x a(u) x a(v) x cos((2x+1)u pi / 16) x cos((2y+1)v pi / 16) } x 1000. int cofa...
gregtour/netBEAM
Wii/network.c
<filename>Wii/network.c /* **************************************** Network Module **************************************** */ #include "netbeam.h" #include "network.h" int InitNetwork(NET_STATE* ref) { int ret, result; ret = if_config(ref->localip, ref->netmask, ref->gateway, TRUE); if (ret < 0) { ...
gregtour/netBEAM
Wii/external.c
<reponame>gregtour/netBEAM // source files in other directories #include "../DCT/compression.c"
gregtour/netBEAM
DCT/compression.c
// DCT Compression // /* compression lib */ #include <stdlib.h> #include "compression.h" #include "quality.h" #include "itables.h" #include "dtables.h" // Zig-zag order of (X,Y) discrete cosine transforms. const int SIG[64] = {0, 1, 8, 2, 9, 16, 3, 10, 17, 24, 4, 11, 18, 25, 32, 5, 12, 19, 26, 33,...
gregtour/netBEAM
Wii/network.h
/* Released under Artistic License 2.0. Netbeam 2016. */ #ifndef _NETBEAM_NETWORK_H #define _NETBEAM_NETWORK_H #include <network.h> #include "input.h" #include "sound.h" #include "video.h" #define MAX_NET_SIZE 52000 typedef struct { char localip[16]; char gateway[16]; char netmask[16]...
gregtour/netBEAM
DCT/quality.h
// DCT Compression // #ifndef _DCT_QUALITY_H #define _DCT_QUALITY_H #define SIG_TERMS 10 #define QUANT_FACTOR 8 # define CLAMP_MIN -128 # define CLAMP_MAX 127 #endif // #ifndef _DCT_QUALITY_H
gregtour/netBEAM
Wii/input.h
<reponame>gregtour/netBEAM<gh_stars>1-10 /* Released under Artistic License 2.0. Netbeam 2016. */ #ifndef _NETBEAM_INPUT_H #define _NETBEAM_INPUT_H typedef struct { unsigned char buttons[8]; } INPUT_STATE; int InitInput(INPUT_STATE* ref); int ShutdownInput(INPUT_STATE* ref); int UpdateInput(INPUT_S...
gregtour/netBEAM
Wii/sound.h
/* Released under Artistic License 2.0. Netbeam 2016. */ #ifndef _NETBEAM_SOUND_H #define _NETBEAM_SOUND_H typedef struct { unsigned char enabled; } SOUND_STATE; int InitSound(SOUND_STATE* ref); int ShutdownSound(SOUND_STATE* ref); int UpdateSound(SOUND_STATE* ref); #endif // HEADER WRAPPER
gregtour/netBEAM
Wii/video.c
<filename>Wii/video.c /* **************************************** Video Module **************************************** */ #include "netbeam.h" #include "video.h" #include "../DCT/compression.h" #include "../DCT/quality.h" const int DRAW_BUFFER_WIDTH = 640; const int DRAW_BUFFER_HEIGHT = 480; int InitVideo...
gregtour/netBEAM
Wii/sound.c
/* **************************************** Sound Module **************************************** */ #include "netbeam.h" #include "sound.h" int InitSound(SOUND_STATE* ref) { // stub ref->enabled = 1; return 0; } int ShutdownSound(SOUND_STATE* ref) { // stub ref->enabled = 0; return 0; }...
gregtour/netBEAM
DCT/compression.h
<reponame>gregtour/netBEAM // DCT Compression // #ifndef _DCT_COMPRESSION_H #define _DCT_COMPRESSION_H #include "quality.h" typedef struct { unsigned char coefRed[SIG_TERMS]; unsigned char coefGreen[SIG_TERMS]; unsigned char coefBlue[SIG_TERMS]; } MACROBLOCK; // DCT { 1/4 x a(u) x a(v) x cos((2x+1)u pi /...
gregtour/netBEAM
Wii/netbeam.h
/* Released under Artistic License 2.0. Netbeam 2016. */ #ifndef _NETBEAM_GLOBAL_H #define _NETBEAM_GLOBAL_H #include <stdio.h> #include <stdlib.h> #include <string.h> #include <malloc.h> #include <ogcsys.h> #include <gccore.h> #include <debug.h> #include <errno.h> typedef enum { ERROR = 0, ...
gregtour/netBEAM
Wii/netbeam.c
/* NetBeam Game Streaming Client | Wii | netbeam.c Copyright (C) 2016 <NAME> Available under the Artistic License 2.0. */ /* **************************************** Main Header **************************************** */ #include "netbeam.h" #include "sound.h" #include "video.h" #include "input.h" #i...
jflow/FileSinki
Version/FileSinki.h
// // FileSinki // // See LICENSE file for licensing information.h // FileSinki // // See LICENSE file for licensing information // // Created by <NAME> on 10/05/20. // Copyright © 2020 <NAME>. All rights reserved. // #import <Foundation/Foundation.h> //! Project version number for FileSinki. FOUNDATION_EXPORT ...
eliasmaia/scrappy-tutorial
Lib/site-packages/lxml/includes/lxml-version.h
<reponame>eliasmaia/scrappy-tutorial<gh_stars>10-100 #ifndef LXML_VERSION_STRING #define LXML_VERSION_STRING "4.3.3" #endif
owlxiao/capstone-dumper
src/capstone-dumper/capstone_dumper.h
/** * @file src/capstone-dumper/capstone_dumper.h * @brief Capstone usage demonstration application. * Use all (as much as makes sense) capstone capabilities to decode and * dump code snippets from various architectures. * @copyright (c) 2017 Avast Software, licensed under the MIT license */ #ifnde...
finalist736/cpassdictcreator
main.c
<filename>main.c #include <stdio.h> #include "passdict.h" int main(int argc, char *argv[]) { PassDictionaryConfig config; char l; printf("need alpha? "); //scanf("%c", &l); if (l == 'y') { config.isAlpha = 1; } else { config.isAlpha = 0; } //scanf("%c", &l);...
finalist736/cpassdictcreator
passdict.c
#include <stdlib.h> #include <string.h> //#include <stdio.h> #include "passdict.h" static char startDigit = '0'; static char endDigit = '9'; static char startAlpha = 'a'; static char endAlpha = 'z'; char determineLastChar(const PassDictionaryConfig *c) { if (c->isAlpha) { return endAlpha; } e...
finalist736/cpassdictcreator
passdict.h
<reponame>finalist736/cpassdictcreator #ifndef PASSDICT_H #define PASSDICT_H #include <stdlib.h> struct PDConfig { int isAlpha; int isDigit; int minLength; int maxLength; }; typedef struct PDConfig PassDictionaryConfig; errno_t PassDictGenerate(const PassDictionaryConfig* c); #endif // PASSDICT_H
hidronautics/satellite
sniffer.h
<filename>sniffer.h #ifndef SNIFFER_H #define SNIFFER_H #include <QObject> class sniffer : public QObject { Q_OBJECT public: explicit sniffer(QObject *parent = nullptr); signals: public slots: }; #endif // SNIFFER_H
aidinabedi/libfreespace
common/freespace_util.c
<reponame>aidinabedi/libfreespace /* * libfreespace - library for communicating with Freespace devices * * Copyright 2013-15 Hillcrest Laboratories, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy o...
aidinabedi/libfreespace
include/freespace/freespace_deviceTable.h
/* * libfreespace - library for communicating with Freespace devices * * Copyright 2010-15 Hillcrest Laboratories, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://ww...
zhiliang729/TTCSDK_iOS
TTC_SDK_NET.framework/Headers/TTC_SDK_NET.h
<filename>TTC_SDK_NET.framework/Headers/TTC_SDK_NET.h<gh_stars>1-10 // // TTC_SDK_NET.h // TTC_SDK_NET // // Created by chenchao on 2018/10/8. // Copyright © 2018 chenchao. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for TTC_SDK_NET. FOUNDATION_EXPORT double TTC_SDK_NETVersionNumber...
zhiliang729/TTCSDK_iOS
TTCSDK/TTCSDK.h
// // TTCSDK.h // TTCSDK // // Created by zhangliang on 2018/7/18. // Copyright © 2018 tataufo. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for TTCSDK. FOUNDATION_EXPORT double TTCSDKVersionNumber; //! Project version string for TTCSDK. FOUNDATION_EXPORT const unsigned char TTCSDKV...
hyb148/meta-v2x
recipes-kernel/kernel-module-wsmp/kernel-module-wsmp/af_wsmp.c
<filename>recipes-kernel/kernel-module-wsmp/kernel-module-wsmp/af_wsmp.c /* * WAVE Short Message Protocol sockets * * Copyright (C) 2015 ZENOME Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by ...
aceisnotmycard/Parallel-programming-course
third/parallel/poisson.h
// // Created by <NAME> on 5/10/15. // #ifndef PARALLEL_POISSON_H #define PARALLEL_POISSON_H #include "layer.h" #define TALK_ABOVE 100 #define TALK_BELOW 101 namespace InputData { static double X = 2.0; static double Y = 2.0; static double Z = 2.0; static int cells_x = 20; static int cells_y = ...
aceisnotmycard/Parallel-programming-course
fifth/main.c
#include <mpi.h> #include <pthread.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #define TASKS_LIST_SIZE 20 #define SIZE_MULTIPLIER 1234000 #define N 1000 // for MPI int rank, size; MPI_Comm comm; // logical variable // 1 if worker is done and waiting for more // 0 if it is busy int iter_counter; int is...
rallets-network/NSHoverableButton
NSHoverableButton/NSHoverableButton.h
// // NSHoverableButton.h // NSHoverableButton // // Created by <NAME> on 25/05/2018. // Copyright © 2018 Paiyou. All rights reserved. // #import <Cocoa/Cocoa.h> //! Project version number for NSHoverableButton. FOUNDATION_EXPORT double NSHoverableButtonVersionNumber; //! Project version string for NSHoverableBu...
dreais/wFita
Sources/Print/print_entities.c
// // Created by Valentin on 3/20/2021. // #include "raylib.h" #include "core_game.h" #include <stdio.h> #include <stdlib.h> static Rectangle player_frame = (Rectangle) {36.0f, 0.0f, 8.0f, 8.0f}; static Rectangle player_stretch = {0}; static Vector2 origin = {0}; void print_player(core_game_t *core, int zoom, unsign...
dreais/wFita
Include/core_game.h
<reponame>dreais/wFita // // Created by Valentin on 3/18/2021. // #ifndef WFITA_REMASTER_CORE_GAME_H #define WFITA_REMASTER_CORE_GAME_H #include <time.h> #include "raylib.h" typedef struct { int x; int y; } point_t; typedef struct { time_t seed; unsigned int x; unsigned int y; unsigned int w...
dreais/wFita
Sources/game_loop.c
// // Created by Valentin on 3/19/2021. // #include "raylib.h" #include "core_game.h" #include "print.h" // FOR TESTING PURPOSE #include <stdio.h> #include <conio.h> #include <unistd.h> static int zoom_value = 18; static unsigned int TARGET_FPS = 10; int game_loop(core_game_t *core) { while (!WindowShouldClose(...
dreais/wFita
Include/noise.h
// // Created by Valentin on 3/18/2021. // #ifndef WFITA_REMASTER_NOISE_H #define WFITA_REMASTER_NOISE_H #include <time.h> void define_hash(const int size, time_t seed); void free_hash(void); float perlin2d(float x, float y, float freq, int depth); #endif //WFITA_REMASTER_NOISE_H
dreais/wFita
Sources/Dep/Noise/perlin_noise.c
#include <time.h> #include <stdlib.h> static int SEED = 0; static int size_map = 0; //size could be define using a define before // TODO: get size using main args // TODO: using char instead of int might make it lighter for the program if the map is very huge, as the table is contained in the cache. static int *hash...
dreais/wFita
Include/init.h
<reponame>dreais/wFita // // Created by Valentin on 3/18/2021. // #ifndef WFITA_REMASTER_INIT_H #define WFITA_REMASTER_INIT_H room_t recreate_room(room_t to_rebuild); room_t initialize_room(const int width, const int height); void init_core_game(core_game_t *core); #endif //WFITA_REMASTER_INIT_H
dreais/wFita
Sources/Print/print_maps.c
// // Created by Valentin on 3/19/2021. // #include "raylib.h" #include "core_game.h" #include "print.h" #include <stdio.h> static void print_tile(char repr, Vector2 cursor, core_game_t *core, int zoom_value) { Color transp = WHITE; Rectangle frame = (Rectangle) {.width = 8.0f, .height = 8.0f}; Rectangle...
dreais/wFita
Sources/main.c
<filename>Sources/main.c #include "raylib.h" #include "core_game.h" #include "init.h" #include <stdio.h> #include <unistd.h> int main(void) { core_game_t core; const int screenWidth = 1600; const int screenHeight = 900; init_core_game(&core); InitWindow(screenWidth, screenHeight, "Fed in the Abys...
dreais/wFita
Include/print.h
<reponame>dreais/wFita // // Created by Valentin on 3/19/2021. // #ifndef WFITA_REMASTER_PRINT_H #define WFITA_REMASTER_PRINT_H #include "core_game.h" void print_map(core_game_t *core, int zoom_value); void display_textures(core_game_t *core, int zoom); void print_player(core_game_t *core, int zoom, unsigned int sc...
dreais/wFita
Sources/init_var.c
<filename>Sources/init_var.c<gh_stars>1-10 // // Created by Valentin on 3/18/2021. // #include <stdlib.h> #include "core_game.h" #include "noise.h" room_t recreate_room(room_t to_rebuild) { room_t main_r; int noise; define_hash((int)to_rebuild.width, to_rebuild.seed); main_r.width = to_rebuild.width;...
dreais/wFita
Sources/Core/keyboard.c
<gh_stars>1-10 // // Created by Valentin on 3/19/2021. // #include "raylib.h" #include "core_game.h" static void move_up(core_game_t *core) { core->player.pos.y--; if (core->player.pos.y < 0) core->player.pos.y++; } static void move_down(core_game_t *core) { core->player.pos.y++; if (core->pl...
jasonshere/NeuRec
evaluator/backend/cpp/include/evaluate.h
<filename>evaluator/backend/cpp/include/evaluate.h /* @author: <NAME> */ #ifndef EVALUATE_H #define EVALUATE_H #include <vector> #include <unordered_set> #include <unordered_map> #include <cmath> #include <algorithm> #include <future> #include "thread_pool.h" #include "metric.h" using std::vector; usi...
taka-tuos/nanotter
Editor.h
#ifndef EDITOR_H #define EDITOR_H #include <ncurses.h> #include "Buffer.h" class Editor { private: int x, y, row, col; char mode; Buffer* buff; string status; WINDOW *win; /* For those of you who do not have -std=c++11 in g++ */ string tos(int); // Cursor movement void moveUp(); void moveDown(); void mo...
taka-tuos/nanotter
nanotter.h
<gh_stars>1-10 #ifndef __NANOTTER_H__ #define __NANOTTER_H__ #include <string.h> #include <stdlib.h> #define VERSION_NANOTTER "nanotter alpha-0.1" char *tuiFloatMessageBox(const char *title, const char *text, int reqinput); char *tuiFullMessageBox(const char *title, const char *text, int reqinput); void strWriteStr...
taka-tuos/nanotter
Buffer.h
#ifndef BUFFER_H #define BUFFER_H #include <string> #include <vector> using namespace std; class Buffer { public: Buffer(); vector<string> lines; /* Some helper functions */ void insertLine(string, int); void appendLine(string); void removeLine(int); /* Substitutes all tabs in string for 4 spaces, so that ...
mosmeh/solvers
nqueens/nqueens.c
<filename>nqueens/nqueens.c #include <stdio.h> #define N 8 int idx(int row, int col) { return col + N * row; } int is_attacking_diag(int* board, int row, int col, int dx, int dy) { while (1) { row += dx; col += dy; if (row < 0 || N <= row || col < 0 || N <= col) { break; ...
ksomervi/invader
src/entity.h
#ifndef ENTITY_H #define ENTITY_H #include <allegro5/allegro.h> #include "base_object.h" class entity : public base_object { private: int _age; public: static const int UNLIMITED = INT_MIN; entity(); entity(const entity&); base_object* clone() override; ~entity(); void update() over...
ksomervi/invader
src/fighter.h
<gh_stars>0 /*! \file fighter.cpp * \brief * \author <NAME> < kevin @ somervill dot org > * \date 2018-07-29 */ #ifndef FIGHTER_H #define FIGHTER_H #include <allegro5/allegro.h> #include <allegro5/allegro_primitives.h> class fighter; #include "entity.h" #include "entity_store.h" #include "logger.h" #include "pl...
ksomervi/invader
src/mine_controller.h
#ifndef MINE_CONTROLLER_H #define MINE_CONTROLLER_H #include <allegro5/allegro.h> #include <map> #include <random> #include "base_controller.h" #include "random_generator.h" class mine_controller : public base_controller { private: int _mv_count; bool _x_side; random_generator *_rg; bool handle_e...
ksomervi/invader
src/base_controller.h
#ifndef BASE_CONTROLLER_H #define BASE_CONTROLLER_H #include <allegro5/allegro.h> #include <map> class base_controller; #include "base_object.h" #include "point_2d.h" class base_controller { private: protected: point_2d _dir; public: base_controller(); virtual ~base_controller() = 0; virtual...
ksomervi/invader
src/resource_manager.h
#ifndef INVADER_RESOURCE_MANAGER_H #define INVADER_RESOURCE_MANAGER_H #include <cstdio> #include <allegro5/allegro.h> #include <allegro5/allegro_font.h> #include <allegro5/allegro_ttf.h> #include <allegro5/allegro_image.h> #include <allegro5/allegro_audio.h> #include <allegro5/allegro_acodec.h> class resou...
ksomervi/invader
src/defines.h
#ifndef INVADER_DEFINES_H #define INVADER_DEFINES_H #define FPS 60.0 #define DEFAULT_LIVES 4 #define SPRITE_SIZE 36 #define RESOURCE_PATH "resources/" #define CONFIG_FILE "resources/invader.cfg" #define TITLE_Y 4 #define GAME_TITLE "INVADER!" #define BLACK al_map_rgb(0, 0, 0) #define WHITE al...
ksomervi/invader
src/logger.h
#ifndef LOGGER_H #define LOGGER_H #include <string> using std::string; #include <iostream> using std::ostream; class logger { private: ostream *os; static const char *_labels[3]; public: typedef enum log_level_e { NOTE, DEBUG, ERROR } log_level; private: log_level_e _verbosity; protected...
ksomervi/invader
src/base_object.h
<filename>src/base_object.h #ifndef BASE_OBJECT_H #define BASE_OBJECT_H #include <allegro5/allegro.h> #include "defines.h" class base_object; #include "base_controller.h" #include "graphic_component.h" #include "point_2d.h" class base_object { private: int _id; //ALLEGRO_BITMAP *_bm; protected: /...
ksomervi/invader
src/level_1.h
#ifndef LEVEL_1_H #define LEVEL_1_H 1 #include <cstdio> #include <allegro5/allegro.h> #include <allegro5/allegro_font.h> #include <allegro5/allegro_ttf.h> #include "base_level.h" class level_1: public base_level { private: graphic_component *foe_gc = NULL; ALLEGRO_SAMPLE *hit_sound = NULL; ALLEGRO_SAM...
ksomervi/invader
src/level_configuration.h
<filename>src/level_configuration.h /*! \file level_configuration.h * \brief * \author <NAME> < kevin @ somervill dot org > * \date 2018-10-18 */ #ifndef LEVEL_CONFIGURATION_H #define LEVEL_CONFIGURATION_H 13 #include <vector> using std::vector; enum Difficulty { EASY, NORMAL, HARD }; class level_configuration {...
ksomervi/invader
src/overlay.h
/*! \file overlay.h * \brief * \author <NAME> < kevin @ somervill dot org > * \date 2018-10-18 */ #ifndef OVERLAY_H #define OVERLAY_H 13 #include <allegro5/allegro.h> #include <allegro5/allegro_font.h> #include <allegro5/allegro_ttf.h> #include "fighter.h" #include "resource_manager.h" class overlay { private...
ksomervi/invader
src/weapon.h
/** \file weapon.h * \brief * \author <NAME> < kevin @ somervill dot org > * \date 2020-04-25 */ #ifndef WEAPON_H #define WEAPON_H #include <allegro5/allegro.h> #include <allegro5/allegro_audio.h> #include <allegro5/allegro_primitives.h> class weapon; #include "base_object.h" #include "entity_store.h" #include "...
ksomervi/invader
src/graphic_component.h
<reponame>ksomervi/invader #ifndef GRAPHIC_COMPONENT_H #define GRAPHIC_COMPONENT_H #include <allegro5/allegro.h> #include "defines.h" #include "point_2d.h" class graphic_component { private: float _w; float _h; protected: ALLEGRO_BITMAP *_bm; public: graphic_component(); graphic_component(...
ksomervi/invader
src/entity_store.h
<filename>src/entity_store.h #ifndef ENTITY_STORE_H #define ENTITY_STORE_H #include <cstdint> #include <deque> #include <random> #include "base_object.h" #include "logger.h" using _pool = std::deque< base_object* >; class entity_store { private: _pool _store; _pool _active; int _next_i...
ksomervi/invader
src/resource.h
#ifndef INVADER_RESOURCE_H #define INVADER_RESOURCE_H class resource { private: public: enum rtype { NONE, PLAYER, AUDIO, TEXTURE, FONT, DISPLAY }; resource(); resource(rtype, const char*); virtual ~resource() = 0; rtype type(); void type(rtype); //one of bitmap, sound, game ...
ksomervi/invader
src/enemy_controller.h
<filename>src/enemy_controller.h #ifndef ENEMY_CONTROLLER_H #define ENEMY_CONTROLLER_H #include <allegro5/allegro.h> #include <map> #include "base_controller.h" #include "random_generator.h" class enemy_controller : public base_controller { private: int _mv_count; random_generator *_rg; bool handle_e...
ksomervi/invader
src/game.h
<filename>src/game.h #ifndef INVADER_GAME_H #define INVADER_GAME_H #include <cstdio> #include <allegro5/allegro.h> #include <allegro5/allegro_font.h> #include <allegro5/allegro_ttf.h> #include <allegro5/allegro_image.h> #include <allegro5/allegro_primitives.h> #include <allegro5/allegro_audio.h> #include <allegro5/all...
ksomervi/invader
src/player_controller.h
#ifndef PLAYER_CONTROLLER_H #define PLAYER_CONTROLLER_H #include <allegro5/allegro.h> #include <map> #include "base_controller.h" #include "point_2d.h" class player_controller : public base_controller { private: std::map<int, bool> _key_pressed; public: player_controller(); ~player_controller(); ...
ksomervi/invader
src/random_generator.h
<reponame>ksomervi/invader<filename>src/random_generator.h #ifndef _RANDOM_GENERATOR_H #define _RANDOM_GENERATOR_H #include <random> class random_generator { private: std::default_random_engine _generator; public: random_generator(); int random_int(const int&, const int&); float random_float(con...
ksomervi/invader
src/game_controller.h
<gh_stars>0 #ifndef GAME_CONTROLLER_H #define GAME_CONTROLLER_H #include <allegro5/allegro.h> #include <map> #include "base_controller.h" #include "point_2d.h" class game_controller : public base_controller { private: std::map<int, bool> _key_pressed; point_2d _dir; point_2d direction() override; ...
ksomervi/invader
src/point_2d.h
<reponame>ksomervi/invader #ifndef POINT_2D_H #define POINT_2D_H class point_2d { private: float _x; float _y; public: point_2d(); point_2d(float, float); point_2d(const point_2d&); void x(float); float x(void) const; void y(float); float y(void) const; bool operator==(co...
ksomervi/invader
src/enemy.h
#ifndef ENEMY_H #define ENEMY_H #include "base_object.h" #include "enemy_controller.h" class enemy : public base_object { private: public: enemy(); enemy(const enemy&); ~enemy(); base_object* clone() override; void update() override; }; //end class enemy #endif //!define...
ksomervi/invader
src/base_level.h
#ifndef BASE_LEVEL_H #define BASE_LEVEL_H #include "game_controller.h" #include "fighter.h" #include "entity_store.h" #include "level_configuration.h" using armada = entity_store; #include "overlay.h" //enum Difficulty { EASY, NORMAL, HARD }; class base_level { private: bool _quit; bool _complete; prot...
napnac/lispy
src/lval.c
<reponame>napnac/lispy #include <stdio.h> #include <stdlib.h> #include <string.h> #include "lval.h" #include "eval.h" /* ---------- Constructors & Destructors ---------- */ lval *lval_num(long num) { lval *val = malloc(sizeof(lval)); val->type = LVAL_NUM; val->num = num; return val; } lval *lval_str(ch...
napnac/lispy
include/lval.h
#ifndef LVAL_H #define LVAL_H #include "mpc.h" #define ERROR_BUFFER_SIZE 512 struct lval; struct lenv; typedef struct lval lval; typedef struct lenv lenv; typedef lval*(*lbuiltin)(lenv*, lval*); // Lispy Value struct lval { int type; // Basic long num; char *str; char *sym; char *err; // Fun...
napnac/lispy
src/lispy.c
#include <stdio.h> #include <stdlib.h> #include "mpc.h" #include "prompt.h" #include "parser.h" #include "eval.h" #include "lval.h" mpc_parser_t *Number; mpc_parser_t *String; mpc_parser_t *Comment; mpc_parser_t *Symbol; mpc_parser_t *Sexpr; mpc_parser_t *Qexpr; mpc_parser_t *Expr; mpc_parser_t *Lispy; int main(int...
napnac/lispy
include/prompt.h
#ifndef PROMPT_H #define PROMPT_H // Windows #ifdef _WIN32 #include <string.h> #define BUFFER_SIZE 2048 static char buffer[BUFFER_SIZE]; char *readline(char *prompt) { fputs(prompt, stdout); fgets(buffer, BUFFER_SIZE, stdin); char *copy; copy = malloc(strlen(buffer) + 1); strcpy(copy, buffer); co...
napnac/lispy
include/parser.h
<filename>include/parser.h #ifndef PARSER_H #define PARSER_H #include "mpc.h" extern mpc_parser_t *Number; extern mpc_parser_t *String; extern mpc_parser_t *Comment; extern mpc_parser_t *Symbol; extern mpc_parser_t *Sexpr; extern mpc_parser_t *Qexpr; extern mpc_parser_t *Expr; extern mpc_parser_t *Lispy; void init_...
napnac/lispy
include/eval.h
#ifndef EVAL_H #define EVAL_H #include "mpc.h" #include "lval.h" #define LASSERT(arg, cond, fmt, ...) \ if(cond) { \ lval *err = lval_err(fmt, ##__VA_ARGS__); \ lval_del(arg); ...
napnac/lispy
src/mpc.c
<gh_stars>0 #include "mpc.h" /* ** State Type */ static mpc_state_t mpc_state_invalid(void) { mpc_state_t s; s.pos = -1; s.row = -1; s.col = -1; return s; } static mpc_state_t mpc_state_new(void) { mpc_state_t s; s.pos = 0; s.row = 0; s.col = 0; return s; } /* ** Input Typ...
napnac/lispy
src/lenv.c
<reponame>napnac/lispy<gh_stars>0 #include <stdlib.h> #include <string.h> #include "lval.h" #include "eval.h" lenv *lenv_new(void) { lenv *env = malloc(sizeof(lenv)); env->parent = NULL; env->count = 0; env->sym = NULL; env->val = NULL; return env; } void lenv_del(lenv *env) { int iVar;...
napnac/lispy
src/eval.c
#include <string.h> #include <math.h> #include "eval.h" #include "lval.h" #include "parser.h" mpc_parser_t *Lispy; /* ---------- lval eval ---------- */ lval *lval_eval_sexpr(lenv *env, lval *val) { int iChild; // Evaluate all the children for(iChild = 0; iChild < val->count; ++iChild) val->cell[iC...
napnac/lispy
src/parser.c
#include "parser.h" mpc_parser_t *Number; mpc_parser_t *String; mpc_parser_t *Comment; mpc_parser_t *Symbol; mpc_parser_t *Sexpr; mpc_parser_t *Qexpr; mpc_parser_t *Expr; mpc_parser_t *Lispy; void init_parsers(void) { Number = mpc_new("number"); String = mpc_new("string"); Comment = mpc_new("comment"); ...
emdavoca/wee
include/wee/weegl.h
#pragma once #if defined(_MSC_VER) # include <windows.h> #endif #define GL_GLEXT_PROTOTYPES 1 #define GLEW_STATIC #include <GL/glew.h> #define BUFFER_OFFSET(i) ((char *)NULL + (i))
emdavoca/wee
include/wee/core/mat4.h
<reponame>emdavoca/wee #ifdef __cplusplus extern "C" { #endif void matmul4_c(const float*, const float*, float*); #ifdef __cplusplus } #endif
emdavoca/wee
include/wee/wee.h
<reponame>emdavoca/wee #ifndef _WEE_H_ #define _WEE_H_ #include <wee/config.h> #if defined(_MSC_VER) #include <Windows.h> # define __aligned_type(x) __declspec(align(x)) #elif defined(__GNUC__) # define __aligned_type(x) __attribute__((aligned(x))) #else # define __aligned_type(x) #endif #define __declare_aligned(T...
emdavoca/wee
include/wee/base/platform/SDL/SDL_Application.h
<reponame>emdavoca/wee #ifndef _SDL_APPLICATION_H_ #define _SDL_APPLICATION_H_ #include <wee/wee.h> struct SDL_Window; struct SDL_Renderer; struct SDL_Application; typedef int(*SDL_ApplicationCallback)(const struct SDL_Application*, const void*); typedef enum { SDL_APPLICATION_CALLBACK_CREATED, SDL_APPLICAT...
emdavoca/wee
src/main/cpp/wee/base/platform/sdl/SDL_Application.c
#include <weegl.h> #include <base/platform/SDL/SDL_Application.h> #include <SDL.h> #include <string.h> #define DELEGATE(x, arg_0, arg_1) \ return ptr->callback[x] ? ptr->callback[x](arg_0, (const void*)arg_1) : 0 typedef int(*SDL_ConditionalEvent)(const SDL_Event*); typedef void(*SDL_UnconditionalEvent)(const vo...
emdavoca/wee
src/main/cpp/wee/core/mat4.c
#include <core/mat4.h> void matmul4_c(const float* m0, const float* m1, float* d) { d[ 0] = (m0[ 0] * m1[0]) + (m0[ 1] * m1[4]) + (m0[ 2] * m1[ 8]) + (m0[ 3] * m1[12]); d[ 1] = (m0[ 0] * m1[1]) + (m0[ 1] * m1[5]) + (m0[ 2] * m1[ 9]) + (m0[ 3] * m1[13]); d[ 2] = (m0[ 0] * m1[2]) + (m0[ 1] * m1[6]) + (m0[ 2] * m1[10]...
emdavoca/wee
include/wee/gfx/texture.h
#pragma once #include <core/builder.hpp> namespace wee { template <typename T> struct texture : public builder<texture> { /*surface_format _format; T& format(const surface_format& val) { _format = val; return static_cast<T&>(*this); }*/ }; struct textu...
emdavoca/wee
src/test/cpp/picoro.h
<gh_stars>1-10 #ifndef PICORO_H #define PICORO_H #include <stddef.h> #ifdef __cplusplus extern "C" { #endif typedef struct coro coro; typedef struct coro* corohandle; typedef void*(*corofunc)(void*); corohandle coroutine(corofunc, size_t); int resumable(corohandle); void* resume(corohandle, void*); void* yield(void...
Justewi/CentralTrafficLightManagement
lightControler/src/MessageQueue.h
<reponame>Justewi/CentralTrafficLightManagement #ifndef MESSAGEQUEUE_H #define MESSAGEQUEUE_H #include <string> #include <vector> #include <algorithm> #include <sys/ioctl.h> #include <amqpcpp.h> #include <iostream> class MessageQueue { class ControllerMQHandler : public AMQP::TcpHandler { public: st...