clang-format

This commit is contained in:
2026-04-04 13:03:20 +02:00
parent 6a09d7219d
commit baee62b375
36 changed files with 2576 additions and 2408 deletions

View File

@@ -1,52 +1,54 @@
#include "core/jinput.hpp"
#include "core/jgame.hpp"
#include <string>
const bool *keystates;// = SDL_GetKeyboardState( NULL );
#include "core/jgame.hpp"
const bool* keystates; // = SDL_GetKeyboardState( NULL );
SDL_Event event;
Uint8 cheat[5];
bool key_pressed = false;
int waitTime = 0;
void JI_DisableKeyboard(Uint32 time) {
waitTime = time;
waitTime = time;
}
void JI_moveCheats( Uint8 new_key ) {
cheat[0] = cheat[1];
cheat[1] = cheat[2];
cheat[2] = cheat[3];
cheat[3] = cheat[4];
cheat[4] = new_key;
void JI_moveCheats(Uint8 new_key) {
cheat[0] = cheat[1];
cheat[1] = cheat[2];
cheat[2] = cheat[3];
cheat[3] = cheat[4];
cheat[4] = new_key;
}
void JI_Update() {
key_pressed = false;
keystates = SDL_GetKeyboardState( NULL );
key_pressed = false;
keystates = SDL_GetKeyboardState(NULL);
if (waitTime > 0) waitTime--;
if (waitTime > 0) waitTime--;
while ( SDL_PollEvent( &event ) ) {
if ( event.type == SDL_EVENT_QUIT ) JG_QuitSignal();
if( event.type == SDL_EVENT_KEY_UP ) {
key_pressed = true;
JI_moveCheats( event.key.scancode );
}
}
while (SDL_PollEvent(&event)) {
if (event.type == SDL_EVENT_QUIT) JG_QuitSignal();
if (event.type == SDL_EVENT_KEY_UP) {
key_pressed = true;
JI_moveCheats(event.key.scancode);
}
}
}
bool JI_KeyPressed(int key) {
return waitTime > 0 ? false : (keystates[key] != 0);
return waitTime > 0 ? false : (keystates[key] != 0);
}
bool JI_CheatActivated( const char* cheat_code ) {
bool found = true;
for( size_t i = 0; i < strlen( cheat_code ); i++ ) {
if( cheat[i] != cheat_code[i] ) found = false;
}
return found;
bool JI_CheatActivated(const char* cheat_code) {
bool found = true;
for (size_t i = 0; i < strlen(cheat_code); i++) {
if (cheat[i] != cheat_code[i]) found = false;
}
return found;
}
bool JI_AnyKey() {
return waitTime > 0 ? false : key_pressed;
return waitTime > 0 ? false : key_pressed;
}