>CAPTAIN COAL (ALLAH) OWNS THIS WEBSITE FUCK SOOT I HAVE YOUR IPS BITCHES
  • Welcome. Registering and having your account be approved may take a while since there's only one guy checking and approving accounts and guestposts

SoyBooru / Soybooru.com

  • Thread starter Thread starter Empire of Soyim
  • Start date Start date
  • Featured
  • General Soysphere 
  • Tags Tags
    boorucuck gillkoyim is a brappy caca jimbo was raped by a black homeless man kill all boorubraps kill all boorucucks musdummy was fu.ck.ed by many noob op here i'm trans btw op is a noob op is a cacaot op is a noob op is gaaay op is trans btw if that matters op was a sex slave for al quaeda snca trevor is a pedophile wordsalot is a cacaot wordsalot is a noob wordsalot lost wordsalot was raped by a black homeless man
General thread
saying that like its an insult
Metrooooooooooooooooooooooooooooo

WHERE IS THE RUST REWRITE I WAS PROMISED
1768051050630.jpeg
 
Last edited by a moderator:
i've never seen C shills who use C
C:
#pragma once

#include <stdlib.h>
#include "raylib.h"

typedef enum {
    CONTROLS_UP,
    CONTROLS_UP_ALT,
    CONTROLS_DOWN,
    CONTROLS_DOWN_ALT,
    CONTROLS_LEFT,
    CONTROLS_LEFT_ALT,
    CONTROLS_RIGHT,
    CONTROLS_RIGHT_ALT,
    CONTROLS_ACTION_ALT,
    CONTROLS_SPECIAL_ALT,
    CONTROLS_UTILITY,
    CONTROLS_ENTER,
    CONTROLS_KCOUNT
} KeyboardControlType;

typedef enum {
    CONTROLS_ACTION,
    CONTROLS_SPECIAL,
    CONTROLS_MCOUNT
} MouseControlType;

#define KEYBOARD_CONTROL_COUNT CONTROLS_KCOUNT
#define MOUSE_CONTROL_COUNT CONTROLS_MCOUNT

typedef struct {
    KeyboardKey keys[KEYBOARD_CONTROL_COUNT];
} KeyboardControls;

typedef struct {
    KeyboardKey buttons[MOUSE_CONTROL_COUNT];
} MouseControls;

typedef struct {
    KeyboardControls keyboard;
    MouseControls mouse;
} Controls;

void controls_set_key(Controls* controls, KeyboardControlType action, KeyboardKey key);
void controls_set_mouse_button(Controls* controls, MouseControlType action, MouseButton button);
Controls* controls_init();

#ifdef CONTROLS_IMPLEMENTATION

Controls* controls_init(){
    Controls* c = malloc(sizeof(Controls));
    if (!c) {
        exit(-1);
    }

    c->keyboard.keys[CONTROLS_UP] = KEY_W;
    c->keyboard.keys[CONTROLS_UP_ALT] = KEY_UP;
    c->keyboard.keys[CONTROLS_DOWN] = KEY_S;
    c->keyboard.keys[CONTROLS_DOWN_ALT] = KEY_DOWN;
    c->keyboard.keys[CONTROLS_LEFT] = KEY_A;
    c->keyboard.keys[CONTROLS_LEFT_ALT] = KEY_LEFT;
    c->keyboard.keys[CONTROLS_RIGHT] = KEY_D;
    c->keyboard.keys[CONTROLS_RIGHT_ALT] = KEY_RIGHT;
    c->keyboard.keys[CONTROLS_ACTION_ALT] = KEY_Z;
    c->keyboard.keys[CONTROLS_SPECIAL_ALT] = KEY_X;
    c->keyboard.keys[CONTROLS_ENTER] = KEY_ENTER;

    c->mouse.buttons[CONTROLS_ACTION] = MOUSE_BUTTON_LEFT;
    c->mouse.buttons[CONTROLS_SPECIAL] = MOUSE_BUTTON_RIGHT;

    return c;
}

void controls_set_key(Controls* controls, KeyboardControlType action, KeyboardKey key){
    for (int k = 0; k < CONTROLS_KCOUNT; k++) {
        if (controls->keyboard.keys[k] == key) {
            controls->keyboard.keys[k] = KEY_NULL;
            break;
        }
    }
    controls->keyboard.keys[action] = key;
}

