Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
2e9ce5ddab
18
arenaEngine.c
Normal file
18
arenaEngine.c
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#include "arenaEngine.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "fileHandler.h"
|
||||||
|
#include <SDL2/SDL_thread.h>
|
||||||
|
#include <SDL2/SDL_mutex.h>
|
||||||
|
|
||||||
|
int initResources(tilesList) {
|
||||||
|
resOpen();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void genNewArena(int w, int h, ARENA_TILE* a[][]) {
|
||||||
|
a = malloc(sizeof(ARENA_TILE) * w * h);
|
||||||
|
|
||||||
|
for
|
||||||
|
}
|
24
arenaEngine.h
Normal file
24
arenaEngine.h
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#ifndef ARENAENGINE_H_
|
||||||
|
#define ARENAENGINE_H_
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
typedef struct items{
|
||||||
|
int type_id;
|
||||||
|
//texture?
|
||||||
|
int isFlat;
|
||||||
|
int minedId;
|
||||||
|
struct items;
|
||||||
|
}ITEMS;
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef struct a_tile{
|
||||||
|
int type_id;
|
||||||
|
//texture?
|
||||||
|
int isFlat;
|
||||||
|
int canBeMined;
|
||||||
|
//struct a_tile nextTile;
|
||||||
|
}ARENA_TILE;
|
||||||
|
|
||||||
|
#endif
|
3
arenaGUI.c
Normal file
3
arenaGUI.c
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "SDL2/SDL.h"
|
6
arenaGUI.h
Normal file
6
arenaGUI.h
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#ifndef ARENAGUI_H_
|
||||||
|
#define ARENAGUI_H_
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
15
fileHandler.c
Normal file
15
fileHandler.c
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
int resOpen(char* filename, FILE* f) {
|
||||||
|
char fLoc[128];
|
||||||
|
|
||||||
|
strcpy(fLoc, "resources/");
|
||||||
|
strcat(fLoc, filename);
|
||||||
|
f = fopen(fLoc, "rb");
|
||||||
|
|
||||||
|
if (f != NULL) return 0;
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
6
fileHandler.h
Normal file
6
fileHandler.h
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#ifndef FILEHANDLER_H_
|
||||||
|
#define FILEHANDLER_H_
|
||||||
|
|
||||||
|
int resOpen(char* filename);
|
||||||
|
|
||||||
|
#endif
|
10
main.c
10
main.c
@ -1,6 +1,16 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "logHelper.h"
|
||||||
#include "SDL2/SDL.h"
|
#include "SDL2/SDL.h"
|
||||||
|
#include "arenaEngine.h"
|
||||||
|
|
||||||
|
#define A_WIDTH 100 //Real value is A_X + 1
|
||||||
|
#define A_LENGHT 100
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
int arena[A_WIDTH][A_LENGHT];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
25
menuGUI.c
Normal file
25
menuGUI.c
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "SDL2/SDL.h"
|
||||||
|
|
||||||
|
void initDisplayLib() {
|
||||||
|
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
|
||||||
|
printf("Erreur chargement librairie SDL ! %s\n",SDL_GetError());
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int createMainWindows() {
|
||||||
|
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
|
||||||
|
printf("Erreur chargement librairie SDL ! %s\n",SDL_GetError());
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
SDL_Window *main_test;
|
||||||
|
main_test = SDL_CreateWindow("My test windows", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 320, 140, SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS);
|
||||||
|
SDL_Delay(5000);
|
||||||
|
SDL_DestroyWindow(main_test);
|
||||||
|
|
||||||
|
SDL_Quit();
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
@ -1,3 +1,7 @@
|
|||||||
|
#include "playerInterface.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "logHelper.h"
|
||||||
#include "SDL2/SDL.h"
|
#include "SDL2/SDL.h"
|
||||||
|
|
||||||
void initDisplayLib() {
|
void initDisplayLib() {
|
||||||
@ -16,3 +20,5 @@ void displayScreen(int scr_id) {
|
|||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
//return EXIT_SUCCESS;
|
//return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void refreshScreen() {}
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
#ifndef PLAYERINTERFACE_H_
|
#ifndef PLAYERINTERFACE_H_
|
||||||
#define PLAYERINTERFACE_H_
|
#define PLAYERINTERFACE_H_
|
||||||
|
|
||||||
|
enum scr_id{ARENA,MAIN_MENU,GAME_OVER};
|
||||||
|
|
||||||
void initDisplayLib();
|
void initDisplayLib();
|
||||||
void displayScreen(int scr_id);
|
void displayScreen(int scr_id);
|
||||||
|
void refreshScreen();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user