List of commits:
Subject Hash Author Date (UTC)
Bug fixes 1be19fe815ac742ac8b3d6db65dbaba1936640ff mse 2022-11-27 05:21:03
Convert Entity and Item to classes 217b7965a75513d94028d7f4399682477f55ae0e mse 2022-10-29 20:45:32
Add vnDrawStats 51ac185dc323ea564d60ef3bb675ab0855a966f7 mse 2022-09-05 09:10:33
Add cave-confec-gl2 targets (WIP) c89db928efc4b68d42d9b66079e444decedc49e2 mse 2022-08-16 04:24:50
Simplify debug target d55157f6ff96ec2103b2d703b96925b767c08ce2 mse 2022-08-16 03:45:00
Bump version to 0.8.0 6f5adaa7a93dff9a24ba03aef36f620d153816f4 mse 2022-08-08 12:16:23
Default saves to ./userdata and replace optional --savehere arg with --saveinos d0cb1ab86c2110cdc0f2aba19fc3843902d6a5ea mse 2022-08-08 11:42:21
Enable Chinese image buttons 3129899ee20ee1821b13db063dcd83477e37c505 mse 2022-08-06 04:44:38
Expand Chinese translations 2baa34f7247c32af12480feb801cb41787022115 mse 2022-08-04 18:34:02
Add VNHACK command 4539d3931617e58e73b295d6ca3679150acdcf78 mse 2022-08-04 06:59:04
Refactor FG3 to allow separate compilation eb1bb8bbc8c60169c2bbd789b38c608b4bb9cbab mse 2022-08-03 22:30:45
Fix menu bugs and bump to v0.7.11 ae193263f4b8461c299f6db66f130beae94724cc mse 2022-07-07 04:52:30
Bump version to 0.7.10 5f70f1aba48d3df67d5e4a70d9595e92aeac4afb mse 2022-05-11 10:54:09
ADV-style text advance 5fbb734d07a2dcf0162245b5afc6b5b4b9021b6f mse 2022-04-12 12:25:24
Switch interaction to mouse-up 345ce8d1ea9755f51365a2676cce0415f9cf68c2 mse 2022-04-10 21:07:15
Use gradient for text backdrop 6ad98cdaf4df37e8b24d9c1e8e2f9b0e904da9aa mse 2022-04-10 13:04:29
Improve vn button highlight 51b2c6c07b0cfb0efdb8cdf5cbeba49ef54d9ccb mse 2022-04-09 06:54:39
Darken the screen when drawing a menu with non-VN text 8f3bcee6d57817ea8c1dd999c68cb129dea1550c mse 2022-04-08 16:01:52
Upgrade the UI 45561487af001c5a790343690a792faeb14945d4 mse 2022-04-06 23:45:31
Progress on getting Emscripten builds working again (almost) e4276b7823027c7ac3a3afe30c3c30241f1c6642 mse 2022-04-01 11:16:56
Commit 1be19fe815ac742ac8b3d6db65dbaba1936640ff - Bug fixes
Author: mse
Author date (UTC): 2022-11-27 05:21
Committer name: mse
Committer date (UTC): 2022-11-27 05:21
Parent(s): 217b7965a75513d94028d7f4399682477f55ae0e
Signer:
Signing key:
Signing status: N
Tree: d51bfa70c20e36e026bc21bd198704df543bed0c
File Lines added Lines deleted
confec.cpp 44 21
include/fworld.h 30 34
File confec.cpp changed (mode: 100644) (index d8a348b..a018039)
... ... std::vector<fighter::Fighter> fighters;
520 520 // Number of save slots. // Number of save slots.
521 521 size_t save_slots = 3; size_t save_slots = 3;
522 522
523 // List of fworld player names.
524 std::vector<std::string> save_names = {};
523 // List of fworld player names and validity values.
524 std::vector<std::pair<std::string,bool>> save_names = {};
525 525
526 526 // The folder containing data for the current saved game. // The folder containing data for the current saved game.
527 527 std::string save_path = ""; std::string save_path = "";
 
... ... int main( int argc, char* argv[] ){
914 914 } }
915 915 } }
916 916
917 #ifdef __DEBUG__
918 windowed_mode = true;
919 #endif
920
917 921 // Default to a local path if there is no system user data folder. // Default to a local path if there is no system user data folder.
918 922 user_data_path = "userdata"; user_data_path = "userdata";
919 923
 
