Page 4 of 6

Re: The Box, development tool, "Structural programming"

PostPosted: 14 Nov 2019, 11:40
by jdc
A follow up from previous post.

i'm digging a bit more in to the planning now is more robust.

think in this stage i you want to help you can, because with out the planning for the application is a bit hard to help out with out to know what people want with the software.

Now that i'm implementing links i did a bit more of updates, if you can you can comment/ suggestion how to do the tools links.

which you can read the explanation on the links/tools of the software :


while (exit_program != 1)
{

/* Title with color */

printf("\033[1;31m");
printf("Tools Menu - pick a option \n\n");
printf("\033[0m;")

printf("10. Advanced File Browser \n"); // the file browser to

See files, and link files automatically with other parts of the sotware, edit with tools, open correct tool, better move, etc...

printf("10. Game lore \n");
printf("10. Game lore : Add lore \n"); // spells, skills,
printf("3. Game lore : Create character \n"); // Templates
printf("10. Game lore : Screenplay Tool \n"); // Imagens e texto
printf("10. Game lore : Design Document \n"); // Templates, Images, Text
printf("10. Game lore : Name Generator \n");

Manage all the concept part of the lore in the game, add, remove stuff from the game, with out touching the code if possible


printf("10. Library's \n");
printf("10. Library's : Add \n");

Manage templates and librarys.

printf("10. Server : Database \n");
printf("10. Server : Web \n");
printf("10. Server : Local \n"); // RPG, rts,
printf("10. Server : Application \n"); // RPG, rts,
printf("10. Server : List \n");
printf("10. Server : Mail \n");
printf("10. Server : FTP \n");
prinf("1 Server : File storage : "); // Download, storage projects, torrents, Vários sites
printf("10. Server : The Box \n"); // Connect torrents

Have all the severs available and pre configured, if you need to program something that use that server or use the service

printf("10. Language tool \n"); //

Manage the langues in the pojects

printf("2. Team Management \n"); // Chat
printf("2. Team Management : Add Project \n");
printf("2. Team Management : Add User \n");
printf("2. Team Management : Add Task \n");
printf("2. Team Management : Add Debate \n");

Think in add a management for teams more robust then git hub which is very limited.

printf("2. Generic Management tool \n"); // Hoteis,
printf("2. Generic Management tool : Add Property \n");
printf("2. Generic Management tool : Add bill \n");
printf("2. Generic Management tool : Add client \n"); // Email, Contacts
printf("2. Generic Management tool : Add Entry \n"); // Email, Contacts
printf("2. Generic Management tool : Add Task \n"); // Email, Contacts

A extra that may help or not, manage bills and stuff you need for other things.

printf("2. Projects \n"); // Projects created
printf("1 projects Add: ");
printf("2. Projects : Add profile \n");
printf("2. Projects : Create \n");
printf("2. Projects : Syncronize \n");
printf("2. Projects : Import \n");
printf("2 projects : Information: ");
printf("10. Projects : Programing Simulation Enviorment \n");
printf("10. Projects : Database \n");
printf("10. Projects : Templates \n"); // Base projects, manager
printf("10. Projects : Tasks \n"); // add tasks

printf("1 projects: Debug: ");
printf("1 projects: Load Games : ");
printf("10. projects: Linker \n");
printf("10. projects: Compiler \n");

manage all the stuff in the pojects, automate some stuff which people do manually

printf("2. Particle tool \n");
printf("6. Standard Level Editor \n");

printf("10. Generic Animation \n"); // Base projects
printf("10. 3D model management \n"); // Base projects, Load models
printf("10. 3D Game Concept \n");
printf("10. Mapper \n"); // Structure
printf("6. 3D Shadder Tool \n");
printf("4. Debug Tool \n");

The initial plan to have standard tools for 3D, to add and remove stuff to game automatically, with out the use of code, or create the code automatically

//If not connect another color
printf("5. Market \n"); //Productos

printf("5. Market : add service or product \n");

At the moment there is no free publishing tool available, that i know is will increase profit for indies

printf("6. Social Tool \n"); // users, ranking content , wall
printf("6. Social Tool : add content \n");
printf("9. Social Tool : Settings \n"); //user
printf("9. Social Tool : add Web Page \n"); // Templates
printf("9. Social Tool : Edit Web Page \n");
printf("9. Social Tool : Chat \n");
printf("9. Social Tool : Post \n");
printf("9. Social Tool : projects \n");

prinf("1 Social Tool : Radio : "); // News, projects, music
prinf("1 Social Tool : TV : "); // News, about projects and updates.
// Ranking : sites, filmes, series, ...
prinf("1 Social Tool : Tournaments ");
prinf("1 Social Tool : Events ");

The social tool will publish your stuff and manage, add radio and tv which the software team will manage, or allow some content create from the users to be published.

prinf("1 Information ranked ");
prinf("1 Information ranked : Add ");

Free access to information, which will be better managed, maybe with databases

printf("7. Code snippet : add \n");
printf("8. Toturials \n");
printf("8. Toturials : Add \n"); // Tags
prinf("1 Toturials : Books : ");

The tutorial tool which is something I plan to do first, so you can access to information how stuff works in the software

printf("10. scientific Lab \n"); // Add experiments

Think in helping out research to have a free team research tool, think the planet is need of more science, it will probably be part of the social tool

printf("5 Settings: "); //language, Keyboard,
scanf("%d",&language);


printf("1 2D Concept Tool: "); // Create concepts
printf("1 2D Game Concept: "); // Design a 2D project
printf("1 2D Tiles : ");
printf("1 standad Interface "); //Interfaces
printf("1 Interface Design "); //Interfaces, Templates

The 2D part and interfaces management

printf("1 Standard Functions : ");

have pre build functionality to add to projects, more complex then sinppets.

printf("10. Standard Database \n");

printf("1 Code Editor : "); // link stuff automatically

A customized code editor to work with this stuff for example: "linking stuff automatically".

printf("1 Sound editing : "); // +-
printf("1 Video editing : "); //

Simple audio em video editing just to avoid loading a heavy software just for a simple task

prinf("1 Web : sites downloader tool : ");
printf("10. File converter \n"); // Active File
printf("10. Screen record \n");

some tools to help out manage other parts

printf("10. Exit \n");
printf("10. The Box info \n");

scanf("%d", &interface);


//printf("Choose interface : ");
//scanf("%s", str1);
//printf("Enter interface : %s", str1);
//interface = atoi (str1); // Convertes the string to a integer

if(interface == 1){
exit_program = 1;
break;

}

[/quote]

Re: The Box, development tool, "Structural programming"

PostPosted: 18 Nov 2019, 10:43
by jdc
Found this code may be of some help to other people :

https://stackoverflow.com/questions/390 ... -alignment

How to display info in a table format to console just with raw code.

7uLn0.jpg


A bit on my develop of the software, how complex the lore tool is becoming.

For example we can add all kind of lore stuff in to a files "database" format. Then it connect all this stuff to the design document. When your are building the document you can link stuff at that point from : -> projects to design document; from -> lore to design document, and to templates.

So let's say some one add a nice environment like a history with a few cities and a few characters to the "box lore tool". if you want your game to follow up on that history you just need to connect that "lore" to the design document or project and use the same librarys/templates and is done.

Think it will be also good for standardization of history's, for example the concept of race orc, can become more elaborated and standardized adding good environment to games. Or people could also go with their own stuff. But if you do not have that kind of skills to create this very nice story. You can set your environment on something already stable.

Another think i though in adding is a "project finance" tool like kickstarter , why pay 5% or 10% when you can add this stuff automatically in to a server and let people make their own decisions. Once you create your project you can automatically config what kind of finance could help your project.

How the links code look inside of the lore tool : Add stuff seperatilly with more detail or add with generic menu with all the options. If some already is scripted this functionality it add it automatically with "standard functions tool" to maybe the mapper which is the generic overview off all the relations/connections:

{l Code}: {l Select All Code}
   printf(" Game Lore Menu : pick option \n\n");
   printf("1. Exit tool\n");
   printf("2. List Lore  \n");
   printf("3. Add Lore  \n");
   printf("3. Add Design Document  \n");
   printf("3. Name Generator  \n");
   printf("3. Create character  \n");
   
   printf("10. Game lore : Add Religion \n");
   printf("10. Game lore : Add Races \n");
   printf("10. Game lore : Add Spells \n");
   printf("10. Game lore : Add Items  \n");
   printf("10. Game lore : Add Skills  \n");
   printf("10. Game lore : Add weapons \n");
   printf("10. Game lore : Add armor \n");
   printf("10. Game lore : Add Classes \n");
   printf("10. Game lore : Add History \n");
   printf("10. Game lore : Add Geography \n");
   printf("10. Game lore : Add Maps \n");
   printf("10. Game lore : Add Families \n");
   printf("10. Game lore : Add Guilds \n");
   printf("10. Game lore : Add Worlds \n");
   printf("10. Game lore : Add Citys \n");
   printf("10. Game lore : Add Monster RPG  \n");
   printf("10. Game lore : Add Monster SCI-FI  \n");
   printf("10. Game lore : add NPC  \n");
 

Re: The Box, development tool, "Structural programming"

PostPosted: 24 Nov 2019, 12:11
by jdc
Let's see if my next post i have a working version.

For now there is this stuff i'm working. A text format to manage projects. The text format, xml and jason are a bit heavy, creating something that is similar but in a more light version.

A way that this could work :

"link of the file", "place used" (main menu), order of display (1).
C:\Users\jdc\Documents\the_box_external_librarys\magic.png , main menu , 1 ;

It could be a transitory way before the file is added in to the code files in a function format or it could work this way, if it does not consume a lot of resources since one of the objectives of the project is to have a very efficient code.

A general overview of a project in the : text projects code :

{l Code}: {l Select All Code}

</1>

<title>

Mediev Titans

<description>

A DOTA inspired game, strategy

<3d models>

C:\Users\jdc\Documents\the_box_external_librarys\3D_medivel\Goblin\Goblin_model\GOBLIN.fbx  , level 1  , 1 ;

<images>

C:\Users\jdc\Documents\the_box_external_librarys\magic.png , main menu  , 1 ;
C:\Users\jdc\Documents\the_box_external_librarys\final.png , level 1  , 4 ;

<levels>

Main Menu ;
Level 1 ;



The dev version is online it have a lot of updates, working with file.h and path.h to manage stuff for file "browser tool" and "code editor tool". The stuff i posted before is now used, we will repeat the code in file.h and path.h in : browser tool and code editor since they use the same things. To prevent this, the code is moved a level in the hierarchy to a "object" or structural programming format. So they inherit.

This format is useful to code, It allow to write allot of pseudo code before we can start testing things. Because you can start codding normally, and if something repeats at some point is just a matter of moving the code up and down if is repeated or not.

The stuff in the folders is still a bit messy and not documented, it still need more work, the external library have a low poly 3D library that i'm working. Just one thing that is +- organized.

https://drive.google.com/open?id=1LqXNv ... ugL7glslMk The Box

https://drive.google.com/open?id=1D4Vi9 ... kv1HrnUH5x External librarys

https://drive.google.com/open?id=1JndNx ... jYF4nnt2di External Project

https://drive.google.com/open?id=1ZPZdA ... b7kErTkgGD External tools

Re: The Box, development tool, "Structural programming"

PostPosted: 01 Dec 2019, 17:08
by jdc
a small update:

How to to add large amount of information to txt files.

In previous update, i have something that look like a xml, but now i'm thinking there is no need for the user to read the files, the software can do that, and display the information formatted. It allow more amount of information in a file.

Which project or data is just a single line.

The software read like this and apply this format : name, author, genre, type, image, web page, etc... it uses order or numbers for position on which entry.

The txt file have only the information. The software recognizes positions. If there is no info in entry slot a empty field is added, like ", ," :

{l Code}: {l Select All Code}
lensman , autor , anime , sci-fi , 0.3 , lensman.jpg, https://www.youtube.com/watch?v=RpmTynxXGCM ;
Hunter D , autor,  , 4.5 , hunter_d.jpg,  ;
Eva  , autor , game , sci-fi ,  , eva.jpg, ;
Pokemon , autor , anime ,  , 0.3, tides_of_time.jpg, ;


This will be very fast execution. the code do this: It "explode" the strings by tokens first ";" an then by "," to get positions, and convert to data format to display.

Maybe it will use symbols instead of the language symbols ";" and "," to be compatible with descriptions on projects. but it will be the same thing.

Re: The Box, development tool, "Structural programming"

PostPosted: 07 Dec 2019, 11:30
by jdc
See if we can have some community around the software with a Facebook page : https://www.facebook.com/The-Box-101342 ... _todo_tour

Added a couple more tools like the encrypt and links manager tools for example : to not have links running around company's and probably hackers exploit a lot the information on the users. This will allow to have things protected inside the computer even if some one hack the computer cant access the information that easy.

the encrypt.c tool will be in the folder "tools".

Also now all tools or topics have tutorials on the top of the page for example :

the encrypt tool "encrypt.c" :

// http://www.trytoprogram.com/c-examples/ ... pt-string/

A tutorial on how to encrypt

the projects tool "projects.c" :

//#include <stdio.h>

//#include "application_structures\file.h";

// https://www.tutorialspoint.com/c_standa ... etchar.htm

// https://www.tutorialspoint.com/c_standa ... n_gets.htm

// https://www.tutorialspoint.com/c_standa ... _scanf.htm

// https://www.tutorialspoint.com/cprogram ... inters.htm

// https://www.tutorialspoint.com/c_standa ... printf.htm

// https://www.tutorialspoint.com/c_standa ... _fputs.htm


// https://www.tutorialspoint.com/cprogram ... ile_io.htm file open

// https://www.tutorialspoint.com/c_standa ... strtok.htm explode

/*
https://www.w3resource.com/c-programmin ... cise-1.php
https://www.dummies.com/programming/c/h ... ogramming/
*/

It detail all functions used to make it work.

----

This will make very easy to follow and to grab the code, which is very hard in most projects.

Re: The Box, development tool, "Structural programming"

PostPosted: 12 Dec 2019, 16:38
by jdc
released the planning for the "lore tool : spells" , -> the info + interface image is at the web page : https://www.facebook.com/The-Box-101342 ... _todo_tour

Re: The Box, development tool, "Structural programming"

PostPosted: 16 Dec 2019, 09:54
by jdc
How to plan your project.

A Post on structural objects or file objects about the difficulty i'm encountering.

"Tournaments", and "social events" are the same thing or another thing?

At first they look like different things, but if we analyse, they are the same.

Tournaments have:

- start time
- inscription (money or not)
- date
- location or format (online or fisical)
- people (or playes)
- Results (tournament or not a event could have videos to post)

Should this be a object or not? The answer is yes, is better to write a object, with minimal differences which lather can be used to other things.

This will be in our next update 0.0.2 the event.h to handle events and tournaments, or leagues. Was i mention on another post " see if my next post which is more a version" will have a couple of tools written in the console format or text.

Another example the file.h.

We have several actions

-File delete
- file copy,
-file, browse
etc...

We could start by putting it in the tool "file browser", but that can be used in other places, like code editor, maybe projects management and 3D, etc...

so it seems something local, relative to a tool, but then we repeat our self's, the key to a good programmer is not to repeat. Writing this functions 5, 7 times more, it means that many times more time used. And it means our code will be that much heavy, and could lead to more buy software because our code is unprofessional, repetition of code, low open source projects available.

etc...

This kind of objects could already exist:

-event.h
-file.h
-interface.h
...

so they will be in version 0.0.2 at least the raw versions because it will take a bit of time to develop planned code, but it will be much more stable and maintainable.

Some one asked how to do this? I answer the key is to connect every thing. If stuff is connect, it means less repetition. In the 0.0.2 version it will be more clear how this stuff is implemented and separated in to several solutions and not one big solution, which is problematic to develop and manage.

Good coding, and development.

Re: The Box, development tool, "Structural programming"

PostPosted: 16 Dec 2019, 14:40
by jdc
A follow up post on objects, to show the work i'm doing with the interface:

For example in the interface we have several elements:

-menu
-button
-box (html for example, use: list, div, span, ul, etc...)
-interface
-etc...

people can separate in to how many fragments they want.

What i did is convert it in to a object to avoid repetition:

int property_id;
int property_name;
int property_title;
int property_button;
int property_background_color;
int property_3d_model;
int property_padding;
int property_margin;
int property_pos_x;
int property_pos_y;
int property_pos_z;
int property_clickable;
int property_image;

to avoid :

button_image;
button_padding;
...
menu_image;
menu_padding;
...

We have only one element, because we are going to repeat our self's if we create a button, with background color, then a menu with background color, then a interface with background color and so on...

if it lather creates over complex syntax output on code we can always use snippets and leave our code unrepeated or with no repetitions.

Re: The Box, development tool, "Structural programming"

PostPosted: 18 Dec 2019, 08:04
by jdc
How the information is stored:

They work with an internal mini Database within the software without resorting to very heavy database software. Link information by keys. The character will fetch all skills that have the same character id. The skill keeps track of what character this skill corresponds to.

characters_index_keys = character_id, character_name, biografy_id, skill_id, spells_id, items_id, weapons_id, status_id;

skills_index_keys = character_id, skill_name, ability, tags, targets;

Normally this is how Databases work what I did was convert that method to .txt files. The character.txt file is related to the skills.txt file. Will avoid too much processing time will + direct no information.

Will be available in the next version: The Box 0.0.2

article translated with google translate, post at the page : https://www.facebook.com/The-Box-101342 ... _todo_tour

Re: The Box, development tool, "Structural programming"

PostPosted: 30 Dec 2019, 10:09
by jdc
As the features in C are so complex I will write a Debug tool for each theme. The software will have a "Folder" or additional folder called "Debug tools", where they will be there. It makes various tests for example the images: it loads the image tests and outputs the image and all the image functions information; Maybe check for errors, see if the image is at 100%. This will help develop the software, and perform various tests. With this tool you can develop only the part of the images and connect later later, without all the code working.

Also found this software which have a interface working is very nice to study code. Since have information we can't find in the toturials.

https://sites.google.com/a/liesenberg.b ... ficas-em-c
http://www.enchantia.com/software/graphapp/

Re: The Box, development tool, "Structural programming"

PostPosted: 18 Jan 2020, 06:09
by jdc
The Box Version 0.0.2

Still it does not have that much work that i wanted but is the possible work. The file have like 30 pages. It should have every thing you need to understand and develop. It explain: interfaces, code, objects, objectives, tools, tutorials, planning, etc…

2 PDF, and the box folder :

You should have access to the public folder

https://drive.google.com/drive/u/1/fold ... ugL7glslMk

Re: The Box, development tool, "Structural programming"

PostPosted: 18 Jan 2020, 18:36
by jdc
Update

Missed a small thing, how to convert code to procedural to use with the global objects.

Think the theory of structural programming could also be called stack programming, or have a stack part in it, because we do things by stacks.

In this example we are going to see a stack.

In this function from Lips of Luna, nodes for 3D models. How to covert it to procedural code:

{l Code}: {l Select All Code}
LIMdlModel* limdl_model_new_copy (

const LIMdlModel* model,int shape_keys)
{
 
int i;
LIMdlModel* self;


self = lisys_calloc (1, sizeof (LIMdlModel));
if (self == NULL)
 return NULL;
self->flags = model->flags;
self->bounds = model->bounds;

if (model->hairs.count)
{
 self->hairs.array = lisys_calloc (model->hairs.count, sizeof (LIMdlHairs));
 self->hairs.count = model->hairs.count;
 for (i = 0 ; i < model->hairs.count ; i++)
  limdl_hairs_init_copy (self->hairs.array + i, model->hairs.array + i);
}

if (model->lod.count)
{
   self->lod.array = lisys_calloc (model->lod.count, sizeof (LIMdlLod));
   self->lod.count = model->lod.count;
   for (i = 0 ; i < model->lod.count ; i++)
      limdl_lod_init_copy (self->lod.array + i, model->lod.array + i);
}
if (model->materials.count)
{
   self->materials.array = lisys_calloc (model->materials.count, sizeof (LIMdlMaterial));
   self->materials.count = model->materials.count;
   for (i = 0 ; i < model->materials.count ; i++)
      limdl_material_init_copy (self->materials.array + i, model->materials.array + i);
}
if (model->nodes.count)
{
   self->nodes.array = lisys_calloc (model->nodes.count, sizeof (LIMdlNode*));
   self->nodes.count = model->nodes.count;
   for (i = 0 ; i < model->nodes.count ; i++)
      self->nodes.array[i] = limdl_node_copy (model->nodes.array[i], 1);
}


The node.c file which will be kind of a stack if it works in C, didn't test it. This how i do it in PHP.

{l Code}: {l Select All Code}
#include model.h / global variables on models
#include draw.h

models = “model1, model2, model3” // models to load

#include node.c

----------Start  node.c----------------

while (models != not empty)
{
   for (i = 0 ; i < model->materials.count ; i++)
{
         limdl_material_init_copy (self->materials.array + i, model->materials.array + i);
   }

   for (i = 0 ; i < model->nodes.count ; i++)
         self->nodes.array[i] = limdl_node_copy (model->nodes.array[i], 1);
   }

}
---------end file----------

models_array // loaded models

#include draw.c // draw the models


the global variable should have the models loaded after the include of the file. The file is only procedural code. and is very fast. and very easy to read.

Re: The Box, development tool, "Structural programming"

PostPosted: 20 Jan 2020, 08:40
by jdc
Tutorial on code design and how the code is looking like :

Code refactor on Lips of Luna

The refactor of code does not seem that hard once we have the planning, was able to refactor high amount of code. Doing like this: first remove all dependency and leave only procedural code, “leave notes in case we want to know what is going on lather” do not remove libraries because on 2º stage we are going to need to get that extra code from the dependency's.

Object planning

Object planning this is already on the internet i din't invent it, the theory : “if a object is doing to much is bad and is if bad doing to little. So a object should deal with a set of functions in a proper way". For example Lips 3D model load first file is ok in therms of planning but the 2º part i called in this example : ”open model" and “load of model”, in this case is load of model, there are several files scattered with 50 lines which, in this case is doing to little.

I will convert them in to the “load model”, to deal with materials, particles, etc…

Code

Is more advanced then my PHP engine, it was only one layer, or two layers. In here we have several layers, and inheritance.

I usely put all variables on top to be more readable, but in here since we may reuse variables, putting them above the include, for now putting the settings in if and else, if need some kind of setting from file is just a matter of setting to true. “files_list = 1; // true”

to refactor functions : it transform them in a if with a true state, to use e need to set it to true.

But still have to see what will be the better design.

Dynamic functions

For now setting all to file object non dynamic, lather when it evolves if procedural can't handle it i will create a “system object” to pass things to procedural or handle the parts procedural can't.

A bit like PHP : it uses procedural based on a Object, or a set of objects.

How the code looks:


{l Code}: {l Select All Code}
#include variables.h
#mouse.h
#keys.h

language = "PT";
#include language.c

operating_system = "windows";
#include settings.c

mouse_arrow = "costume arrow";
#include mouse.c

keyboard_esq = "jump";
#include keys.c

//Concatenate

#include path.c //Open directorys

folders = {"", "c:/the_box/projects/models", "c:/the_box/projects/images"};
folders_index = {"models", "images"};
files_list = 1; // true
directory_list = 1; // true

#include open_folders.c // open folder

images = {"image1.jpg", "image2.jpg"};
images_index = {"menu_button", "menu_effect"};
#include jpg.c

models = {"model1.3D", "model2.3D"};
models_index = {"character", "character2"};
#include open_models.c // models open

3D_low_poly;

#include load_models.c

window_height = 400;
window_width = 400;

#include window.c

control_height = 400;
control_width = 400;

#include control.c

text_style = "liberation serif";
text_color = "black";

property_background = "white";
property_menu;

property_buttons = {"button1", "button2", "button3"};

property_button;

#include interface.c

draw_menu;
draw_map;
draw_models;

#include draw.c

Re: The Box, development tool, "Structural programming"

PostPosted: 21 Jan 2020, 13:52
by jdc
Graph App code, on draw pixels:

{l Code}: {l Select All Code}
get_pixel(Point p)
{
return 0x00FFFFFF; /* cheat for now, return white */
}

set_pixel(Point p, unsigned long c)
{
enable_drawing();

set_rgb(c);
draw_point(gc, p);
}

draw_point(Point p)
{
draw_point(gc, p);
}

draw_line(Point p1, Point p2)
{
draw_line(gc, p1, p2);
}


The drawing of pixels is in functions, this is something that could slow down the performance by a lot. This functions is called “N” hundreds of time.

Instead if convert them in to loops, will be much faster, think i will create some kind of map or area of the pixels, so i can access them lather. To know what have been done. Maybe the “layer.h” i talk earlier and people probably din't understand will come in help now. We could put pixels in layers. width coordinates. red buttons on this screen → "100px right position" 3 buttons 80px by 80px. Etc…

#include draw.c
----
while(draw_pixels != null){
→draw
→create map
}
---

Re: The Box, development tool, "Structural programming"

PostPosted: 21 Jan 2020, 20:41
by Pesciodyphus
jdc {l Wrote}:The drawing of pixels is in functions, this is something that could slow down the performance by a lot. This functions is called “N” hundreds of time.


I am still not sure that "The Box" is supposed to be, but instead of using a function to draw points, you could have the buffer as array, and set the pixels by writing to an index or pointer into the buffer. When you are done with drawing a frame, copy the buffer into the screen buffer, this is much faster.

In C (assuming this is C) you can use macros for that like:
{l Code}: {l Select All Code}
#define SET_PIXEL(x,y,col) buffer[(x)+(y)*scanline_size]=(col)
#define GET_PIXEL(x,y) (buffer[(x)+(y)*scanline_size])


Remember, function calls cause stack operations in machine code, so simple funktions that are called often can be converted to macros, for better performance.

Re: The Box, development tool, "Structural programming"

PostPosted: 21 Jan 2020, 21:16
by Lyberta
Pesciodyphus {l Wrote}:Remember, function calls cause stack operations in machine code, so simple funktions that are called often can be converted to macros, for better performance.


You forgot about the optimizer that will most likely inline functions automatically and the fact that modern CPUs have 32 MiB+ of cache.

Re: The Box, development tool, "Structural programming"

PostPosted: 26 Jan 2020, 08:57
by jdc
Just reading about macro now, thanks for the information.

Re: The Box, development tool, "Structural programming"

PostPosted: 26 Jan 2020, 08:58
by jdc
The "to do list"

The file is online, it have all the functionality need for this stage. No point in waiting to lunch it width the 0.0.3 version, since is needed now. The rest of updates if not necessary will come width the version, like updates to the to list and planning of the project. Or improvements to code.

https://drive.google.com/open?id=1tw3Uo ... IxZNTvzwtO

Re: The Box, development tool, "Structural programming"

PostPosted: 26 Jan 2020, 09:51
by jdc
Added a discord server :

https://discord.gg/g54Fgc

To prevent repetition from topics and debate ideas and code

Re: The Box, development tool, "Structural programming"

PostPosted: 26 Jan 2020, 14:37
by Lyberta
jdc {l Wrote}:Added a discord server :

https://discord.gg/g54Fgc

To prevent repetition from topics and debate ideas and code


Hello

Re: The Box, development tool, "Structural programming"

PostPosted: 27 Jan 2020, 09:41
by jdc
The code for the files :

test_bmp.c


Load the objects in to test debug tool bitmap : path and bitmap. As mention do some debug also for the bitmap to know if have any errors.

{l Code}: {l Select All Code}
//https://www.daniweb.com/programming/software-development/threads/146692/how-to-display-a-image-in-c
//https://cboard.cprogramming.com/c-programming/50007-reading-bitmap-image.html
// https://codereview.stackexchange.com/questions/8213/bitmap-implementation

#include <alloc.h>
#include <conio.h>
#include <graphics.h>
#include <stdio.h>
#include <stdlib.h>

#include "../application_structues/bitmap.h";
#include "../application_structues/path.h";

char images[5];
int loop;

void main()
{
   
int color;
int gd ;
int gm ;

gd = VGA ;
gm = VGAHI;

printf("%s \n File name");
printf("%s \n size", Size);
printf("%s \n reserved", Reserved);
printf("%s \n Offset", OffSet);
printf("%s \n Offset", headsize);
printf("%s \n Offset", Width);
printf("%s \n Offset", Height);
printf("%s \n Offset", Planes);
printf("%s \n Offset", BitsPerPixel);
printf("%s \n Compression", Compression);
printf("%s \n Compression", SizeImage);
printf("%s \n Compression", XPixelsPreMeter);
printf("%s \n Compression", YPixelsPreMeter);
printf("%s \n Compression", ColorsUsed);
printf("%s \n Compression", ColorsImportant);
 
initgraph(&amp;gd, &amp;gm, "");

images = {"test.bmp", "test2.bmp", "test3.bmp"};
folder = "c:/documents/the_box/debug_tools";

#include "../labraries_stack/bitmap.c";

getch();
closegraph();

}


The variables images and folder working . And the stack file to open images. Loading system library's to test debug tools

bitmap.c

the stack file. Going to get most possible performance by doing all width loops. For example string concatenation in a loop. This is the point of low level can get more performance width procedural code.
{l Code}: {l Select All Code}
//https://www.quora.com/How-can-I-display-image-in-C
//int ShowBMP(int x, int y, char* FileName)


size_t loop = sizeof(images)/ sizeof(images[0]); // elements in the array

/*
To determine the number of elements in the array, we can divide the total size of the array by the size of the array element.
*/

if(loop == 0)
{
   printf("error in the images array");
}
else
{
   
}

while (loop != 0){
   
   int b,a;
   BMP BMP_obj;
   unsigned char* Datas;
   int in = 0;
   unsigned char c = 0;
   
   int string_lenght;
   int string_lenght2;

   images[loop];
   
   if(folder == ""){
      printf("folder variable error");
   }
   
   //folder = "c:/documents/";
   string_lenght = 0;
   string_lenght2 = 0;
   
   while(folder != '\0'){ // length of string 1
      string_lenght++;
   }
   
   while(images[loop] != '\0'){ //
      string_lenght2++;
      file[string_lenght] = images[loop];
   }
   
    //for (j = 0; s2[j] != '\0'; ++j, ++i) // concatenating each character of s2 to s1
   //{
      //  s1[i] = s2[j];
    //}
   
   printf("After concatenation: ");
    puts(s1);
   
    // terminating s1 string
    s1[i] = '\0';
   
   while(file[string_lenght] != '\0')//calculate lenght of string
   {
      
   }

   FILE_pointer = fopen(file, "rb");

   if(!FILE_pointer){
      printf("Error : Unable to open file");
   }

   fread(&amp;BMP_obj, sizeof(BMP_obj), 1, FILE_pointer);

   if(BMP_obj.BitsPerPixel !=4)  // This isn't a 16 color bmp we can read;
   {
      fclose(FILE_pointer);
      printf("Error : File format not supported ..");
      exit(0);
   }

   fseek(FILE_pointer, BMP_obj.OffSet, SEEK_SET);
   
   Datas = (unsigned char*) calloc(BMP_obj.Width/2+1, sizeof(unsigned char));

   for(b = BMP_obj.Height; b >= 0; b--)
   {
      
      fread(Datas, sizeof(unsigned char), BMP_obj.Width/2, FILE_pointer);
      
      c = 0;
      in = 0;

      for(a = 0; a <= Obj.Width; a += 2)
      {
         c = (Datas[in] | 0x00) >>4;
         putpixel(a+x,b+y,c);
         c = (Datas[in] | 0xF0) &amp; 0x0F;
         putpixel(a+1+x,b+y,c);
         in++;
      }
   }

   free (Datas);
   fclose(FILE_pointer);

   loop--;
}


The bitmap.h

Still is not doing as much i wanted but is the possible work at the moment. To do Objects you need a lot of knowledge.
{l Code}: {l Select All Code}
const int BmpHeaderSize = 54;
struct BmpHeader
{
    char ID[2];
    long FileSize;
    long RESERVED;
    long BitmapDataOffset;
    long BitmapHeaderSize;
    long Width;
    long Height;
    short NrOfPlanes;
    short BitsPerPixel;
    long Compression;
    long BitmapDataSize;
    long HorizontalResolution;
    long VerticalResolution;
    long Colors;
    long ImportantColors;
};


Path.h

Is still a bit mess. But it suppose to inherit pointers for files and directory and variables for the same.

{l Code}: {l Select All Code}

char file[] ;
char file_path[] ;
char folder[];

char * path;
size_t string_length;
int path_length;
int extension_length;
int length;
const char * extension;

FILE * FILE_pointer; // FILE is a default structure that holds the information on the file, in order to work with files. Requires stdio.h, scanf printf
DIR * DIR_pointer; // DIR is a default structure that holds the information on the directory,


Hope you people like the post, i will try to put it working as soon as possible.

Re: The Box, development tool, "Structural programming"

PostPosted: 27 Jan 2020, 09:55
by jdc
Lyberta the invite expired forget to configure it to permanent:

This one is permanent width membership

https://discord.gg/j4PSWRE

Re: The Box, development tool, "Structural programming"

PostPosted: 30 Jan 2020, 10:55
by jdc
Added this object : file_map.h

it connects stuff for us inside the software

To Implemented auto generation of projects

Connected and linked files inside our project could be used in the mappper tool (in development). A more advanced connections or all connections in one place. In here it is used for development. We don't need knowledge on "framework" it kind know that for us.

Another placed is used is in the tutorial tool . For example we could know what files are using this tutorial. It connect a tutorial to files that are using that kind of theme.

Auto generation of projects also used : so we know what we need to include, and what kind of functionalitys, If we create a simple program that needs : a interface, text, math, operating system. The software knows what that files are and do to include and connect to mount the software.

{l Code}: {l Select All Code}
file_map.h

char file_name;
int file_hierarchy;   // order of include;
char file_functions[];     // functions it uses
char file_functionality; // what it does
char file_dependency's; // what it inherit
char file_theme; // the theme of the file or object "colors"
char file_operating_system;
char file_description;
char file_tutorials;
char file_types; // what kind of data it handles, jpg, models, etc...
char file_structure // where is loaded from or group of files, example : application structure
char file_description  // loads the description from the file. 



The other part is to store. We store stuff in the .txt files so we could also map a library used in C. External library, or a piece of code, from some kind of framework. It probably need also to link external files. If the framework is installed. We also could add parts of external code to our program.

Re: The Box, development tool, "Structural programming"

PostPosted: 05 Feb 2020, 06:42
by jdc
Width previous object we can now create a install tool or standard install tool. Which is the point of the software create standard things. Comments explain, but, it manage installation and dependency's for us.
So instead of a user know how to install jpg independent library we create a map of the installation width notes. The user only need to get the map files and it auto installs.

Could manage much more things, which are not in the design like: download directly the files, or link to site where the library is. Compile, edit files directly. More easy if you know dependency's etc…

install_tool.jpg

Re: The Box, development tool, "Structural programming"

PostPosted: 08 Feb 2020, 05:01
by jdc
Preparing the version 0.0.3 sharing another tool planning.

A costume text editor that works width the rest o the software. It loads a proper template to work width stuff inside the software.

In here comments will be separated from code editor. You add them in text editor, link width a function, then it will not occupy space in code, and if you need to move a function it will also move comment. If you need to call function again the text will also follow, no need to copy comment again or a tutorial linked width a function, can be any kind of thing.

The draw back is that links can be broken if you chance function name, but can create a mode in code editor for that prevent links to be broken. It detect previous name or link and rename link.

Another example of functionality, allow to post a pre formatted “format” to our web page, or design document, articles, etc…

text_editor.jpg