Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/ubuntu-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

name: Ubuntu Build

on:
push:
branches-ignore:
- master

jobs:
gcc-11-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Dependencies configuration
run: |
sudo apt-get update
sudo apt-get install libglfw3-dev libsfml-dev -y

- name: CMake configure
run: |
mkdir build
cd build
cmake ..

- name: CMake build
run: |
cd build
cmake --build . --config Release
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -468,3 +468,4 @@ FodyWeavers.xsd

!3rdparty/
!installer/
build/
9 changes: 4 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# MIT License
#
#
# Copyright (c) 2021 Stefano Allegretti, Davide Papazzoni, Nicola Baldini, Lorenzo Governatori e Simone Gemelli
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down Expand Up @@ -40,7 +40,6 @@ set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT $

find_package(glfw3 REQUIRED)
find_package(OpenGL REQUIRED)
set(SFML_STATIC_LIBRARIES TRUE)
find_package(SFML COMPONENTS audio REQUIRED)

target_link_libraries(${ProjectName} glfw)
Expand Down
26 changes: 13 additions & 13 deletions include/shader.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// MIT License
//
//
// Copyright (c) 2021 Stefano Allegretti, Davide Papazzoni, Nicola Baldini, Lorenzo Governatori e Simone Gemelli
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down Expand Up @@ -60,19 +60,19 @@ unsigned int CreateShader(const char* filename, ShaderType type = ShaderType::No
GLenum shader_type;
std::string name;
switch (type) {
case ShaderType::Vertex:
shader_type = GL_VERTEX_SHADER;
case ShaderType::Vertex:
shader_type = GL_VERTEX_SHADER;
name = "Vertex";
break;
case ShaderType::Fragment:
shader_type = GL_FRAGMENT_SHADER;
case ShaderType::Fragment:
shader_type = GL_FRAGMENT_SHADER;
name = "Fragment";
break;
case ShaderType::Geometry:
shader_type = GL_GEOMETRY_SHADER;
case ShaderType::Geometry:
shader_type = GL_GEOMETRY_SHADER;
name = "Geometry";
break;
default:
default:
return -1;
}

Expand Down Expand Up @@ -155,7 +155,7 @@ struct Shader {
}

Shader(const char* prefix, bool geometry = false) : Shader(
(prefix + std::string(".vert")).c_str(),
(prefix + std::string(".vert")).c_str(),
(prefix + std::string(".frag")).c_str(),
geometry ? (prefix + std::string(".geom")).c_str() : nullptr) {}

Expand Down Expand Up @@ -200,4 +200,4 @@ struct Shader {

};

#endif SHADER_H
#endif // SHADER_H
34 changes: 17 additions & 17 deletions include/utility.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// MIT License
//
//
// Copyright (c) 2021 Stefano Allegretti, Davide Papazzoni, Nicola Baldini, Lorenzo Governatori e Simone Gemelli
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand All @@ -33,13 +33,13 @@
static bool isSte = false;
static unsigned int atlas;

static constexpr char* const kShaderRoot = "../shaders";
static constexpr char* const kTextureRoot = "../resources/textures";
static constexpr char* const kLevelRoot = "../resources/levels";
static constexpr char* const kSoundsRoot = "../resources/sounds";
static constexpr char* const kFontRoot = "../resources/fonts";
static constexpr char* const kScoresPath = "highscores.txt";
static constexpr char* const kLevelsList = "list.txt";
static constexpr char kShaderRoot[] = "../shaders";
static constexpr char kTextureRoot[] = "../resources/textures";
static constexpr char kLevelRoot[] = "../resources/levels";
static constexpr char kSoundsRoot[] = "../resources/sounds";
static constexpr char kFontRoot[] = "../resources/fonts";
static constexpr char kScoresPath[] = "highscores.txt";
static constexpr char kLevelsList[] = "list.txt";

static constexpr float kRatio = 16.f / 9.f;
static constexpr float kWorldHeight = 15.f; // It shall be higher in production
Expand All @@ -50,14 +50,14 @@ static constexpr float kVerticalShift = 0.3f; // kWorldHeight / 20.f;

static const glm::mat4 kProjection = glm::ortho(
-kWorldWidth / 2.f,
kWorldWidth / 2.f,
(-kWorldHeight / 2.f) + kVerticalShift,
(kWorldHeight / 2.f) + kVerticalShift,
0.1f,
kWorldWidth / 2.f,
(-kWorldHeight / 2.f) + kVerticalShift,
(kWorldHeight / 2.f) + kVerticalShift,
0.1f,
10.f);

unsigned int MakeTextureGeneral(const char* filename, int& width, int& height, bool nearest = false, bool alpha = false) {
// Texture
// Texture
unsigned int texture;
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
Expand Down Expand Up @@ -150,4 +150,4 @@ std::vector<std::string> LoadLevelsList() {
return res;
}

#endif // NIKMAN_UTILITY_H
#endif // NIKMAN_UTILITY_H
2 changes: 1 addition & 1 deletion src/Nikman.rc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ END

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON "F:\\progetti miei\\nikman\\resources\\Nikman.ico"
IDI_ICON1 ICON "..\\resources\\Nikman.ico"

#endif // Italian (Italy) resources
/////////////////////////////////////////////////////////////////////////////
Expand Down