... ... int main( int argc, char* argv[] ){
1036 1040 ); );
1037 1041
1038 1042 // Set up graphical effects. // Set up graphical effects.
1043 std::string glsl_path = data_path +
1044 #ifdef FG3_H
1045 "/glsl3/";
1046 #else
1047 "/glsl2/";
1048 #endif
1049 printf( "Loading postfx...\n" );
1039 1050 bloomPipeline = LoadShaders( bloomPipeline = LoadShaders(
1040 data_path + "/glsl/postfx.vert",
1041 data_path + "/glsl/postfx.frag",
1051 glsl_path + "postfx.vert",
1052 glsl_path + "postfx.frag",
1042 1053 { "u_texture" } { "u_texture" }
1043 1054 ); );
1055 printf( "Loading rimlit_sprite...\n" );
1044 1056 rimlitSpritePipeline = LoadShaders( rimlitSpritePipeline = LoadShaders(
1045 data_path + "/glsl/rimlit_sprite.vert",
1046 data_path + "/glsl/rimlit_sprite.frag",
1047 { "u_texture" }
1048 );
1049 sunlitInstancePipeline = LoadShaders(
1050 data_path + "/glsl/sunlit_instance.vert",
1051 data_path + "/glsl/sunlit_instance.frag",
1057 glsl_path + "rimlit_sprite.vert",
1058 glsl_path + "rimlit_sprite.frag",
1052 1059 { "u_texture" } { "u_texture" }
1053 1060 ); );
1061 #ifdef FG3_H
1062 printf( "Loading sunlit_instance...\n" );
1063 sunlitInstancePipeline = LoadShaders(
1064 glsl_path + "sunlit_instance.vert",
1065 glsl_path + "sunlit_instance.frag",
1066 { "u_texture" }
1067 );
1068 #endif
1054 1069 fb_minimap = fgl::createFramebuffer( 256, 256 ); fb_minimap = fgl::createFramebuffer( 256, 256 );
1055 1070 framebuffer = fgl::createFramebuffer( fgl::getDisplayWidth(), fgl::getDisplayHeight() ); framebuffer = fgl::createFramebuffer( fgl::getDisplayWidth(), fgl::getDisplayHeight() );
1056 1071 fgl::setPipeline( fgl::colorModPipeline ); fgl::setPipeline( fgl::colorModPipeline );
 