void controls_set_mouse_button(Controls* controls, MouseControlType action, MouseButton button){
    for (int m = 0; m < CONTROLS_MCOUNT; m++) {
        if (controls->mouse.buttons[m] == button) {
            controls->mouse.buttons[m] = controls->mouse.buttons[action];
        }
        controls->mouse.buttons[action] = button;
    }
}

#endif
1768051902830.png
 
C:
#pragma once

#include <stdlib.h>
#include "raylib.h"

typedef enum {
    CONTROLS_UP,
    CONTROLS_UP_ALT,
    CONTROLS_DOWN,
    CONTROLS_DOWN_ALT,
    CONTROLS_LEFT,
    CONTROLS_LEFT_ALT,
    CONTROLS_RIGHT,
    CONTROLS_RIGHT_ALT,
    CONTROLS_ACTION_ALT,
    CONTROLS_SPECIAL_ALT,
    CONTROLS_UTILITY,
    CONTROLS_ENTER,
    CONTROLS_KCOUNT
} KeyboardControlType;

typedef enum {
    CONTROLS_ACTION,
    CONTROLS_SPECIAL,
    CONTROLS_MCOUNT
} MouseControlType;

#define KEYBOARD_CONTROL_COUNT CONTROLS_KCOUNT
#define MOUSE_CONTROL_COUNT CONTROLS_MCOUNT

typedef struct {
    KeyboardKey keys[KEYBOARD_CONTROL_COUNT];
} KeyboardControls;

typedef struct {
    KeyboardKey buttons[MOUSE_CONTROL_COUNT];
} MouseControls;

typedef struct {
    KeyboardControls keyboard;
    MouseControls mouse;
} Controls;

void controls_set_key(Controls* controls, KeyboardControlType action, KeyboardKey key);
void controls_set_mouse_button(Controls* controls, MouseControlType action, MouseButton button);
Controls* controls_init();

#ifdef CONTROLS_IMPLEMENTATION

Controls* controls_init(){
    Controls* c = malloc(sizeof(Controls));
    if (!c) {
        exit(-1);
    }

    c->keyboard.keys[CONTROLS_UP] = KEY_W;
    c->keyboard.keys[CONTROLS_UP_ALT] = KEY_UP;
    c->keyboard.keys[CONTROLS_DOWN] = KEY_S;
    c->keyboard.keys[CONTROLS_DOWN_ALT] = KEY_DOWN;
    c->keyboard.keys[CONTROLS_LEFT] = KEY_A;
    c->keyboard.keys[CONTROLS_LEFT_ALT] = KEY_LEFT;
    c->keyboard.keys[CONTROLS_RIGHT] = KEY_D;
    c->keyboard.keys[CONTROLS_RIGHT_ALT] = KEY_RIGHT;
    c->keyboard.keys[CONTROLS_ACTION_ALT] = KEY_Z;
    c->keyboard.keys[CONTROLS_SPECIAL_ALT] = KEY_X;
    c->keyboard.keys[CONTROLS_ENTER] = KEY_ENTER;

    c->mouse.buttons[CONTROLS_ACTION] = MOUSE_BUTTON_LEFT;
    c->mouse.buttons[CONTROLS_SPECIAL] = MOUSE_BUTTON_RIGHT;

    return c;
}

void controls_set_key(Controls* controls, KeyboardControlType action, KeyboardKey key){
    for (int k = 0; k < CONTROLS_KCOUNT; k++) {
        if (controls->keyboard.keys[k] == key) {
            controls->keyboard.keys[k] = KEY_NULL;
            break;
        }
    }
    controls->keyboard.keys[action] = key;
}

void controls_set_mouse_button(Controls* controls, MouseControlType action, MouseButton button){
    for (int m = 0; m < CONTROLS_MCOUNT; m++) {
        if (controls->mouse.buttons[m] == button) {
            controls->mouse.buttons[m] = controls->mouse.buttons[action];
        }
        controls->mouse.buttons[action] = button;
    }
}

#endif
View attachment 82932
->
 
Back
Top Bottom