Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - HCDaniel

Pages: 1 ... 9 10 [11] 12
151
WME Lite / Re: Any Linux developers out there?
« on: June 01, 2013, 03:48:09 PM »
Ok, didn't know that SDL has its own defines, so I will use them.

I found quite some places in the code where platform dependent stuff is going on, so I was wondering whether you considered creating an OS abstraction layer to ease porting? I'm personally mainly interested in Linux and Android, so I'm also fine with just checking all the #defines, just wondering whether you want to collect all OS dependent stuff in one central place?

Now I understand where the device types come from. In Android I can probably ask for screen size and density - so maybe I can make a decision based on that. There are a lot of devices, and sometimes you cannot tell whether it is a phone or a tablet  :-\

I'll continue with asking you for platform-dependent functions that I do not understand, once I encounter them ;D

152
WME Lite / Re: Any Linux developers out there?
« on: June 01, 2013, 03:05:57 PM »
I have just checked where platform specific code is used in wmelite. I found these defines

   cat $i | grep "__WIN32__";
   cat $i | grep "__MACOSX__";
   cat $i | grep "__IPHONEOS__";
   cat $i | grep "_MSC_VER";
   cat $i | grep "__APPLE__";
   cat $i | grep "__IPHONE__";
   cat $i | grep "__OBJC__";

which indicate that some platform specific stuff is going on. I can check the corresponding files, and maybe add a "LINUX" or "ANDROID" define where applicable, once I am sure about the actual implementation. What makes me wonder though are the different defines for Apple platforms. Is there any reason for that, or shall I just ignore the different labels and carry on?

As for the Game::GetDeviceType() call, I currently don't know how to implement it properly. I need to check whether Android actually has such a distinction. The game I tested runs fine on an old Samsung phone (probably 4''), as well as Googles Nexus 7 and an older Acer tablet (10''), so is there any need to distinguish between phone and tablet?

153
WME Lite / Re: Any Linux developers out there?
« on: June 01, 2013, 12:31:43 PM »
Thanks for the pointer. I found that there no viewport translation happens, which was strange. The real problem was from my point of view that the query for possible resolutions was #ifdef __IPHONEOS__ only, so I added a define for android. Voila - fullscreen graphics and proper coordinates :) So while there's probably still a lot of work to do, I'm glad that wme lite seems to start looking interesting on Android now.

154
WME Lite / Re: Any Linux developers out there?
« on: June 01, 2013, 10:11:10 AM »
Ok, so I can take a look at the various defines soon. A similar mechanism to ask the app to save its state exists in Android as well, so I think this could be implemented in a similar way.

Meanwhile I did some more tweaks so that true type font rendering works. The correct way to fix this will be to add proper search paths. The only remaining major issue is now the touch offset. The game screen is aligned to the left bottom of the display, but the y-offset of the touch event is somehow added twice, so that the cursor is located always below the point where the touch happened. Do you have any idea what might cause this?

155
WME Lite / Re: Any Linux developers out there?
« on: May 31, 2013, 08:18:54 PM »
For the moment I have hardcoded "/mnt/sdcard" so that I can at least test how wmelite works on Android. Graphics output and sound work, font display is currently broken (might be due to the pretty old libfreetype that I am currently including) and touch input has a strange offset (it currently shows the mouse pointer some 50 pixels below where I touch), so I can walk around in the demo but not use anything or talk to the person.

In order to fill out the platform-dependent sections, are the two places you mentioned all that I should check? Or should I just grep the sources for all #ifdefs?

156
WME Lite / Re: Any Linux developers out there?
« on: May 29, 2013, 06:09:38 PM »
In Android, main() is not the starting point of an app. If you want to run native code, this has to be done via the Java-Native-Interface. So even in the case of WME which itself does not contain any Java, a small Java skeleton app is provided by SDL2 in order to let it run.

Furthermore I assume that any way to fetch the packages with the game data will be done in the Java domain, before WME is started (unless they are <50MB and they can be bundled with the app). In case of fetching via Google Play, there are libraries distributed by Google for that purpose.

In either way, the Java part of the app knows the path to the game packages, and could supply it to WME. I thought that the easiest (and maybe most platform independent) way is to add a cmdline switch for that. It could be useful for Windows and Linux where you have a command line (maybe Mac OS as well), and on Android it is supplied by the Java skeleton app.

Agreed, anything that is possible in Java is also possible to do in C, but it is more difficult to achieve and certainly not platform-independent.

I hope this clarifies a bit.

157
WME Lite / Re: Any Linux developers out there?
« on: May 29, 2013, 04:27:03 PM »
Ok, so for the moment I hardcoded "/mnt/sdcard/" so that I could at least run the demo project.