... ... int main( int argc, char* argv[] ){
1073 1088 if( param == "VNHACK" ){ if( param == "VNHACK" ){
1074 1089 // Sync game data, potentially glitching or crashing the game. // Sync game data, potentially glitching or crashing the game.
1075 1090 // This is only useful as a last-resort workaround. // This is only useful as a last-resort workaround.
1076 if( world.entities[world.followEntity].bribeItems.empty() ){
1091 if( world.items.find(character_selected) != world.items.end()
1092 && world.entities[world.followEntity].bribeItems.empty() ){
1077 1093 world.entities[world.followEntity].bribeItems = world.entities[world.followEntity].bribeItems =
1078 1094 world.items[character_selected].entity.bribeItems; world.items[character_selected].entity.bribeItems;
1079 1095 } }
 
... ... int main( int argc, char* argv[] ){
1354 1370 for( auto &s : convo.screen.lines ){ for( auto &s : convo.screen.lines ){
1355 1371 if( i >= save_slots ) if( i >= save_slots )
1356 1372 break; break;
1357 if( convo.getVariable( "health" + std::to_string( i + 1 ) ) ){
1358 s = save_names[i] + " " + s;
1373 if( save_names[i].second == true ){ // health > 0
1374 s = save_names[i].first + " " + s;
1359 1375 }else{ }else{
1360 1376 // TODO: String definitions file. // TODO: String definitions file.
1361 1377 s = "[Empty]"; s = "[Empty]";
 
... ... void SyncSaveData( size_t slot ){
2563 2579 // Index save_names as slot minus 1 (0-indexed vs 1-indexed). // Index save_names as slot minus 1 (0-indexed vs 1-indexed).
2564 2580 if( save_names.size() < slot ) if( save_names.size() < slot )
2565 2581 save_names.resize( slot ); save_names.resize( slot );
2566 save_names[slot - 1] = ent.name;
2582 save_names[slot - 1] = {ent.name, ent.health > 0};
2567 2583 convo.setVariable( "health" + n, ent.health ); convo.setVariable( "health" + n, ent.health );
2568 2584 convo.setVariable( "day" + n, (long long)( ent.age / day_duration + 1.0 ) ); convo.setVariable( "day" + n, (long long)( ent.age / day_duration + 1.0 ) );
2569 2585 convo.setVariable( "money" + n, ent.money ); convo.setVariable( "money" + n, ent.money );
 
... ... void SyncSaveData( size_t slot ){
2576 2592 data_path, data_path,
2577 2593 user_data_path + "/" + n + ".json" user_data_path + "/" + n + ".json"
2578 2594 ); );
2579 save_names.push_back( ent.name );
2595 save_names.push_back( {ent.name, ent.health > 0} );
2580 2596 convo.setVariable( "health" + n, ent.health ); convo.setVariable( "health" + n, ent.health );
2581 2597 convo.setVariable( "day" + n, (long long)( ent.age / day_duration + 1.0 ) ); convo.setVariable( "day" + n, (long long)( ent.age / day_duration + 1.0 ) );
2582 2598 convo.setVariable( "money" + n, ent.money ); convo.setVariable( "money" + n, ent.money );
 
... ... void LoadMap( std::string file_path, bool autosave ){
3075 3091 fworld::Entity GetMapSpawn( std::string dataPath, std::string filePath ){ fworld::Entity GetMapSpawn( std::string dataPath, std::string filePath ){
3076 3092 // Load the map JSON file. // Load the map JSON file.
3077 3093 FILE* file = FileOpen( filePath.c_str(), "rb" ); FILE* file = FileOpen( filePath.c_str(), "rb" );
3078 if( !file ) return {};
3094 if( !file ) return fworld::Entity();
3079 3095 std::string text = ""; std::string text = "";
3080 3096 char buf[4096]; char buf[4096];
3081 3097 while( size_t len = fread( buf, 1, sizeof( buf ), file ) ){ while( size_t len = fread( buf, 1, sizeof( buf ), file ) ){
 
... ... fworld::Entity GetMapSpawn( std::string dataPath, std::string filePath ){
3093 3109 (long unsigned int)allocatedDocument.document.error.column, (long unsigned int)allocatedDocument.document.error.column,
3094 3110 filePath.c_str() ); filePath.c_str() );
3095 3111 jsonFreeDocument( &allocatedDocument ); jsonFreeDocument( &allocatedDocument );
3096 return {};
3112 return fworld::Entity();
3097 3113 } }
3098 3114
3099 3115 auto &info = allocatedDocument.document.root; // Map root. auto &info = allocatedDocument.document.root; // Map root.
 
... ... fworld::Entity GetMapSpawn( std::string dataPath, std::string filePath ){
3112 3128 } }
3113 3129
3114 3130 jsonFreeDocument( &allocatedDocument ); jsonFreeDocument( &allocatedDocument );
3115 return {};
3131 return fworld::Entity();
3116 3132 } }
3117 3133
3118 3134 fgl::Pipeline LoadShaders( std::string vertFile, std::string fragFile, std::vector<std::string> samplers ){ fgl::Pipeline LoadShaders( std::string vertFile, std::string fragFile, std::vector<std::string> samplers ){
 
... ... void SimulateParticles( double d ){
4882 4898 } }
4883 4899
4884 4900 void DrawFloorParticles(){ void DrawFloorParticles(){
4901 #ifdef FG3_H
4885 4902 static fgl::InstanceBuffer ib; static fgl::InstanceBuffer ib;
4886 4903 // Create an instance for each gib. // Create an instance for each gib.
4887 4904 for( auto &gib : gibs_on_floor ){ for( auto &gib : gibs_on_floor ){
 
... ... void DrawFloorParticles(){
4918 4935 // Set fog to its old color. // Set fog to its old color.
4919 4936 fgl::setFog( old_fog ); fgl::setFog( old_fog );
4920 4937 fgl::setPipeline( old_pipeline ); fgl::setPipeline( old_pipeline );
4938 #endif
4921 4939 } }
4922 4940
4923 4941 void DrawParticles(){ void DrawParticles(){
4942 #ifdef FG3_H
4924 4943 static fgl::InstanceBuffer ib; static fgl::InstanceBuffer ib;
4925 4944 // Create an instance for each gib. // Create an instance for each gib.
4926 4945 for( auto &gib : gibs ){ for( auto &gib : gibs ){
 
... ... void DrawParticles(){
4968 4987 // Set fog to its old color. // Set fog to its old color.
4969 4988 fgl::setFog( old_fog ); fgl::setFog( old_fog );
4970 4989 fgl::setPipeline( old_pipeline ); fgl::setPipeline( old_pipeline );
4990 #endif
4971 4991 } }
4972 4992
4973 4993 void DrawSettings(){ void DrawSettings(){
 
... ... void GameLoop( double d ){
5451 5471
5452 5472 glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
5453 5473
5454 if( convo.screen.bg.empty() ){
5474 if( convo.screen.bg.empty() && world.followEntity >= 0 && (size_t)world.followEntity < world.entities.size() ){
5455 5475 // Draw the world if there is one. // Draw the world if there is one.
5456 5476 if( world.map.empty() ){ if( world.map.empty() ){
5457 5477 // Nothing to do, so quit. // Nothing to do, so quit.
 
... ... void GameLoop( double d ){
5466 5486 auto p_x = player.x; auto p_x = player.x;
5467 5487 auto p_y = player.y; auto p_y = player.y;
5468 5488 auto p_direction = player.direction; auto p_direction = player.direction;
5469 player = world.items[character_selected].entity;
5489 printf("%s\n", character_selected.c_str()); // TODO: This apparently never triggers!
5490 auto item_it = world.items.find(character_selected);
5491 if( item_it != world.items.end() )
5492 player = item_it->second.entity;
5470 5493 character_selected = ""; character_selected = "";
5471 5494 player.x = p_x; player.x = p_x;
5472 5495 player.y = p_y; player.y = p_y;
File include/fworld.h changed (mode: 100755) (index b4081b5..3f52dfb)
... ... public:
115 115 std::string bribeFail; std::string bribeFail;
116 116 Inventory inventory; Inventory inventory;
117 117 Inventory bribeItems; Inventory bribeItems;
118 double speed;
119 double speedFactor;
120 double x;
121 double y;
122 double last_x;
123 double last_y;
124 double collisionRadius;
125 double fps;
126 double meleeRecovery;
127 double age;
128 double frame;
129 double boredom;
130 double stun;
131 bool walking;
132 bool staticCollisions;
133 int health;
134 int money;
135 int karma;
136 int sweetTooth;
137 int lactoseTolerance;
138 int meleeDamage;
139 int animationMode;
140 int task;
141 int direction;
142 int width;
143 int height;
118 double speed = 0.0;
119 double speedFactor = 0.0;
120 double x = 0.0;
121 double y = 0.0;
122 double last_x = 0.0;
123 double last_y = 0.0;
124 double collisionRadius = 0.0;
125 double fps = 0.0;
126 double meleeRecovery = 0.0;
127 double age = 0.0;
128 double frame = 0.0;
129 double boredom = 0.0;
130 double stun = 0.0;
131 bool walking = false;
132 bool staticCollisions = false;
133 int health = 0;
134 int money = 0;
135 int karma = 0;
136 int sweetTooth = 0;
137 int lactoseTolerance = 0;
138 int meleeDamage = 0;
139 int animationMode = 0;
140 int task = 0;
141 int direction = 0;
142 int width = 0;
143 int height = 0;
144 144 #ifdef GRINNINGLIZARD_MICROPATHER_INCLUDED #ifdef GRINNINGLIZARD_MICROPATHER_INCLUDED
145 145 MP_VECTOR<void*> path; MP_VECTOR<void*> path;
146 146 #else #else
 
... ... Entity World::parseEntity( const JsonValueStruct &o, std::string dataPath ){
1292 1292 ent.fps = fps ? fps : mapFps; ent.fps = fps ? fps : mapFps;
1293 1293 ent.meleeRecovery = getProp(properties,"meleeRecovery").getDouble(); ent.meleeRecovery = getProp(properties,"meleeRecovery").getDouble();
1294 1294 ent.age = getProp(properties,"age").getDouble(); ent.age = getProp(properties,"age").getDouble();
1295 ent.frame = 0.0;
1296 ent.boredom = 0.0;
1297 ent.stun = 0.0;
1298 ent.walking = false;
1299 1295 ent.staticCollisions = staticCol; ent.staticCollisions = staticCol;
1300 1296 ent.health = getProp(properties,"health").getInt(); ent.health = getProp(properties,"health").getInt();
1301 1297 ent.money = getProp(properties,"money").getInt(); ent.money = getProp(properties,"money").getInt();
1302 1298 ent.karma = getProp(properties,"karma").getInt(); ent.karma = getProp(properties,"karma").getInt();
1303 ent.money = getProp(properties,"sweetTooth").getInt();
1304 ent.sweetTooth = getProp(properties,"lactoseTolerance").getInt();
1305 ent.lactoseTolerance = getProp(properties,"meleeDamage").getInt();
1306 ent.meleeDamage = getProp(properties,"animationMode").getInt();
1299 ent.sweetTooth = getProp(properties,"sweetTooth").getInt();
1300 ent.lactoseTolerance = getProp(properties,"lactoseTolerance").getInt();
1301 ent.meleeDamage = getProp(properties,"meleeDamage").getInt();
1302 ent.animationMode = getProp(properties,"animationMode").getInt();
1307 1303 ent.task = type == "corpse" ? TASK_SLEEP : TASK_NONE; ent.task = type == "corpse" ? TASK_SLEEP : TASK_NONE;
1308 1304 ent.direction = getProp(properties,"direction").getInt(); ent.direction = getProp(properties,"direction").getInt();
1309 1305 ent.width = spriteWidth ? spriteWidth : o["width"].getInt(); ent.width = spriteWidth ? spriteWidth : o["width"].getInt();
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/mse/ConfectionerEngine

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/mse/ConfectionerEngine

Clone this repository using git:
git clone git://git.rocketgit.com/user/mse/ConfectionerEngine

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main