-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from wojciechmadry/fix_resolution
Fix resolution
- Loading branch information
Showing
56 changed files
with
583 additions
and
557 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Dockerfile build | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build the Docker image | ||
run: docker build . --file Dockerfile --tag kulki_docker:$(date +%s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM ubuntu:22.04 | ||
|
||
WORKDIR /ws | ||
|
||
RUN apt update \ | ||
&& apt upgrade -y\ | ||
&& apt install -y\ | ||
libsfml-dev \ | ||
cmake \ | ||
ninja-build \ | ||
clang \ | ||
git | ||
|
||
ENV CC=clang | ||
ENV CXX=clang++ | ||
ENV BRANCH=master | ||
|
||
RUN git clone https://github.com/wojciechmadry/Kulki.git \ | ||
&& cd Kulki \ | ||
&& git checkout ${BRANCH} \ | ||
&& git submodule init \ | ||
&& git submodule update \ | ||
&& mkdir -p build \ | ||
&& cd build \ | ||
&& cmake -GNinja ../ \ | ||
&& ninja | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
Copyright (c) 2020 XMind ltd. All Rights Reserved | ||
|
||
This Font Software is licensed under the SIL Open Font License, Version 1.1. | ||
This license is copied below, and is also available with a FAQ at: | ||
http://scripts.sil.org/OFL | ||
|
||
----------------------------------------------------------- | ||
SIL OPEN FONT LICENSE Version 1.1 - 02 January 2020 | ||
----------------------------------------------------------- | ||
|
||
PREAMBLE | ||
The goals of the Open Font License (OFL) are to stimulate worldwide | ||
development of collaborative font projects, to support the font creation | ||
efforts of academic and linguistic communities, and to provide a free and | ||
open framework in which fonts may be shared and improved in partnership | ||
with others. | ||
|
||
The OFL allows the licensed fonts to be used, studied, modified and | ||
redistributed freely as long as they are not sold by themselves. The | ||
fonts, including any derivative works, can be bundled, embedded, | ||
redistributed and/or sold with any software provided that any reserved | ||
names are not used by derivative works. The fonts and derivatives, | ||
however, cannot be released under any other type of license. The | ||
requirement for fonts to remain under this license does not apply | ||
to any document created using the fonts or their derivatives. | ||
|
||
DEFINITIONS | ||
"Font Software" refers to the set of files released by the Copyright | ||
Holder(s) under this license and clearly marked as such. This may | ||
include source files, build scripts and documentation. | ||
|
||
"Reserved Font Name" refers to any names specified as such after the | ||
copyright statement(s). | ||
|
||
"Original Version" refers to the collection of Font Software components as | ||
distributed by the Copyright Holder(s). | ||
|
||
"Modified Version" refers to any derivative made by adding to, deleting, | ||
or substituting -- in part or in whole -- any of the components of the | ||
Original Version, by changing formats or by porting the Font Software to a | ||
new environment. | ||
|
||
"Author" refers to any designer, engineer, programmer, technical | ||
writer or other person who contributed to the Font Software. | ||
|
||
PERMISSION AND CONDITIONS | ||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of the Font Software, to use, study, copy, merge, embed, modify, | ||
redistribute, and sell modified and unmodified copies of the Font | ||
Software, subject to the following conditions: | ||
|
||
1) Neither the Font Software nor any of its individual components, | ||
in Original or Modified Versions, may be sold by itself. | ||
|
||
2) Original or Modified Versions of the Font Software may be bundled, | ||
redistributed and/or sold with any software, provided that each copy | ||
contains the above copyright notice and this license. These can be | ||
included either as stand-alone text files, human-readable headers or | ||
in the appropriate machine-readable metadata fields within text or | ||
binary files as long as those fields can be easily viewed by the user. | ||
|
||
3) No Modified Version of the Font Software may use the Reserved Font | ||
Name(s) unless explicit written permission is granted by the corresponding | ||
Copyright Holder. This restriction only applies to the primary font name as | ||
presented to the users. | ||
|
||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font | ||
Software shall not be used to promote, endorse or advertise any | ||
Modified Version, except to acknowledge the contribution(s) of the | ||
Copyright Holder(s) and the Author(s) or with their explicit written | ||
permission. | ||
|
||
5) The Font Software, modified or unmodified, in part or in whole, | ||
must be distributed entirely under this license, and must not be | ||
distributed under any other license. The requirement for fonts to | ||
remain under this license does not apply to any document created | ||
using the Font Software. | ||
|
||
TERMINATION | ||
This license becomes null and void if any of the above conditions are | ||
not met. | ||
|
||
DISCLAIMER | ||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT | ||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE | ||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL | ||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM | ||
OTHER DEALINGS IN THE FONT SOFTWARE. |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
|
||
![](sources/cover.png) | ||
|
||
# The NeverMind Font Family | ||
|
||
[NeverMind](https://www.behance.net/gallery/89046307/NeverMind) is the brand font of Xmind. It is a font family based on the logotype used and designed by [Xmind](https://www.xmind.net/). It is geometric and humanist font, modern and friendly, and can be used for all types of communication. It is a available in 10 weights (100-1000) and supports 109 languages including German, French, Greek and Russian. | ||
|
||
This font family currently includes one basic typeface and more than ten different fonts in various styles, including round, handwritten, serif, slab and so on. | ||
|
||
## Font Details | ||
|
||
* **All Fonts** | ||
|
||
The font family contains all following fonts: | ||
|
||
[**NeverMind**](https://www.behance.net/gallery/89046307/NeverMind) | ||
|
||
**NeverMind family** | ||
|
||
NeverMind UltraCondensed | ||
NeverMind ExtraCondensed | ||
NeverMind Condensed | ||
NeverMind SemiCondensed | ||
NeverMind SemiExtended | ||
NeverMind Extended | ||
NeverMind ExtraExtended | ||
NeverMind UltraExtended | ||
NeverMind Headline | ||
|
||
NeverMind Compact | ||
NeverMind Display | ||
NeverMind Hand | ||
NeverMind Handwritting | ||
NeverMind Rounded Mono | ||
NeverMind Mono | ||
NeverMind Rounded | ||
NeverMind semi-serif | ||
NeverMind New Serif | ||
NeverMind Slab | ||
NeverMind Bauhaus | ||
NeverMind Pixel | ||
|
||
|
||
* **Supported languages** | ||
|
||
Most Latin languages, including, but not limited to, Afrikaans, Basque, Breton, Catalan, Danish, Dutch, English, Finnish, French, Gaelic, German, Icelandic, Indonesian, Irish, Italian, Norwegian, Portuguese, Saami, Spanish, Swahili, Swedish, russian and more over 100 languages. | ||
|
||
Note: Catalan is not strictly supported by Latin Std fonts because of the Ldot. Dutch is not strictly supported by Latin Std fonts because of the IJ glyph. Except for NeverMind, other fonts do not support Greek, Russian, icons, nor a series of opentye attributes. | ||
|
||
* **Font designer** | ||
|
||
The fonts were designed by [Xmind Designer Team](https://www.zcool.com.cn/u/18786155). | ||
|
||
## Styles | ||
|
||
![](sources/font-family.png) | ||
|
||
## Usage | ||
|
||
You can simply download fonts resource files and install to use. | ||
|
||
## LICENSE | ||
|
||
[SIL Open Font License.](LICENSE) | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// | ||
// Created by Wojtek on 20.11.2020. | ||
// | ||
|
||
#ifndef KULKI_DRAWER_HPP | ||
#define KULKI_DRAWER_HPP | ||
|
||
#include "map.hpp" | ||
#include "resource.hpp" | ||
|
||
void generate_started_object(ResourceHolder<sf::Drawable> &Resource, | ||
const sf::Font &font, uint16_t record, | ||
uint16_t score, float width, | ||
float height) noexcept; | ||
|
||
sf::RectangleShape | ||
make_rectangle(sf::Vector2f Size, sf::Vector2f Position, sf::Color Color, | ||
float OutlineThick = 0.0f, | ||
sf::Color OutlineColor = sf::Color::Transparent) noexcept; | ||
|
||
class GLOBAL { | ||
public: | ||
static void INIT(ResourceHolder<sf::Drawable> &Resource, | ||
const sf::Font &sfFont, | ||
std::pair<uint16_t, uint16_t> RECORDS, float width, | ||
float height) noexcept; | ||
static void UPDATE_RESOLUTION(ResourceHolder<sf::Drawable> &Resource, | ||
float width, float height); | ||
|
||
[[nodiscard]] static float get_white_box_size() noexcept; | ||
|
||
[[nodiscard]] static bool BALL_TEXTURE() noexcept; | ||
|
||
[[nodiscard]] static bool BACKGROUND_TEXTURE() noexcept; | ||
|
||
[[nodiscard]] static bool RED_BOX_TEXTURE() noexcept; | ||
|
||
private: | ||
inline static bool m_BALL_TEXTURE = | ||
false; // Texture to ball is load? //NOLINT | ||
inline static bool m_BG_TEXTURE = | ||
false; // Texture background is load ? //NOLINT | ||
inline static bool m_RED_BOX_TEXTURE = | ||
false; // Red box texture is load ? //NOLINT | ||
|
||
inline static float a{0.0f}; // Side length of white box | ||
inline static float radius{0.0f}; // Radius of circle | ||
|
||
static void calculate_static_vars(float width, float height); | ||
static void create_ball(ResourceHolder<sf::Drawable> &Resource); | ||
static void create_white_box(ResourceHolder<sf::Drawable> &Resource); | ||
static void create_map_before_grid(ResourceHolder<sf::Drawable> &Resource, | ||
float width, float height); | ||
static void update_ball_texture(ResourceHolder<sf::Drawable> &Resource); | ||
static void update_redbox_texture(ResourceHolder<sf::Drawable> &Resource); | ||
static void update_background_texture(ResourceHolder<sf::Drawable> &Resource, | ||
float width, float height); | ||
static void update_started_objects(ResourceHolder<sf::Drawable> &Resource, | ||
float width, float height); | ||
}; | ||
|
||
void draw_window(sf::RenderWindow &window, map &Map, | ||
ResourceHolder<sf::Drawable> &Resource); | ||
|
||
// Simplify sf::Text | ||
sf::Text make_text(const std::string &text, const sf::Vector2f &pos, | ||
sf::Color color, uint32_t size, const sf::Font &font); | ||
|
||
// Scales cor on screen to cor on grid | ||
// ex.: cor can be position on screen {320, 15} | ||
// and return value is cor {x, y} on grid | ||
// cor = {320, 15} or cor {325, 15} etc. will show the same position {x, y} on | ||
// grid Every square of grid is 70x70 pixel. | ||
std::pair<int8_t, int8_t> MapCorToGrid(sf::Vector2<float> cor, float width, | ||
float height) noexcept; | ||
|
||
#endif // KULKI_DRAWER_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.