Android has several ways to supply resources, but once you hit the 50MB limit you can no longer ship it as one package (at least when installing via the play store). For that, Google has introduced "expansion files" which will be downloaded when you install the app.

Long story short, in the end your Java app wrapper knows where your files are supposed to be, so you need to get that information to WME. How about adding this to the arguments of main() in some way?

158
WME Lite / Re: Any Linux developers out there?
« on: May 29, 2013, 10:25:21 AM »
Hi Mnemonic,

how does WME lite search for the game packages? In Android, I cannot simply add them to the "current" directory, so I would have to specify a dedicated path. I would want to supply this as an argument to WME's main(), so how can I do that?

159
WME Lite / Re: Any Linux developers out there?
« on: May 27, 2013, 06:13:51 PM »
Hi Mnemonic,

thanks for the hints. With exceptions enabled, the STL target and the boost-for-android headers I can now compile all source files for Android. Now I need to find appropriate references (and time) to generate libfreetype and libfreeimage for Android. Then I can see whether it'll link :) And finally I will have to check how to glue SDL to WME of course, on Android there's no main().

160
WME Lite / Re: Any Linux developers out there?
« on: May 26, 2013, 09:52:00 PM »
Android is more difficult. SDL exists (and compiles), BASS exists. What's missing are freetype, freeimage and boost libs, which have to be provided for that platform.

I tried to compile as much as possible of WME lite for Android (without linking), just by providing the necessary include files. The freetype and freeimage headers are ok, but the boost headers don't work. I'll check the error message in detail soon. EDIT: Looks like Android does not understand "std::runtime_error"?

Furthermore, Android native C++ code does not like (or not support at all, I'm not sure) C++ exceptions (maybe because it's too difficult to pass them to Java in case the exception is not caught in native code). So the compilation of SXString.cpp fails. I haven't checked the code whether it is possible to live without the use of exceptions in WME lite, if just for the Android platform.

Mnemonic, what's your opinion about C++ exceptions, and do you think you can get rid of the boost library anytime soon?

161
WME Lite / Re: Any Linux developers out there?
« on: May 26, 2013, 05:01:42 PM »
Hi Mnemonic,

I tried it the quick and dirty way, WME lite compiles for Linux (tested on Ubuntu 12.04 32 bit).

The compiler emits a lot of warnings. The one warning about "typedef ignored" I cannot silence without a source code change, so can you please apply commit 27cf77c from the forked version if it does not break the other builds?

Then there are a lot of warnings about using string literals which are passed to functions that do not define the character sequence as "const" - these I can switch off easily. I don't think you want to go through the painful process of fixing that ;)

Some more warnings appear that NULL is assigned to a non-pointer type - I switched them off as well. These would probably be easier to fix (and there's only a couple of them), but I don't know whether it is worth the effort.

The rest of warnings is here:
Code: [Select]
./BGame.cpp:4758:7: Warnung: mehrere Token am Ende der Direktive #else [standardmäßig aktiviert]
./BGame.cpp: In Elementfunktion »virtual HRESULT CBGame::ScCallMethod(CScScript*, CScStack*, CScStack*, char*)«:
./BGame.cpp:2088:32: Warnung: Format »%x« erwartet Argumenttyp »unsigned int«, aber Argument 3 hat Typ »crc {aka long unsigned int}« [-Wformat]
just FYI. Nothing serious I would say.

I tested the sample game, I could play it but it segfaulted on exit. I'll see whether that is in WME or one of the libraries.

162
WME Lite / Re: Any Linux developers out there?
« on: May 25, 2013, 11:57:37 AM »
Hi Mnemonic,

I can give this a try when I'm finished pushing all my WME1 changes to you. I'm not too good at creating Makefiles or "./configure" scripts, but usually I get stuff to compile sooner or later :) So if nobody else steps up who has more experience in creating a proper Linux source package and handling dependencies in the right way, I can take a look.

163
Just checked out the sources and compiled the WME executable  :)

Just for curiosity, what was the motivation behind the license change to MIT license?

Are you interested in patches for WME1?

164
Hi Mnemonic,

is it possible for you to release the sources for the wme executable? The reason I ask is that I would like to test the 1.10.1 release, but I use a patched version of the latest stable release and thus would need the sources of the 1.10.1 in order to test it.

165
I experimented a bit and found that changing the code in

void CAdActor::TurnTo(TDirection dir)

to this:

   // already there?
   if(abs(delta) < 2)
   {
      m_Dir = dir;
      m_TargetDir = dir;
      m_State = m_NextState;
      m_NextState = STATE_READY;
      m_TempSprite2 = NULL;
      return;
   }

solved the problem for me. Although I have no idea what "m_TempSprite2" actually does ;)

Any chance that this will be incorporated into the next WME release?

Pages: 1 ... 9 10 [11] 12

Page created in 0.386 seconds with 23 queries.